summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-02-28MdePkg/Include: Add Nasm.incYao, Jiewen
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1521 This is to add CET related instruction in Nasm because CET instruction is not supported yet. See https://www.nasm.us/xdoc/2.14.02/html/nasmdocb.html Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yao Jiewen <jiewen.yao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
2019-02-28NetworkPkg/DnsDxe: [CVE-2018-12178] Check the received packet size before ↵Jiaxin Wu
parsing the message. Fix CVE-2018-12178 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=809 The DNS driver only checks the received packet size against the minimum DNS header size in DnsOnPacketReceived(), later it accesses the QueryName and QuerySection beyond the header scope, which might cause the pointer within DNS driver points to an invalid entry or modifies the memory content beyond the header scope. This patch is to fix above problem. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wang Fan <fan.wang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
2019-02-28MdeModulePkg/RamDiskDxe: Restrict on RAM disk size (CVE-2018-12180)Hao Wu
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1134 Originally, the block size of created Ram disks is hard-coded to 512 bytes. However, if the total size of the Ram disk is not a multiple of 512 bytes, there will be potential memory access issues when dealing with the last block of the Ram disk. This commit will adjust the block size of the Ram disks to ensure that the total size is a multiple of the block size. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2019-02-28MdeModulePkg/PartitionDxe: Ensure blocksize holds MBR (CVE-2018-12180)Hao Wu
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1134 The commit adds checks for detecting GPT and MBR partitions. These checks will ensure that the device block size is big enough to hold an MBR (512 bytes). Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2019-02-27ShellBinPkg: Ia32/X64 Shell binary update.Ray Ni
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ray Ni <ray.ni@intel.com>
2019-02-27BaseTools:The BOM character is processed when python reads a fileFan, ZhijuX
When python3 reads an XML file it will parse the file in error if the file has a BOM Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2019-02-26Revert "DynamicTablesPkg: Fix protocol section"Sami Mujawar
This reverts commit bde673b2dcd1b087af7f49dd5f0c3b82b02172a5. Reverting this patch as Soft Feature Freeze for edk2-stable201903 started on 22 Feb 2019. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Alexei Fedorov <alexei.fedorov@arm.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
2019-02-26Revert "DynamicTablesPkg: Rename enum used for ID Mapping"Sami Mujawar
This reverts commit 1d49a75367ef6827b8b8f77f61e9ce245d1bdee3. Reverting this patch as Soft Feature Freeze for edk2-stable201903 started on 22 Feb 2019. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Alexei Fedorov <alexei.fedorov@arm.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
2019-02-26Revert "DynamicTablesPkg: Add OEM Info"Sami Mujawar
This reverts commit c788bdaba47536447ae37518a96d92e0da54aad7. Reverting this patch as Soft Feature Freeze for edk2-stable201903 started on 22 Feb 2019. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Alexei Fedorov <alexei.fedorov@arm.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
2019-02-26Revert "DynamicTablesPkg: DGB2: Update DBG2_DEBUG_PORT_DDI"Sami Mujawar
This reverts commit 6814256083a90ef218e7ae240e51922045175df1. Reverting this patch as Soft Feature Freeze for edk2-stable201903 started on 22 Feb 2019. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Alexei Fedorov <alexei.fedorov@arm.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
2019-02-26Revert "DynamicTablesPkg: Remove GIC Distributor Id field"Sami Mujawar
This reverts commit d3a15f435f9716aa2f2ea5e9b35fcda04f267ab4. Reverting this patch as Soft Feature Freeze for edk2-stable201903 started on 22 Feb 2019. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Alexei Fedorov <alexei.fedorov@arm.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
2019-02-26Revert "DynamicTablesPkg: Minor updates and fix typos"Sami Mujawar
This reverts commit 07f4e26eb6fe5203028ecfe9bad90d3b67dc72c8. Reverting this patch as Soft Feature Freeze for edk2-stable201903 started on 22 Feb 2019. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Alexei Fedorov <alexei.fedorov@arm.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
2019-02-26ArmPkg: Fix writes to GICv3 GICD_IROUTER<n> regSami Mujawar
According to ARM Generic Interrupt Controller Architecture Specification, GIC architecture version 3.0 and version 4.0, GICD_IROUTER<n> is a 64-bit register. Fixed code to use 64 bit MMIO write operations so that the Aff3 value (bits [39:32]) is written to GICD_IROUTER<n>. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reported-by: Carl van Schaik <carl@cog.systems> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2019-02-26EmbeddedPkg/VirtualRealTimeClockLib: Fix correctness issuesPete Batard
LibGetTime(): - Two variables were used for the epoch, where only one should have been [*]. - Also harmonize variable name to match the one used in LibSetTime. LibSetTime(): - Address possible underflows if time is set to start of epoch. - Ensure that time being read does actually match time that was manually set (plus the time elapsed since), by subtracting number of seconds since reset. [*] This fixes a build breakage, since one of these variables was set but never used, triggering a compiler diagnostic at some optimization levels. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2019-02-26BaseTools:PackageDocumentTools import lib error occurs.Fan, ZhijuX
Steps: 1. Download edk2 tree 2. Build BaseTools 3. Go to edk2\BaseTools\Scripts\PackageDocumentTools to run packagedoc_cli.py An error occurs if relative imports are used when running a file alone Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2019-02-26BaseTools: Fix a Eot issue.Feng, Bob C
FirmwareVolume.UnDispatchedFfsDict is mutated during iteration, convert the FirmwareVolume.UnDispatchedFfsDict.keys() to a new list to resolve this problem. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-02-26BaseTools: Eot failed when enable python3Feng, Bob C
The Eot will report error when python3 enabled. We replaced sdict with collections.OrderedDict in python3 patch set, but the sdict implement "append" method which is not implemented in collections.OrderedDict. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-02-25DynamicTablesPkg: Minor updates and fix typosSami Mujawar
Minor updates to comments and typo fixes. Also removed unused structure CM_ARM_CPU_INFO_LIST. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
2019-02-25DynamicTablesPkg: Remove GIC Distributor Id fieldSami Mujawar
According to ACPI 6.2 Specification - Errata A, 'One, and only one, GIC distributor structure must be present in the MADT for an ARM based system'. Therefore, the GIC Distributor ID field in the ACPI MADT GICD substructure can be set to zero and there is no need for the Configuration Manager to provide this information. Update the CM_ARM_GICD_INFO structure to remove the GicId field. Similarly update the MADT Generator to set the GicId field in the GICD substructure to zero. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
2019-02-25DynamicTablesPkg: DGB2: Update DBG2_DEBUG_PORT_DDISami Mujawar
The DBG2_DEBUG_PORT_DDI() macro supports adding only one Generic Base Address Register. Therefore, removed the superfluous parameter NumReg and updated the macro to use DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS which has a value 1. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
2019-02-25DynamicTablesPkg: Add OEM InfoSami Mujawar
Added option for OEMs to provide OEM Table ID and OEM Revision for ACPI tables. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
2019-02-25DynamicTablesPkg: Rename enum used for ID MappingSami Mujawar
Renamed the enum EArmObjIdMapping to EArmObjIdMappingArray and updated the IORT generator accordingly. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
2019-02-25DynamicTablesPkg: Fix protocol sectionSami Mujawar
Updated the Protocols section to reflect the protocols that are produced or consumed. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
2019-02-25DynamicTablesPkg/AcpiSpcrLibArm: Support 16550 UART.Ashish Singhal
Add support for 16550 UART to ACPI SPCR table as it is a supported UART type by HLOS. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
2019-02-25DynamicTablesPkg/DynamicTableManagerDxe: Update DEPEXAshish Singhal
DynamicTableManagerDxe initialization fails if gEdkiiDynamicTableFactoryProtocolGuid, gEdkiiConfigurationManagerProtocolGuid and gEfiAcpiTableProtocolGuid are not already available. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
2019-02-25ArmVirtPkg/PlatformBootManagerLib: display boot option loading/startingLaszlo Ersek
Consume PlatformBmPrintScLib, added earlier in this series. When BdsDxe+UefiBootManagerLib report LoadImage() / StartImage() preparations and return statuses, print the reports to the UEFI console. This allows end-users better visibility into the boot process. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1515418 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2019-02-25ArmVirtPkg/ArmVirtQemu*: enable minimal Status Code Routing in DXELaszlo Ersek
The EFI_RETURN_STATUS_EXTENDED_DATA feature from PI-1.7 (<https://mantis.uefi.org/mantis/view.php?id=1885>) enables platform code to learn about boot option failures (loading and launching) via status codes reported by the UEFI Boot Manager. In commit 59541d41633c, we removed all status code support from ArmVirtPkg. Reenable that support now, minimally, just to the extent so we can benefit from the PI-1.7 feature mentioned above: (1) Include the ReportStatusCodeRouterRuntimeDxe driver. This driver produces two protocols, EFI_STATUS_CODE_PROTOCOL and EFI_RSC_HANDLER_PROTOCOL. The former allows DXE phase modules and runtime modules to report (produce) status codes. The latter allows the same types of modules to register callbacks for status code handling (consumption). (Handler registration occurs only at boot time. Status codes are delivered to each handler at runtime as well, unless the handler is unregistered at ExitBootServices().) (2) Resolve ReportStatusCodeLib to a non-Null instance, for DXE_DRIVER modules only. This way DXE_DRIVER modules that use the REPORT_STATUS_CODE_EX() macro and friends will reach EFI_STATUS_CODE_PROTOCOL from point (1). (3) Set PcdReportStatusCodePropertyMask to 3 (the default value is 0). This causes the REPORT_STATUS_CODE_EX() macro and friends to let Progress Codes (bit#0) and Error Codes (bit#1) through to point (1). Debug Codes (bit#2) are filtered out. (4) Include no driver, for now, that registers any status code handler via EFI_RSC_HANDLER_PROTOCOL, from point (1). Status codes that reach ReportStatusCodeRouterRuntimeDxe will be thrown away. (5) Modify only the ArmVirtQemu* platforms. A status code handler will be added to "ArmVirtPkg/Library/PlatformBootManagerLib" in the next patch, and this library instance is not consumed by ArmVirtXen. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Julien Grall <julien.grall@linaro.org> Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1515418 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2019-02-25OvmfPkg/PlatformBootManagerLib: display boot option loading/startingLaszlo Ersek
Consume PlatformBmPrintScLib, added earlier in this series. When BdsDxe+UefiBootManagerLib report LoadImage() / StartImage() preparations and return statuses, print the reports to the UEFI console. This allows end-users better visibility into the boot process. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien.grall@linaro.org> Cc: Ray Ni <ray.ni@intel.com> Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1515418 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2019-02-25OvmfPkg: add library to track boot option loading/starting on the consoleLaszlo Ersek
Introduce the Platform Boot Manager Print Status Code Library (for short, PlatformBmPrintScLib) class for catching and printing the LoadImage() / StartImage() preparations, and return statuses, that are reported by UefiBootManagerLib. In the primary library instance, catch only such status codes that UefiBootManagerLib reports from the same module that contains PlatformBmPrintScLib. The intent is to establish a reporting-printing channel within BdsDxe, between UefiBootManagerLib and PlatformBmPrintScLib. Ignore status codes originating elsewhence, e.g. from UiApp's copy of UefiBootManagerLib. Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien.grall@linaro.org> Cc: Ray Ni <ray.ni@intel.com> Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1515418 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2019-02-25MdeModulePkg/UefiBootManagerLib: fix LoadImage/StartImage status code rep.Laszlo Ersek
In the EFI_RETURN_STATUS_EXTENDED_DATA structure from PI-1.7, there may be padding between the DataHeader and ReturnStatus members. The REPORT_STATUS_CODE_EX() macro starts populating the structure immediately after DataHeader, therefore the source data must provide for the padding. Extract the BmReportLoadFailure() function from EfiBootManagerBoot(), prepare a zero padding (if any) in a temporary EFI_RETURN_STATUS_EXTENDED_DATA object, and fix the REPORT_STATUS_CODE_EX() macro invocation. Cc: Dandan Bi <dandan.bi@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Star Zeng <star.zeng@intel.com> Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1539 Fixes: c2cf8720a5aad74230767a1f11bade2d86de3745 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2019-02-25MdeModulePkg/UfsBlockIoPei: Correct use of 'DeviceIndex' in BlkIO PPIHao Wu
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1474 Within UfsBlockIoPei, the current implementation of the Block IO(2) services: UfsBlockIoPeimGetMediaInfo UfsBlockIoPeimReadBlocks UfsBlockIoPeimGetMediaInfo2 UfsBlockIoPeimReadBlocks2 does not handle the input parameter 'DeviceIndex' properly. According to both of the PI spec and the function description comments: > DeviceIndex Specifies the block device to which the function wants > to talk. ... This index is a number from one to > NumberBlockDevices. But current codes incorrectly treat the valid range of 'DeviceIndex' as 0 to (NumberBlockDevices - 1). This commit is to address this issue. Cc: Jian J Wang <jian.j.wang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2019-02-25MdeModulePkg: Rename confusion function nameChen A Chen
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1536 To avoid the confusion caused by function name, rename EfiBootManagerGetNextFullDevicePath to EfiBootManagerGetNextLoadOptionDevicePath. As an API function should add EFIAPI prefix for this function. Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2019-02-25IntelSiliconPkg/MicrocodeUpdate: Fix incorrect checksum issueChen A Chen
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1020 The same issue has fixed in UefiCpuPkg/Microcode.c file. Please reference b6f67b4d58b81f12f63f5f8c94cf8af3600297ab to get more detail information. Cc: Ray Ni <ray.ni@intel.com> Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2019-02-25BaseTools: Add parameter check for the AsciiStringToUint64Feng, Bob C
If the input parameter AsciiString length is greater than 255, the GenFv will hang. This patch is to fix this issue. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-02-22BaseTools:Some build generated files content are not ordered on linuxFan, ZhijuX
If the WORKSPACE environment variable has been set,The variables that control stable sorting will not be set. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2019-02-22BaseTools: Fix a bug about Structure PCDFeng, Bob C
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1535 If there is Hii Structure Pcd, build will fail, root cause is that there is an incorrect variable access method used in code. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-02-22BaseTools:Build fail if define [DEPEX] in library infFan, ZhijuX
When define [DEPEX] in lib inf to build, it will fail and report" gUefiOvmfPkgTokenSpaceGuid.test1 used in [Depex] section should be used as FixedAtBuild type and VOID* datum type in the module." But we define this PCD to FixedAtBuild type and VOID* datum type indeed. DEC: [PcdsFixedAtBuild] gUefiOvmfPkgTokenSpaceGuid.test1 | {GUID("4096267b-da0a-42eb-b5eb-fef31d207cb4")}|VOID*|0x3c DSC: add pcd under lib inf as below: NULL|TestPkg/TestLib/TestLib.inf <PcdsFixedAtBuild> gUefiOvmfPkgTokenSpaceGuid.test1 | {GUID(gUefiOvmfPkgTokenSpaceGuid)} Lib inf:(TestPkg/TestLib/TestLib.inf) [Depex] gUefiOvmfPkgTokenSpaceGuid.test1 [FixedPcd] gUefiOvmfPkgTokenSpaceGuid.test1 Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2019-02-22BaseTool: Fixed incremental rebuild issue.Feng, Bob C
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1540 This issue in introduced by commit d943b0c339fe3d35ffdf9f580ccb7a55915c6854 To convert bytes to string, we need to use bytes.decode() instead of using str(bytes). If the source file is not a txt file, ignore that file. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-02-22BaseTool/GenC: Fix build error when type is BASE or USER_DEFINED.Jiewen Yao
https://bugzilla.tianocore.org/show_bug.cgi?id=1544 1) The GenC tool does not include the constructor/destructor for USER_DEFINED module. It should be included. Only constructor/destructor with BASE type is included here. The constructor/destructor with PEI/DXE/SMM type is still excluded to keep original behavior. 2) The GenC tool includes the UnloadImage code for BASE module. It should NOT be included. 3) The GenC tool uses EFI_STATUS and ASSERT_EFI_ERROR for BASE type. It should use RETURN_STATUS and ASSERT_RETURN_ERROR. 4) The GenC tool miss DebugLib.h for BASE or USER_DEFINED module AutoGen.c. Only Base.h is there. It should add Library/DebugLib.h. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2019-02-22MdeModulePkg: Add the runtime ResetSystemLib in MdeModulePkg.dscZhichao Gao
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1461 Add the runtime library instance of ResetSystemLib in MdeModulePkg.dsc to make sure it can build pass. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-02-22MdeModulePkg: Add a runtime library instance of ResetSystemLibZhichao Gao
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1461 Implement a runtime library instance of ResetSystemLib. It would use a internal point instead of gRT and convert it depend on gEfiEventVirtualAddressChangeGuid. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-02-22MdeModulePkg: Add a new API ResetSystem for PEI ResetSystemLibZhichao Gao
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1460 Add a new API ResetSystem for PEI ResetSystemLib to be in accord with DXE instance. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-02-22MdeModulePkg: Add a new API ResetSystem for Null versionZhichao Gao
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1460 Add a new API ResetSystem for BaseResetSystemLibNull to be in accord with other instances. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-02-22MdeModulePkg: Add a new API ResetSystem for DXE ResetSystemLibZhichao Gao
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1460 Add a new API ResetSystem for DXE ResetSystemLib. So the consumer of ResetSystemLib can use this API to reset system with additional reset data. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-02-22MdeModulePkg: Add the new API ResetSystem in the head fileZhichao Gao
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1460 Add the new API ResetSystem in the related head file so that the consumer can use it through the combination of library instance and head file. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-02-22MdeModulePkg: change the function name ResetSystemZhichao Gao
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1460 Change the function name form ResetSystem to RuntimeServiceResetSystem. Because ResetSystem and EfiResetSystem would be used in ResetSystemLib and RuntimeLib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-02-22ShellPkg: add array index check for shell delay optionZhichao Gao
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1528 Shell delay option without parameters do not check the index of shell parameter argv. Add index check to avoid invalid pointer references. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-02-22SecurityPkg/HddPassword: Add Security feature set support for ATA devHao Wu
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1529 This commit will add the 'Security feature set' support for ATA devices. According to the AT Attachment 8 - ATA/ATAPI Command Set (ATA8-ACS) specification, the Security feature set is an optional feature. In summary, the feature is a password system that restricts access to user data stored on an ATA device. A more detailed introduction of this feature can be referred from the ATA8-ACS spec. The HddPassword driver is composed of 2 parts: * A DXE driver and * A PEI driver The DXE driver consumes EFI_ATA_PASS_THRU_PROTOCOL instances and installs an HII GUI to manage the devices. If the managing device supports Security feature set, the HII page will provide the user with the ability to set/update/disable the password for this device. Also, if a password is being set via the Security feature set, a popup window will show during boot requesting the user to input password. Another feature supported by this driver is that for those managing devices with password set, they will be automatically unlocked during the S3 resume. This is done by the co-work of the DXE driver and the PEI driver: The DXE driver will save the password and the identification information for these devices into a LockBox, which is only allowed to restore during S3 resume. The PEI driver, during S3 resume, will restore the content in the LockBox and will consume EDKII_PEI_ATA_PASS_THRU_PPI instances to unlock devices. Cc: Chao Zhang <chao.b.zhang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
2019-02-22SecurityPkg/OpalPassword: Remove HW init codes and consume SSC PPIHao Wu
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1409 For the current implementation of OpalPassword drivers, it has a feature to support devices being automatically unlocked in the S3 resume. For this feature, two types of devices are supported: * ATA hard disks working under AHCI mode * NVM Express devices The support of this feature requires the above 2 types of device to be initialized at the PEI phase during S3 resume, which is done by the co-work of the OpalPasswordDxe driver and the OpalPasswordPei driver. More specifically, the OpalPasswordDxe will handle: * Pre-allocate MMIO resource and save it in a driver internal LockBox for OpalPasswordPei to retrieve; * Save the PCI configuration space of ATA controllers into boot script. Meanwhile, the OpalPasswordPei will handle: * Rely on the boot script for the PCI configuration space program of ATA controllers; * Restore the driver internal LockBox to get the MMIO resource; * Complete the PCI configuration space program for ATA and NVME controllers; * Initialize ATA and NVME controllers and devices. This commit will remove these hardware initialization related codes from the OpalPassword drivers. The hardware initialization will be covered by PEI storage device drivers (e.g. NvmExpressPei & AhciPei in the MdeModulePkg). After such codes removal, the OpalPasswordDxe will only handle: * Construct/update the S3StorageDeviceInitList LockBox with the managing ATA and NVME devices. And the OpalPasswordPei will only handle: * Locate Storage Security Command PPI instances to perform the device automatic unlock during the S3 resume. Cc: Chao Zhang <chao.b.zhang@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
2019-02-22OvmfPkg/LockBoxLib: Update the comments for API UpdateLockBox()Hao Wu
The previous commit: MdeModulePkg/SmmLockBoxLib: Support LockBox enlarge in UpdateLockBox() adds the support to enlarge a LockBox when using the LockBoxLib API UpdateLockBox(). This commit is to sync the API description comment of UpdateLockBox() with its counterparts in MdeModulePkg. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com>