summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * Revert "EmbeddedPkg/Lan9118Dxe: use MemoryFence"Mark Rutland2016-05-102-26/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit a4626006bbf86113 ("EmbeddedPkg/Lan9118Dxe: use MemoryFence") replaced some stalls with memory fences, on the presumption that these were erroneously being used to order memory accesses. However, this was not the case. LAN9118 devices require a timing delay between state-changing reads/writes and subsequent reads, as updates to the register file are asynchronous and the effects of state-changes are not immediately visible to subsequent reads. This delay cannot be ensured through the use of memory barriers, which only enforce observable ordering, and not timing. Thus, converting these stalls to memory fences was erroneous, and may result in stale values being read. This reverts commit a4626006bbf86113453aeb7920895e66cdd04737. Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ryan Harkin <ryan.harkin@linaro.org> Signed-off-by: Mark Rutland <mark.rutland@arm.com> Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
| * ArmPkg/AArch64Mmu: don't let table entries inherit XN permission bitsArd Biesheuvel2016-05-101-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we split a block entry into a table entry, the UXN/PXN/XN permission attributes are inherited both by the new table entry and by the new block entries at the next level down. Unlike the NS bit, which only affects the next level of lookup, the XN table bits supersede the permissions of the final translation, and setting the permissions at multiple levels is not only redundant, it also prevents us from lifting XN restrictions on a subregion of the original block entry by simply clearing the appropriate bits at the lowest level. So drop the code that sets the UXN/PXN/XN bits on the table entries. Reported-by: "Oliyil Kunnil, Vishal" <vishalo@qti.qualcomm.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
| * ArmPkg/ArmDmaLib: assert that consistent mappings are uncachedArd Biesheuvel2016-05-101-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DmaMap () only allows uncached mappings to be used for creating consistent mappings with operation type MapOperationBusMasterCommonBuffer. However, if the buffer passed to DmaMap () happens to be aligned to the CWG, there is no need for a bounce buffer, and we perform the cache maintenance directly without ever checking if the memory attributes of the buffer adhere to the API. So add some debug code that asserts that the operation type and the memory attributes are consistent. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
| * ArmPkg/ArmDmaLib: do not remap arbitrary memory regions as uncachedArd Biesheuvel2016-05-101-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the DmaMap () operation, if the region to be mapped happens to be aligned to the Cache Writeback Granule (CWG) (whose value is typically 64 or 128 bytes and 2 KB maximum), we remap the memory as uncached. Since remapping memory occurs at page granularity, while the buffer and the CWG may be much smaller, there is no telling what other memory we affect by doing this, especially since the operation is not reverted in DmaUnmap(). So remove the remapping call. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
| * ArmPkg/ArmDmaLib: reject consistent DMA mappings of cached memoryArd Biesheuvel2016-05-101-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DmaMap () operations of type MapOperationBusMasterCommonBuffer should return a mapping that is coherent between the CPU and the device. For this reason, the API only allows DmaMap () to be called with this operation type if the memory to be mapped was allocated by DmaAllocateBuffer (), which in this implementation guarantees the coherency by using uncached mappings on the CPU side. This means that, if we encounter a cached mapping in DmaMap () with this operation type, the code is either broken, or someone is violating the API, but simply proceeding with a double buffer makes no sense at all, and can only cause problems. So instead, actively reject this operation type for cached memory mappings. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
| * ArmPkg/ArmDmaLib: interpret GCD attributes as a bit fieldArd Biesheuvel2016-05-101-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | Comparing a GCD attribute field directly against EFI_MEMORY_UC and EFI_MEMORY_WT is incorrect, since it may have other bits set as well which are not related to the cacheability of the region. So instead, test explicitly against the flags EFI_MEMORY_WB and EFI_MEMORY_WT, which must be set if the region may be mapped with cacheable attributes. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
| * ArmPkg/ArmDmaLib: consistently use 'gCacheAlignment - 1' as alignment maskArd Biesheuvel2016-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | We manage to use both an AND operation with 'gCacheAlignment - 1' and a modulo operation with 'gCacheAlignment' in the same compound if statement. Since gCacheAlignment is a global of which the compiler cannot guarantee that it is a power of two, simply use the AND version in both cases. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
| * ArmPkg/ArmDmaLib: deal with NULL return value of UncachedAllocatePages ()Ard Biesheuvel2016-05-101-2/+10
| | | | | | | | | | | | | | | | | | | | | | The allocation function UncachedAllocatePages () may return NULL, in which case our implementation of DmaAllocateBuffer () should return EFI_OUT_OF_RESOURCES rather than silently ignoring the NULL value and returning EFI_SUCCESS. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
| * MdeModulePkg/PciSioSerialDxe: Do not flush the UARTRuiyu Ni2016-05-101-26/+1
| | | | | | | | | | | | | | | | | | | | The patch aligns to the IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe driver not flush the UART in Reset() and SetAttributes() function. It was found the flush causes hang on certain PCI serial devices. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Eric Jin <eric.jin@intel.com>
* | SecurityPkg: SecureBootConfigDxe: Add NULL pointer checkZhang, Chao B2016-05-111-1/+1
|/ | | | | | | | | Add SecureBoot NULL pointer check before reference it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
* MdeModulePkg RamDiskDxe: Fix wrong HII behavior for more than 8 RAM disksHao Wu2016-05-105-29/+37
| | | | | | | | | | | | | | | | | | | | | | The RamDiskDxe driver originally uses a variable-length HII varstore to retrieve the HII checkbox status of each registered RAM disk. However, HII does not support the variable-length varstore feature. Therefore, only the checkbox status for the first 8 RAM disks are tracked for the following definition of HII varstore structure considering the alignment: typedef struct { UINT64 Size; UINT8 RamDiskList[0]; } RAM_DISK_CONFIGURATION; This commit uses the private data of each registered RAM disks to track the HII checkbox status instead to resolve the issue. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* OvmfPkg: Modify FDF/DSC files for RamDiskDxe's adding NFIT report featureHao Wu2016-05-106-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | The RamDiskDxe driver in MdeModulePkg now will use EFI_ACPI_TABLE_PROTOCOL and EFI_ACPI_SDT_PROTOCOL during reporting RAM disks to NVDIMM Firmware Interface Table (NFIT). A Pcd 'PcdInstallAcpiSdtProtocol' controls whether the EFI_ACPI_SDT_PROTOCOL will be produced. Its default value is set to FALSE in MdeModulePkg. To make the NFIT reporting feature working properly under OVMF, the patch will set the Pcd to TRUE in OVMF DSC files. Also, the RamDiskDxe driver will sometimes report a NVDIMM Root Device using ASL code which is put in a Secondary System Description Table (SSDT) according to the ACPI 6.1 spec. Locating the SSDT requires modifying the [Rule.Common.DXE_DRIVER] field in OVMF FDF files. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
* MdeModulePkg RamDiskDxe: Report ACPI NFIT for reserved memory RAM disksHao Wu2016-05-105-0/+658
| | | | | | | | | | | | | | | | | | | | The RamDiskDxe now will report RAM disks with reserved memory type to NFIT in the ACPI table. This commit will also make sure that an NVDIMM root device exists in the \SB scope before reporting any RAM disk to NFIT. To properly report the NVDIMM root device, one will need to append the following content in the [Rule.Common.DXE_DRIVER] field in platform FDF files: RAW ACPI Optional |.acpi RAW ASL Optional |.aml Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
* ArmPkg/DefaultExceptionHandlerLib: fix typoArd Biesheuvel2016-05-091-1/+1
| | | | | | | Replace : with ; which was changes accidentally. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* ArmPkg/DefaultExceptionHandlerLib: add stack dump to exception handling codeArd Biesheuvel2016-05-091-0/+21
| | | | | | | | | | | This adds a partial stack dump (256 bytes at either side of the stack pointer) to the CPU state dumping routine that is invoked when taking an unexpected exception. Since dereferencing the stack pointer may itself fault, ensure that we don't enter the dumping routine recursively. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
* ArmPkg/DefaultExceptionHandlerLib: use deadloop rather than ASSERTArd Biesheuvel2016-05-091-1/+3
| | | | | | | | | | | | | | | | The default exception handler, which is essentially the one that is invoked for unexpected exceptions, ends with an ASSERT (FALSE), to ensure that execution halts after dumping the CPU state. However, ASSERTs are compiled out in RELEASE builds, and since we simply return to wherever the ELR is pointing, we will not make any progress in case of synchronous aborts, and the same exception will be taken again immediately, resulting in the string 'Exception at 0x....' to be printed over and over again. So use an explicit deadloop instead. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
* MdeModulePkg/Sd: add Erase Block support on sd/emmc deviceFeng Tian2016-05-0910-6/+978
| | | | | | | | | It's done by producing EFI_ERASE_BLOCK_PROTOCOL protocol instance. Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg: FileExplorerLib: prevent freeing null pointerMichael Zimmermann2016-05-091-1/+3
| | | | | | | | when there's no volume label 'Info' can be NULL Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* SecurityPkg TcgStorageOpalLib: Check the capability before use.Dong, Eric2016-05-091-22/+28
| | | | | | | | | | For Pyrite SSC device, it may not supports Active Key, So add check logic before enable it. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* SecurityPkg: Cleanup unused structure definitionJiaxin Wu2016-05-091-37/+0
| | | | | | | | | | | | | | This patch is used to cleanup unused structure definition. Cc: Zhang Chao B <chao.b.zhang@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
* MdeModulePkg/SdMmcPciHcDxe: Check SD's supported bus mode before switchFeng Tian2016-05-063-41/+75
| | | | | | | | | Before switch to a bus mode, we need check if the SD device supports this bus mode. Cc: Wu, Hao A <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/SdMmcPciHcDxe: Error handling enhance on tuning procedureFeng Tian2016-05-064-21/+56
| | | | | | | | Enhance the code to reset tuning circuit when tuning error case happens. Cc: Wu, Hao A <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/SdMmcPciHcDxe: Using PIO rather than DMA for clock tuningFeng Tian2016-05-063-98/+164
| | | | | | | | | | | | | | | The original code is using ADMA mode to do clock tuning procedure. It may have problem on some SD/MMC host controllers as there is no way to know when to send next tuning cmd. Update it to PIO mode to strictly follow SD Host Controller Simplified Specification 3.0 Figure 2-29. By this way, if the Buffer Read Ready interrupt is set, we could know it's ok to send the next clock tuning cmd. Cc: Wu, Hao A <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/SdMmcPciHcDxe: Use BaseClk if the target clock is largerFeng Tian2016-05-063-3/+20
| | | | | | | | | | The original code has a bug to calculate which clock freq should be used when the target clock freq is larger than the BaseClock Freq provided by the system. Cc: Wu, Hao A <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/SdMmcPciHcDxe: break cmd exec if the card isn't identifiedFeng Tian2016-05-062-5/+29
| | | | | | | | | Check if the card is identified/initialized correctly. if not, break the following cmd execution through PassThru()/ResetDevice(). Cc: Wu, Hao A <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com>
* ArmVirtPkg: retire PlatformIntelBdsLibLaszlo Ersek2016-05-064-1743/+0
| | | | | | | | | | | | This library instance is no longer referenced. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
* ArmVirtPkg/ArmVirtQemu: use MdeModulePkg/BDSLaszlo Ersek2016-05-065-18/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on OvmfPkg commit 79c098b6d25d. Unlike in OVMF, no USE_OLD_BDS fallback is introduced; I think that ArmVirtPkg is less widely used by non-developers than OvmfPkg. ArmVirtXen is not modified, as it uses PlatformIntelBdsLib from ArmPlatformPkg. About this patch: - DxeServicesLib and SortLib are resolved generally (they have broad client module type lists). - ReportStatusCodeLib is resolved for UEFI_APPLICATION modules. - GenericBdsLib and PlatformBdsLib are replaced with UefiBootManagerLib and PlatformBootManagerLib, and resolved from under MdeModulePkg and ArmVirtPkg, respectively. - QemuBootOrderLib is pointed to the QemuNewBootOrderLib instance. - FileExplorerLib no longer depends on SECURE_BOOT_ENABLE, it is nedeed by BootMaintenanceManagerUiLib, which we link into UiApp. - PcdBootManagerMenuFile carries the FILE_GUID of "MdeModulePkg/Application/UiApp/UiApp.inf". The default PCD value from "MdeModulePkg/MdeModulePkg.dec" points to "MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf", which, according to the commit that introduced it (a382952f8255), only 'provides a very simple UI showing all the boot options recorded by "BootOrder" and user can select any of them to boot'. - Include the new core BDS driver, and include the boot manager application, with the usual main menu entries. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Fixes: https://github.com/tianocore/edk2/issues/83 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
* ArmVirtPkg/PlatformBootManagerLib: add EnableQuietBoot & DisableQuietBootLaszlo Ersek2016-05-063-0/+716
| | | | | | | | | | | | | | | | | | | | UefiBootManagerLib does not provide these functions, we have to implement them. (EnableQuietBoot() puts up the nice TianoCore logo.) OvmfPkg commits 817fb3ac2a78 and 8e8fd3037788 have extracted these functions already, - from "IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c" - to "OvmfPkg/Library/PlatformBootManagerLib/QuietBoot.c". Copy the latter file, with minimal changes. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
* ArmVirtPkg/PlatformBootManagerLib: rebase boot order manipulationLaszlo Ersek2016-05-061-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QemuBootOrderLib can only filter out and reorder boot options; it cannot create boot options. It relies on Platform BDS to auto-generate all possible boot options first (for example, for new virtual devices that have been configured since the last run of the virtual machine). Then it will decide, case-by-case, whether each of those auto-generated boot options should be preserved (and at what position), or removed. Thus far, the only implementation of SetBootOrderFromQemu(), used in connection with IntelFrameworkModulePkg BDS, has expected said complete boot option list as an input parameter: BdsEntry() [IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c] // create empty list InitializeListHead ( &BootOptionList ) PlatformBdsPolicyBehavior( [ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c] BootOptionList ) BdsLibConnectAll() BdsLibEnumerateAllBootOption( BootOptionList ) // at this point, BootOptionList starts with the preexistent boot // options, and ends with the auto-generated options SetBootOrderFromQemu( [OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c] BootOptionList ) // write out changed boot order to UEFI variables // The "BootOrder" variable may have changed. Refresh BootOptionList // from it, and return it to BdsEntry(). With MdeModulePkg BDS, a BootOptionList is not propagated from BdsEntry() to SetBootOrderFromQemu() and back. All processing is based directly on the underlying "BootOrder" and "Boot####" variables. In OvmfPkg, commit d27ec22d1189 introduced a new instance of QemuBootOrderLib, called QemuNewBootOrderLib. It is based on UefiBootManagerLib, and rather than taking a complete BootOptionList as a parameter, it expects that the "BootOrder" and "Boot####" variables are complete in the above sense. Rebase the boot order manipulation to UefiBootManagerLib and QemuNewBootOrderLib, while keeping the requirement satisfied, like this: BdsEntry() [MdeModulePkg/Universal/BdsDxe/BdsEntry.c] PlatformBootManagerAfterConsole() [ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c] EfiBootManagerConnectAll() EfiBootManagerRefreshAllBootOption() // at this point all auto-generated options exist at the end of // "BootOrder" SetBootOrderFromQemu() [OvmfPkg/Library/QemuNewBootOrderLib/QemuBootOrderLib.c] // read boot options from "BootOrder" and "Boot####", then // manipulate them This patch parallels OvmfPkg commit 04fe914ba53e. Once the USE_OLD_BDS fallback is removed from OvmfPkg, the parameter list of the SetBootOrderFromQemu() prototype can be updated to VOID. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
* ArmVirtPkg/PlatformBootManagerLib: use UefiBootManagerLib ConnectAll() APILaszlo Ersek2016-05-061-1/+1
| | | | | | | | | | | | This patch parallels OvmfPkg commit fed691a6f913. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
* ArmVirtPkg/PlatformBootManagerLib: remove empty PlatformBdsLib hooksLaszlo Ersek2016-05-061-50/+0
| | | | | | | | | | | | | | | | | Namely, - PlatformBdsBootSuccess, - PlatformBdsBootFail, - PlatformBdsLockNonUpdatableFlash. This patch parallels OvmfPkg commit 7f89929f7fb2. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
* ArmVirtPkg/PlatformBootManagerLib: register boot options and hot keysLaszlo Ersek2016-05-062-1/+116
| | | | | | | | | | | | | | | | | | | | Register the Enter key as the continue key (hot key to skip the boot timeout). Map the F2 and ESC keys to the UI. Register the memory-mapped Shell boot option. The patch parallels OvmfPkg commit 07dd96e82032. The PlatformRegisterFvBootOption() and PlatformRegisterOptionsAndKeys() functions are copied almost verbatim. The only changes are: internal linkage for these functions (i.e., STATIC), and mentioning the ESC key in the comments. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
* ArmVirtPkg/PlatformBootManagerLib: don't launch the Boot Manager MenuLaszlo Ersek2016-05-065-10/+10
| | | | | | | | | | | | | | | | | | | | MdeModulePkg/BDS doesn't launch the UI (Boot Manager Menu) from the platform side. The platform is expected to store the boot timeout only, in PcdPlatformBootTimeOut. This is usually done in PlatformBootManagerBeforeConsole(). (ArmVirtXen is not modified, as it uses PlatformIntelBdsLib from ArmPlatformPkg, not ArmVirtPkg.) The patch parallels OvmfPkg commit 8dc0f0a6aab0. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
* ArmVirtPkg/PlatformBootManagerLib: init console vars in BeforeConsole()Laszlo Ersek2016-05-061-41/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With IntelFrameworkModulePkg BDS, the platform code is responsible for updating console variables (e.g., with BdsLibUpdateConsoleVariable()), and then connecting them (e.g., with BdsLibConnectAllDefaultConsoles()). This is usually (although not necessarily) done in PlatformBdsPolicyBehavior(). With MdeModulePkg BDS, the platform is responsible for updating the console variables in PlatformBootManagerBeforeConsole(). When that function returns, BdsEntry() will automatically connect the consoles; the platform is not responsible for the connection. IntelFrameworkModulePkg MdeModulePkg BdsEntry BdsEntry PlatformBdsInit PlatformBootManagerBeforeConsole +----> EfiBootManagerUpdateConsoleVariable | dispatch Driver#### | dispatch Driver#### | +> connect consoles | | PlatformBdsPolicyBehavior | | PlatformBootManagerAfterConsole BdsLibUpdateConsoleVariable <--+ | BdsLibConnectAllDefaultConsoles <+ display splash screen display splash screen Thus, move the console variable massaging from the beginning of PlatformBootManagerAfterConsole() (originally PlatformBdsPolicyBehavior()) to the end of PlatformBootManagerBeforeConsole(), and drop the explicit BdsLibConnectAllDefaultConsoles() call. This patch parallels OvmfPkg commit e9e9ad644fab. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
* ArmVirtPkg/PlatformBootManagerLib: link against UefiBootManagerLibLaszlo Ersek2016-05-062-1/+2
| | | | | | | | | | | | | | | | The general BDS helper functions are now provided by MdeModulePkg's UefiBootManagerLib, and no longer by IntelFrameworkModulePkg's GenericBdsLib. This patch parallels OvmfPkg commit 2b23b8d45b62. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
* ArmVirtPkg/PlatformBootManagerLib: use EfiBootManagerUpdateConsoleVariableLaszlo Ersek2016-05-061-6/+6
| | | | | | | | | | | | | | | | | | | | In this rather mechanical patch, we replace the calls to GenericBdsLib's BdsLibUpdateConsoleVariable() with calls to UefiBootManagerLib's EfiBootManagerUpdateConsoleVariable(), which has the same purpose. The latter uses CONSOLE_TYPE enum constants from "MdeModulePkg/Include/Library/UefiBootManagerLib.h", for identifying the console type / underlying UEFI variable in the first parameter. This patch parallels OvmfPkg commit 9dc08ec6574b. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
* ArmVirtPkg/PlatformBootManagerLib: follow PlatformBootManagerLib interfacesLaszlo Ersek2016-05-062-21/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "IntelFrameworkModulePkg/Include/Library/PlatformBdsLib.h" declares the following interfaces: - PlatformBdsInit - PlatformBdsPolicyBehavior - PlatformBdsBootFail - PlatformBdsBootSuccess - PlatformBdsLockNonUpdatableFlash - LockKeyboards From these, we've been using PlatformBdsInit() and PlatformBdsPolicyBehavior(). "MdeModulePkg/Include/Library/PlatformBootManagerLib.h" declares the three interfaces below: - PlatformBootManagerBeforeConsole - PlatformBootManagerAfterConsole - PlatformBootManagerWaitCallback Comparing the BdsEntry() functions between - "IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c" and - "MdeModulePkg/Universal/BdsDxe/BdsEntry.c", we can establish the following mapping: IntelFrameworkModulePkg MdeModulePkg BdsEntry() BdsEntry() PlatformBdsInit() <--------------> PlatformBootManagerBeforeConsole() dispatch Driver#### <--------------> dispatch Driver#### connect consoles PlatformBdsPolicyBehavior() <------> PlatformBootManagerAfterConsole() The difference in connecting the consoles will be addressed in a later patch, now we just rename the functions according to the mapping above, and copy the call site comments from MdeModulePkg's BdsEntry(). For the third interface, PlatformBootManagerWaitCallback(), add an empty implementation (and copy the comment from the library class header). Platform BDS can use this callback to draw a progress bar, for example. This patch parallels OvmfPkg commit a7566234e92c. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
* ArmVirtPkg: duplicate PlatformIntelBdsLib to PlatformBootManagerLibLaszlo Ersek2016-05-064-0/+1744
| | | | | | | | | | | | | | | | | | | | | | | Create a copy of PlatformIntelBdsLib under the name PlatformBootManagerLib, with the following initial changes: - replace PlatformBdsLib references with PlatformBootManagerLib in comments, - replace "IntelBdsPlatform" with "PlatformBm" in file names and their references, - generate a new FILE_GUID. PlatformBootManagerLib will be linked into the BDS driver from MdeModulePkg. This patch parallels OvmfPkg commit 305418818959. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
* ShellBinPkg: Ia32/X64 Shell binary update.Qiu Shumin2016-05-065-2/+2
| | | | | | | | The binaries of ShellBinPkg are generated with ShellPkg project d454c18a315f109c52b78e8049a7231eb01f003c. The binaries are built with no debug information by building with "RELEASE" target. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
* ShellPkg: Remove debug message in release binaries.Qiu Shumin2016-05-061-0/+4
| | | | | | | | | Use BaseDebugLibNull instance instead of UefiDebugLibConOut to remove the debug message in release Shell binaries. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* NetworkPkg: Ignore BootFileName if it is overloaded.Fu Siyuan2016-05-061-2/+5
| | | | | | | | | | Make sure "File" field is not overloaded to carry other DHCP options before use it in PXE driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* NetworkPkg: Ignore BootFileName if it is overloaded.Fu Siyuan2016-05-061-1/+4
| | | | | | | | | | Make sure "File" field is not overloaded to carry other DHCP options before use it in HTTP boot driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* MdeModulePkg: Ignore BootFileName if it is overloaded.Heyi Guo2016-05-061-3/+7
| | | | | | | | | Make sure "BootFileName" is not overloaded before use it in PXE driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: chenzhihui <chenzhihui4@huawei.com> Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
* NetworkPkg: Fix a memory leak in HTTP boot driver.Fu Siyuan2016-05-061-3/+1
| | | | | | | | | | | We always need to call EfiBootManagerFreeLoadOption because the memory allocated for NewOption (description and device path) is no longer needed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
* MdeModulePkg/FileExplore: Make LibraryClass & Depex module type consistentDandan Bi2016-05-061-1/+1
| | | | | | | | Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/HiiDatabaseDxe: Fix memory leak issues in HiiDatabaseDxeDandan Bi2016-05-061-1/+20
| | | | | | | | | Cc: Qiu Shumin <shumin.qiu@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
* MdeModulePkg/SetupBrowser: Call submit callback function when no failureDandan Bi2016-05-061-2/+13
| | | | | | | | | | | | | In current code will always call submit callback function, but we should call submit callback function when has no failure in the submit action. This patch to fix this issues. Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg: Restore question base on the fail info when submit failDandan Bi2016-05-062-7/+151
| | | | | | | | | | | | | | When RouteConfig function fail in SubmitForForm or SubmitForFormSet function, we should restore the question value base on the failure information, should not restore all the question. This patch to fix this issue. Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Support \x####\ in UNI files to specify non-ascii charactersYonghong Zhu2016-05-061-4/+14
| | | | | | | | | | UNI spec updated to allow using \x####\ to specify non-ascii characters, # is a hex digit. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* NetworkPkg/HttpBootDxe: Fix for the issue that the HTTP boot option can't be ↵Sunny Wang2016-05-062-2/+5
| | | | | | | | | | | | | | | | | booted more than once This issue can be reproduced by the following steps: 1. Boot to HTTP boot option and the boot file is a ISO file like Ubuntu PE image. 2. Exit from boot option (GRUB) and then back to boot manager menu. 3. Boot to the same HTTP boot option again or a HTTP boot option pointing to the same HTTP ISO file. It will fail to boot. Root cause: When booting a HTTP boot option, the HTTP boot driver will save the Boot File's information in its private data as cache data for skipping the Boot file discovery from next time boot. However, the cache data doesn't include ImageType data, which would cause HTTP boot driver using the invalid ImageType (ImageTypeMax) and then fail to boot the cached boot file. In other words, for the second time boot, the HttpBootLoadFile() doesn't update ImageType (it returns a valid ImageType), which causes that the HttpBootDxeLoadFile() skips to Register a RAM Disk for downloaded HTTP ISO file and then BDS code can't find the RAM disk to boot. Solution: Save ImageType to private data for next time HTTP boot. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Sunny Wang <sunnywang@hpe.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>