summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* IntelFrameworkPkg UefiLib: Use comparison logic to check UINTN parameterLiming Gao2018-06-121-5/+5
| | | | | | | | | Commit cb96e7d4f7afdbaef0706f9251ae479639d85a28 changes the input parameter from BOOLEAN to UINTN. Its comparison logic should be updated. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdePkg UefiLib: Use comparison logic to check UINTN parameterLiming Gao2018-06-122-7/+7
| | | | | | | | | | Commit d2aafe1e410c80d1046f2d1e743055882ead8489 changes the input parameter from BOOLEAN to UINTN. Its comparison logic should be updated. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* ArmVirtPkg: switch to KVM safe IoLib implementationArd Biesheuvel2018-06-111-1/+1
| | | | | | | | | | Switch to the new IoLib implementation that will only use KVM safe instructions to perform MMIO memory accesses. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* MdePkg/BaseIoLibIntrinsic: make BaseIoLibIntrinsic safe for ArmVirt/KVMArd Biesheuvel2018-06-118-0/+1400
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KVM on ARM refuses to decode load/store instructions used to perform I/O to emulated devices, and instead relies on the exception syndrome information to describe the operand register, access size, etc. This is only possible for instructions that have a single input/output register (as opposed to ones that increment the offset register, or load/store pair instructions, etc). Otherwise, QEMU crashes with the following error error: kvm run failed Function not implemented R00=01010101 R01=00000008 R02=00000048 R03=08000820 R04=00000120 R05=7faaa0e0 R06=7faaa0dc R07=7faaa0e8 R08=7faaa0ec R09=7faaa088 R10=000000ff R11=00000080 R12=ff000000 R13=7fccfe08 R14=7faa835f R15=7faa887c PSR=800001f3 N--- T svc32 QEMU: Terminated and KVM produces a warning such as the following in the kernel log kvm [17646]: load/store instruction decoding not implemented The IoLib implementation provided by MdePkg/Library/BaseIoLibIntrinsic is based on C code, and when LTO is in effect, the MMIO accesses could be merged with, e.g., manipulations of the loop counter, producing opcodes that KVM does not support for emulated MMIO. So let's add a special ArmVirt flavor of this library that implements that actual load/store operations in assembler, ensuring that the instructions involved can be emulated by KVM. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Remove dsc nested include checking.Derek Lin2018-06-111-4/+15
| | | | | | | | | The dsc nested include checking make unexpected build error when building project A and switch to project B. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Derek Lin <derek.lin2@hpe.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* ArmPkg/CompilerIntrinsicsLib: fix GCC8 warning for __aeabi_memcpy aliasesMichael Zimmermann2018-06-111-5/+5
| | | | | | | | | | | | | | | | | | | | | | | This was the warning (shown for __aeabi_memcpy, __aeabi_memcpy4 and __aeabi_memcpy8): ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c:42:6: error: '__aeabi_memcpy8' alias between functions of incompatible types 'void(void*, const void *, size_t)' {aka 'void(void *, const void *, unsigned int)'} and 'void *(void *, const void *, size_t)' {aka 'void *(void *, const void *, unsigned int)'} [-Werror=attribute-alias] void __aeabi_memcpy8(void *dest, const void *src, size_t n); ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c:19:7: note: aliased declaration here void *__memcpy(void *dest, const void *src, size_t n) The problem is the different return type (void vs void*). So reshuffle the code so the prototypes match between the aliases. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com> [ardb: change prototype of internal __memcpy() and drop extra wrapper] Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* MdeModulePkg/EmmcDxe: demote DEBUG print to DEBUG_BLKIOArd Biesheuvel2018-06-111-1/+4
| | | | | | | | | | | | | Lower the priority of the DEBUG print in EmmcReadWrite(), which is emitted for each read or write operation to the eMMC device, which clutters up the log output of builds created with DEBUG_INFO enabled. Suggested-by: Pipat Methavanitpong <methavanitpong.pipat@socionext.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* CorebootModulePkg/CbSupportDxe: Remove SCI_EN settingBenjamin You2018-06-114-53/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current implemenation sets PM1_CNT.SCI_EN bit at ReadyToBoot event. However, this should not be done because this causes OS to skip triggering FADT.SMI_CMD, which leads to the functions implemented in the SMI handler being omitted. This issue was identified by Matt Delco <delco@google.com>. The fix does the following: - The SCI_EN bit setting is removed from CbSupportDxe driver. - Some additional checks are added in CbParseFadtInfo() in CbParseLib.c to output some error message and ASSERT (FALSE) if ALL of the following conditions are met: 1) HARDWARE_REDUCED_ACPI is not set; 2) SMI_CMD field is zero; 3) SCI_EN bit is zero; which indicates the ACPI enabling status is inconsistent: SCI is not enabled but the ACPI table does not provide a means to enable it through FADT->SMI_CMD. This may cause issues in OS. Cc: Maurice Ma <maurice.ma@intel.com> Cc: Prince Agyeman <prince.agyeman@intel.com> Cc: Matt Delco <delco@google.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Benjamin You <benjamin.you@intel.com> Reviewed-by: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Matt Delco <delco@google.com>
* ShellPkg/UefiShellAcpiViewCommandLib: Fix ECC issuesDandan Bi2018-06-1114-117/+178
| | | | | | | | | | | | | | | 1. Separate variable definition and initialization. 2. Make the variable naming following Edk2 rule. V2: Remove the updates of guard macros in header files. Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Evan Lloyd <evan.lloyd@arm.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* ShellPkg/UefiShellAcpiViewCommandLib: Fix ECC issuesDandan Bi2018-06-1122-447/+645
| | | | | | | | | | | | Make the function comments follow EDK2 coding style. Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Evan Lloyd <evan.lloyd@arm.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* BaseTools/UPT: Update the import statement to use StringUtilsYonghong Zhu2018-06-1127-79/+79
| | | | | | | | | | The patch 5a57246eab80 Rename String to StringUtils, but it didn't update the UPT Tool for the import statement which cause UPT tool break. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/Library/BaseSerialPortLib16550: Ensure FIFO Polled ModeLeo Duran2018-06-111-4/+12
| | | | | | | | | | | | Put the UART in FIFO Polled Mode by clearing IER after setting FCR. Also, add comments to show DLAB state for registers 0 and 1. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Leo Duran <leo.duran@amd.com> Cc: Star Zeng <star.zeng@intel.com> CC: Eric Dong <eric.dong@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* SignedCapsulePkg/SystemFirmwareUpdateDxe: Use progress APIKinney, Michael D2018-06-081-23/+67
| | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=801 Use PlatformFlashWriteWithProgress() instead of PlatformFLashWrite() so the user can be informed of the progress as a capsule is used to update a firmware image in a firmware device. Cc: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/DxeCapsuleLibFmp: Add progress bar supportKinney, Michael D2018-06-085-36/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=801 Based on content from the following branch/commits: https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport * Change Update_Image_Progress() to UpdateImageProcess() * Call DisplayUpdateProgressLib from UpdateImageProgress(). * Split out a boot service and runtime version of UpdateImageProgress() so the DisplayUpdateProgressLib is not used at runtime. * If gEdkiiFirmwareManagementProgressProtocolGuid is present, then use its progress bar color and watchdog timer value. * If gEdkiiFirmwareManagementProgressProtocolGuid is not present, then use default progress bar color and 5 min watchdog timer. * Remove Print() calls during capsule processing. Instead, the DisplayUpdateProgressLib is used to inform the user of progress during a capsule update. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/Ata/AtaAtapiPassThru: Enable/disable DEVSLP per policyRuiyu Ni2018-06-082-2/+235
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Chasel Chiu <chasel.chiu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/AtaAtapiPassThru: enable/disable PUIS per policyRuiyu Ni2018-06-084-2/+71
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Chasel Chiu <chasel.chiu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Add AtaAtapiPolicy protocol definitionRuiyu Ni2018-06-082-0/+61
| | | | | | | | | The patch adds AtaAtapiPolicy protocol which is produced by platform and consumed by AtaAtapiPassThruDxe driver. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/AtaAtapiPassThru: Spin up Power up in Standby devicesRuiyu Ni2018-06-082-5/+128
| | | | | | | | | | | | | | The patch adds support to certain devices that support PUIS (Power up in Standby). For those devices that supports SET_FEATURE spin up, SW needs to send SET_FEATURE subcommand to spin up the devices. For those devices that doesn't support SET_FEATURE spin up, SW needs to send read sectors command to spin up the devices. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Chasel Chiu <chasel.chiu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* BaseTools: Fix Section header size larger than elf file size bugYunhua Feng2018-06-084-5/+24
| | | | | | | | | | | Add the logic to handle the case that Section header size larger than elf file size. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Check elf sections alignment with MAX_COFF_ALIGNMENTYunhua Feng2018-06-082-2/+19
| | | | | | | | | | | Add the logic to check whether mCoffAlignment is larger than MAX_COFF_ALIGNMENT, and report error for it. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* CryptoPkg PeiCryptLib: Enable SHA384/512 supportZhang, Chao B2018-06-081-3/+3
| | | | | | | | | Enable SHA384/512 support in PEI phase. Cc: Long Qin <qin.long@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Long Qin <qin.long@intel.com>
* UefiCpuPkg: Remove X86 ASM and S filesLiming Gao2018-06-0724-2335/+7
| | | | | | | | | | | | | | | NASM has replaced ASM and S files. 1. Remove ASM from all modules expect for the ones in ResetVector directory. The ones in ResetVector directory are included by Vtf0.nasmb. They are also nasm style. 2. Remove S files from the drivers only. 3. https://bugzilla.tianocore.org/show_bug.cgi?id=881 After NASM is updated, S files can be removed from Library. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* SourceLevelDebugPkg: Remove X86 ASM and S filesLiming Gao2018-06-078-901/+4
| | | | | | | | | | | | NASM has replaced ASM and S files. 1. Remove ASM from all modules. 2. Remove S files from the drivers only. 3. https://bugzilla.tianocore.org/show_bug.cgi?id=881 After NASM is updated, S files can be removed from Library. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* IntelFrameworkModulePkg: Remove X86 ASM and S filesLiming Gao2018-06-075-288/+1
| | | | | | | | | | | | NASM has replaced ASM and S files. 1. Remove ASM from all modules. 2. Remove S files from the drivers only. 3. https://bugzilla.tianocore.org/show_bug.cgi?id=881 After NASM is updated, S files can be removed from Library. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
* MdeModulePkg: Remove X86 ASM and S filesLiming Gao2018-06-0722-3510/+6
| | | | | | | | | | | | NASM has replaced ASM and S files. 1. Remove ASM from all modules. 2. Remove S files from the drivers only. 3. https://bugzilla.tianocore.org/show_bug.cgi?id=881 After NASM is updated, S files can be removed from Library. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdePkg: Remove X86 ASM and S filesLiming Gao2018-06-07308-15375/+8
| | | | | | | | | | | | NASM has replaced ASM and S files. 1. Remove ASM from all modules. 2. Remove S files from the drivers only. 3. https://bugzilla.tianocore.org/show_bug.cgi?id=881 After NASM is updated, S files can be removed from Library. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
* ArmPkg/ArmDisassemblerLib: fix check for MSR instructionMichael Zimmermann2018-06-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | GCC8 reported it with the following warning: ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c: In function 'DisassembleArmInstruction': ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c:397:30: error: bitwise comparison always evaluates to false [-Werror=tautological-compare] if ((OpCode & 0x0db00000) == 0x03200000) { This condition tries to be true for both the immediate and the register version of the MSR instruction. They get identified inside the if-block using the variable I, which contains the value of bit 25. The problem with the comparison reported by GCC is that the bitmask excludes bit 25, while the value requires it to be set to one: 0x0db00000: 0000 11011 0 11 00 00 0000 000000000000 0x03200000: 0000 00110 0 10 00 00 0000 000000000000 ^ So the solution is to just don't require that bit to be set, because it gets checked later using 'I', which results in the following value: 0x01200000: 0000 00010 0 10 00 00 0000 000000000000 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* MdeModulePkg/DisplayUpdateProgressLib: Fix ECC issuesDandan Bi2018-06-072-4/+4
| | | | | | | | | | Make the comment align with Edk2 coding style. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* BaseTools/VolInfo: Update EFI FV FILETYPES for new MM types.Ezra Godfrey2018-06-061-0/+8
| | | | | | | | | | Add support for the following types to VolInfo: EFI_FV_FILETYPE_MM_STANDALONE EFI_FV_FILETYPE_MM_CORE_STANDALONE Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ezra Godfrey <egodfrey.qdt@qualcommdatacenter.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* BaseTools: Display both Hex and integer value format of PCD valueYunhua Feng2018-06-061-0/+40
| | | | | | | | | | | | If the PCD's datum type is UINT8, UINT16, UINT32 or UINT64, then in the report will display both hexadecimal format and integer format of PCD value. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Sort PCD by token space first then by PcdCNameYunhua Feng2018-06-061-163/+167
| | | | | | | | | | Sort PCD by token space first, then by PcdCName in the build report. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* IntelSiliconPkg IntelVTdDxe: Fix incorrect code to clear VTd errorStar Zeng2018-06-061-2/+4
| | | | | | | | | | | | | | | | According to VTd spec, Software writes the value read from this field (F) to Clear it. But current code is using 0 to clear the field, that is incorrect. And R_FSTS_REG register value clearing should be not in the for loop. Without this patch, we will see same VTd error message appears again and again after it occurs first time. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* EmbeddedPkg/TimeBaseLib: Add function to get Week day.Meenakshi Aggarwal2018-06-052-3/+43
| | | | | | | | | | | This patch add function EfiTimeToWday() which returns day of the week. It is needed by our upcoming patches in edk2-platforms. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com> Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* ArmPkg/PlatformBootManagerLib: load platform boot optionsHaojian Zhuang2018-06-052-0/+105
| | | | | | | | | | | | | Make platform driver to create predefined boot options and related hot keys. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: add platform boot manager protocolHaojian Zhuang2018-06-052-0/+87
| | | | | | | | | | | | | | Create the PlatformBootManagerProtocol that is used to add predefined boot options in platform driver. This interface will be used in ArmPkg/PlatformBootManagerLib. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* IntelFrameworkPkg FrameworkUefiLib: Fix in EfiLocateProtocolBuffer()Star Zeng2018-06-051-0/+4
| | | | | | | | | | Free HandleBuffer for error path in EfiLocateProtocolBuffer(). Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* MdePkg UefiLib: Fix in EfiLocateProtocolBuffer()Star Zeng2018-06-051-0/+4
| | | | | | | | | | Free HandleBuffer for error path in EfiLocateProtocolBuffer(). Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* MdeModulePkg BootManagerMenuApp: Update usage info for BootLogo protocolLiming Gao2018-06-051-2/+2
| | | | | | | | | | BootLogo protocol is not always required. If it not is installed, BootManagerMenuApp can work. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg: Make sure ResetSystemRuntimeDxe uses ResetSystemLibNullRuiyu Ni2018-06-051-1/+4
| | | | | | | | | | | Because the DxeResetSystemLib calls gRT->ResetSystem(), make sure the gRT->ResetSystem() implementation doesn't call into DxeResetSystemLib to avoid chicken-egg issue. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/DxeResetSystemLib: Avoid depending on UefiRuntimeLibRuiyu Ni2018-06-052-8/+7
| | | | | | | | | | | | | | | | | | | | | | | Current DxeResetSystemLib depends on UefiRuntimeLib because it calls EfiResetSystem() API exposed by UefiRuntimeLib. Due to the commit: "MdePkg/UefiRuntimeLib: Do not allow to be linked by DXE driver" which reverts UefiRuntimeLib to only support DXE_RUNTIME_DRIVER, removing UefiRuntimeLib dependency makes the DxeResetSystemLib can be used by DXE drivers. The patch also disallows the DxeResetSystemLib to be linked by runtime driver, SMM drivers. Runtime driver cannot link to this library because the gRT is not converted when entering to RT. SMM driver cannot link to this library because calling RT services from SMM after EndOfDxe violates security guideline. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com>
* MdePkg/UefiRuntimeLib: Do not allow to be linked by DXE driverRuiyu Ni2018-06-051-2/+2
| | | | | | | | | | | | | | | | | | When UefiRuntimeLib links to a DXE driver, its constructor still registers a Virtual Address Change event. The event callback will get called when RT.SetVirtualAddressMap() is called from OS. But when the driver is a DXE driver, the memory occupied by the callback function might be zeroed or used by OS since the BS type memory is free memory when entering to RT phase. The patch reverts commit 97511979b4fdd84cf7cd51e43c22dc03e79bd4f3 "MdePkg/UefiRuntimeLib: Support more module types." It makes sure that DXE driver cannot link to this library. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* CryptoPkg: Remove deprecated function usage in X509GetCommonName()Long Qin2018-06-053-14/+47
| | | | | | | | | | | | | | | | | | | | | BZ#: https://bugzilla.tianocore.org/show_bug.cgi?id=923 X509_NAME_get_text_by_NID() used in X509GetCommonName() implementation is one legacy function which have various limitations. The returned data may be not usable when the target cert contains multicharacter string type like a BMPString or a UTF8String. This patch replaced the legacy function usage with more general X509_NAME_get_index_by_NID() / X509_NAME_get_entry() APIs for X509 CommonName retrieving. Tests: Validated the commonName retrieving with test certificates containing PrintableString or BMPString data. Cc: Ye Ting <ting.ye@intel.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Long Qin <qin.long@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* MdeModulePkg PeiCore: Check error status when processing boot FVMarcin Wojtas2018-06-041-6/+7
| | | | | | | | | | | | Until now the possible errors returned from processing boot firmware volume were not checked, which could cause misbehavior in further booting stages. Add relevant assert. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas <mw@semihalf.com> Signed-off-by: Jan Dabros <jsd@semihalf.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* SignedCapsulePkg: add PcdLowestSupportedFirmwareVersionArd Biesheuvel2018-06-011-0/+4
| | | | | | | | | | Add a PCD that holds the lowest supported version number, so that we can allow the platform to configure this at build time. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg/FirmwarePerformanceDataTableDxe: use AllocatePeiAccessiblePagesArd Biesheuvel2018-05-292-42/+10
| | | | | | | | | | | | Replace the call to and implementation of the function FpdtAllocateReservedMemoryBelow4G() with a call to AllocatePeiAccessiblePages, which boils down to the same on X64, but does not crash non-X64 systems that lack memory below 4 GB. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/DxeCorePerformanceLib: use AllocatePeiAccessiblePagesArd Biesheuvel2018-05-291-41/+7
| | | | | | | | | | | | Replace the call to and implementation of the function FpdtAllocateReservedMemoryBelow4G() with a call to AllocatePeiAccessiblePages, which boils down to the same on X64, but does not crash non-X64 systems that lack memory below 4 GB. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdePkg/DxeServicesLib: introduce AllocatePeiAccessiblePages routineArd Biesheuvel2018-05-294-2/+155
| | | | | | | | | | | | | Add a routine to DxeServicesLib that abstracts the allocation of memory that should be accessible by PEI after resuming from S3. We will use it to replace open coded implementations that limit the address to < 4 GB, which may not be possible on non-Intel systems that have no 32-bit addressable memory at all. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* ArmVirtPkg/PlatformBootManagerLib: add missing report status code callArd Biesheuvel2018-05-292-0/+5
| | | | | | | | | | | Consumers of status code reports may rely on a status code to be reported when the ReadyToBoot event is signalled. For instance, FirmwarePerformanceDxe will fail to install the FPDT ACPI table in this case. So add the missing call. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg/PlatformBootManagerLib: add missing report status code callArd Biesheuvel2018-05-292-0/+5
| | | | | | | | | | | Consumers of status code reports may rely on a status code to be reported when the ReadyToBoot event is signalled. For instance, FirmwarePerformanceDxe will fail to install the FPDT ACPI table in this case. So add the missing call. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* OvmfPkg BasePciCapLib: Fix VS build failureLiming Gao2018-05-291-2/+2
| | | | | | | | | | | Fix VS warning C4244: 'function': conversion from 'UINT32' to 'UINT16', possible loss of data. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: remove whitespace after casts] Reviewed-by: Laszlo Ersek <lersek@redhat.com>