summaryrefslogtreecommitdiff
path: root/OvmfPkg
AgeCommit message (Collapse)AuthorFilesLines
2013-11-22Updated OvmfPkg to use suitable CPU Exception Handler Library instances.Jeff Fan3-3/+9
Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14887 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-20OvmfPkg/QemuVideoDxe: don't leak descriptors returned by GetBarAttributesLaszlo Ersek2-0/+5
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14877 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-12OvmfPkg/BdsPlatform: don't restore NvVars from disk when flash is presentLaszlo Ersek2-5/+11
QemuFlashFvbServicesRuntimeDxe provides actual persistent storage for non-volatile variables. When it is active, any on-disk NvVars file counts as a stale source of variables -- hence don't load these files in BDS. This also allows Secure Boot settings (eg. enrolled keys) to survive cold VM reboots. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14844 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-12OvmfPkg: indicate enablement of flash variables with a dedicated PCDLaszlo Ersek3-0/+3
PcdFlashNvStorageVariableBase64 is used to arbitrate between QemuFlashFvbServicesRuntimeDxe and EmuVariableFvbRuntimeDxe, but even the latter driver sets it if we fall back to it. Allow code running later than the startup of these drivers to know about the availability of flash variables, through a dedicated PCD. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14843 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-12OvmfPkg/build.sh: Enable flash for QEMU >= 1.6Jordan Justen1-8/+17
If the QEMU version is found to be >= 1.6, then automatically enable flash (using the QEMU pflash command line parameter). QEMU supports flash since 1.2, but only if KVM is disabled. As of QEMU 1.6, flash support should also be enabled when KVM is used. Therefore it is safest to only enable flash for QEMU 1.6 and newer. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14842 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-12OvmfPkg/build.sh: Support --enable-flash switchJordan Justen1-4/+11
If this argument is used, then when QEMU is run, the -pflash parameter will be used with QEMU to enable QEMU's flash mode. It should be used before the 'qemu' argument, since it is not a QEMU parameter, but instead it updates how build.sh runs QEMU. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14841 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-12OvmfPkg: Add QemuFlashFvbServicesRuntimeDxe to firmware imageJordan Justen6-0/+9
This driver will support a flash FVB implementation if QEMU flash is detected. The driver is added to the apriori list to make sure it runs before the EmuVariableFvbRuntimeDxe driver. If this driver detects flash support, then it will disable the EmuVariableFvbRuntimeDxe driver by setting PcdFlashNvStorageVariableBase64. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14840 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-12OvmfPkg: Add QemuFlashFvbServicesRuntimeDxe driverJordan Justen6-0/+1984
If QEMU flash is detected, this module will install FirmwareVolumeBlock support for the QEMU flash device. It will also set PCDs with the results that: 1. OvmfPkg/EmuVariableFvbRuntimeDxe will be disabled 2. MdeModulePkg variable services will read/write flash directly Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14839 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-12OvmfPkg/EmuVariableFvbRuntimeDxe: Disable if flash variables are supportedJordan Justen1-0/+6
If QEMU flash is supported, then the PcdFlashNvStorageVariableBase64 will be set by the flash FVB driver. If it is set to a non-zero value, then we disable memory based variables. In future patches we will add the flash FVB driver and force it to run before this driver. Therefore, if QEMU flash writing is supported, then this driver will be disabled. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14838 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-12OvmfPkg/AcpiPlatformDxe/Qemu: Decrease upper limit for PCI window 32Jordan Justen2-1/+2
In a later patch we will want to mark the flash memory as a runtime services data memory range. This will allow a new runtime services firmware block driver to read & write flash memory when the OS has set up virtual memory protection. Since this memory range will appear as runtime services data, we need to adjust the limit when scanning for PCI window 32 down to just below the flash device. If we don't adjust the limit, then the algorithm in PopulateFwData will fail because it will see a EfiGcdMemoryTypeSystemMemory memory range just below 4GB. v2: * This patch replaces the v1 patch: "OvmfPkg/AcpiPlatformDxe/Qemu: Allow high runtime memory regions" Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14837 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-12OvmfPkg/README: Add information about OVMF flash layoutJordan Justen1-0/+37
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14836 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-12OvmfPkg: Add NV Variable storage within FDJordan Justen6-48/+249
This is to prepare for QEMU flash support which will allow non-volatile variables to be saved in the flash image. Note two size changes: * NV Varstore size increased from 0xc000 to 0xe000 * FTW work size decreased from 0x2000 to 0x1000 The reason for this change is that the fault-tolerant write support requires that the work area fit within the block just before the fault-tolerant write spare storage blocks. Since QEMU flash blocks have a size of 0x1000, this means that the maximum FTW work size is 0x1000. v2: * Update commit message and PcdVariableStoreSize Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14835 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-12OvmfPkg: Add flash PCD itemsJordan Justen1-1/+11
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14834 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-12OvmfPkg: Increase DEBUG build size to 2MB by defaultJordan Justen3-0/+42
The 1MB image with full debug and the shell included is too large to implement flash based non-volatile variable. After this change, building with -D FD_SIZE_1MB will force the smaller flash size. The default size for RELEASE build remains at 1MB, so using -b RELEASE on the build command line will result in a 1MB flash size. For RELEASE builds -D FD_SIZE_2MB can be used to produce a 2MB flash image. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14833 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-06OvmfPkg/build.sh: Use QEMU_COMMAND environment variableJordan Justen1-2/+12
If the user has set the QEMU_COMMAND environment variable, then use it when running QEMU. This can be useful for running OVMF with development builds of QEMU. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14825 6f19259b-4bc3-4df7-8a09-765794883524
2013-10-29OvmfPkg/Virtio.h: Added the Virtio Vendor and MMIO IDsOlivier Martin1-0/+7
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14809 6f19259b-4bc3-4df7-8a09-765794883524
2013-10-29OvmfPkg/Virtio.h: Added PCI/MMIO Virtio Headers OffsetsOlivier Martin1-0/+35
Offsets are different between the PCI and MMIO transport layer. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14808 6f19259b-4bc3-4df7-8a09-765794883524
2013-10-29OvmfPkg/Virtio.h: Added the macros that define the Device Specific ↵Olivier Martin1-0/+7
Configuration Offset The Device Specific Configuration region is located at different locations for the VirtIo devices over PCI, PCI with MSI-X capability, MMIO. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14807 6f19259b-4bc3-4df7-8a09-765794883524
2013-10-29OvmfPkg/PlatformPei: emulated NV storage must be EfiRuntimeServicesDataLaszlo Ersek1-1/+1
SVN r14770 ("OvmfPkg/PlatformPei: correctly align emulated NV storage") made sure the emulated NV storage was allocated with correct alignment. However, the AllocateRuntimePool() -> AllocateAlignedPages() change flipped the memory type from EfiRuntimeServicesData to EfiBootServicesData. This causes variable services to access freed storage at runtime. It crashes Windows 2008 R2 early at boot, for example. Keep the alignment, but restore the memory type to EfiRuntimeServicesData, by calling AllocateAlignedRuntimePages(). These helper functions are implemeted and documented in "MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c". Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14806 6f19259b-4bc3-4df7-8a09-765794883524
2013-10-14OvmfPkg/PlatformPei: correctly align emulated NV storageWei Liu1-2/+3
Per 2c4b18e ("MdeModulePkg: Add the alignment check for FTW spare area address and length, and add the check for PcdFlashNvStorageVariableSize <= PcdFlashNvStorageFtwSpareSize."), FTWDxe refuses to initialize if spare space base address or size is not aligned to block size. Depending on configuration, memory for FTWDxe might be dynamically allocated in PlatformPei. This patch makes sure that the allocated memory region is aligned. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wei Liu <wei.liu2@citrix.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14770 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-30OvmfPkg: Removed magic values for the Virtio Sub-System ID in the PCI device ↵Olivier Martin3-3/+3
drivers Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14742 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-30OvmfPkg/Virtio.h: Added VirtIo Subsystem IDsOlivier Martin1-0/+13
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14741 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-30OvmfPkg/IndustryStandard: Fixed 'VirtioNet.h' line endingsOlivier Martin1-99/+99
EDK2 files must use CRLF line ending. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14740 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-24OvmfPkg: EFI handover flags are in Bp->hdr.xloadflagsMatt Fleming1-1/+1
LoadLinux() is looking at the wrong field for the kernel's EFI handover protocol flags. It's not currently possible for JumpToUefiKernel() to ever be called (even accidentally) because BIT2 and BIT3 of Bp->hdr.load_flags are never set in modern kernels, which means that control is always transferred to the kernel via the legacy entry point. Look at the correct field so that the EFI handover protocol is used whenever it's available. Contributed-under: TianoCore Contribution Agreement 1.0 Cc: David Woodhouse <David.Woodhouse@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Matt Fleming <matt.fleming@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14721 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-24OvmfPkg: Remove IndustryStandard/X64Paging.hJordan Justen1-99/+0
Since we no longer building page tables in SEC C code, we no longer need this file. This reverts commit r14493. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14720 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-24OvmfPkg/Sec: Stop building identity mapped pages in SECJordan Justen1-142/+2
Now for X64 we use a VTF0 ResetVector which puts the page tables in RAM. Therefore SEC no longer needs to do this. This reverts commit r14494. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14719 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-24OvmfPkg X64: Convert 24KB from uncompressed to compressed storageJordan Justen1-2/+2
Since we no longer require flash tables to be stored uncompressed in the flash image, we can now give extra space to the main/compressed storage area. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14718 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-24OvmfPkg: For OvmfPkgX64, use OvmfPkg/ResetVectorJordan Justen1-1/+1
This reset vector code will build page tables in RAM at address 0x80000, rather than relying on page tables to be present within the flash image. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14717 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-24OvmfPkg/ResetVector: enable caching in initial page tablesLaszlo Ersek2-3/+1
In UEFI X64 we use other mechanisms to disable caching. (CD/NW in CR0 and MTRRs.) This fixes a slow boot issue with SVM. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14716 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-24OvmfPkg: Add platform specific reset vector code for X64Jordan Justen6-0/+259
KVM has a bug that prevents using page tables in the ROM if the ROM region utilizes the KVM READONLY memory feature. Therefore, we avoid using page tables stored in the ROM. Since OVMF doesn't require memory initialization, we just build page table entries in RAM at 0x80000 very early in the OVMF boot process. This address is just after the 'temp RAM' which is set up by the SEC module. Currently we only set up 4GB of page tables for OVMF's PEI, but DxeIpl will build identity mapped page tables that cover all of the available processor physical address space. Reported-by: Gary Ching-Pang Lin <glin@suse.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14715 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-21OvmfPkg: resolve TpmMeasurementLib dependency introduced in r14687Laszlo Ersek3-0/+3
(1) OVMF depends on MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf unconditionally. (2) When OVMF is built with -D SECURE_BOOT_ENABLE, then SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.inf is injected into SecurityStubDxe above. (3) SVN r14687 ("Add TPM2 implementation.") has made DxeImageVerificationLib dependent on TpmMeasurementLib. Currently the last link of the OVMF -> SecurityStubDxe -> DxeImageVerificationLib -> TpmMeasurementLib dependency chain is unresolved: build.py... /.../OvmfPkg/OvmfPkgX64.dsc(...): error 4000: Instance of library class [TpmMeasurementLib] is not found in [/.../SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.inf] [X64] consumed by module [/.../MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf] Let's provide a library instance for TpmMeasurementLib the same way as "SecurityPkg/SecurityPkg.dsc" does (SVN r13964.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14690 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-13OvmfPkg: QemuBootOrder: keep some boot options that have not been selectedLaszlo Ersek1-0/+108
Some of the active boot options that have not been selected over fw_cfg should be preserved at the end of the boot order. For now we're adding back everything that starts with neither PciRoot() nor HD(). This includes the UEFI shell, memory-mapped from the firmware image. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Chang <mchang@suse.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14668 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-13OvmfPkg: QemuBootOrder: mark UEFI boot options selected by fw_cfgLaszlo Ersek1-8/+12
This will allow us to identify those UEFI boot options (while keeping their relative order) that have *not* been selected by fw_cfg. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Chang <mchang@suse.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14667 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-13OvmfPkg: QemuBootOrder: collect active UEFI boot options in advanceLaszlo Ersek1-18/+100
In preparation for the next patch, collect active UEFI boot options in advance into a new array. Rebase the current inner loop (the matching loop) to this array. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Chang <mchang@suse.com> [jordan.l.justen@intel.com: initialize *ActiveOption for GCC IA32 warning] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14666 6f19259b-4bc3-4df7-8a09-765794883524
2013-09-13OvmfPkg: QemuBootOrder: expand relative device paths in UEFI boot optionsLaszlo Ersek1-0/+29
The prefix matching logic in Match() [OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c] expects UEFI boot options to specify full (absolute) device paths. However, partial (relative) device paths starting with a HD() node are valid for booting. By not recognizing them, QemuBootOrder.c misses (and deletes) valid boot options that would otherwise match the user's preference. Just like BdsLibBootViaBootOption() expands such paths with the BdsExpandPartitionPartialDevicePathToFull() function for booting, do the same in QemuBootOrder.c for prefix matching. This moves the very first call to BdsExpandPartitionPartialDevicePathToFull() to an earlier point. The following call tree explains it: BdsEntry() [IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c] PlatformBdsPolicyBehavior() [OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c] SetBootOrderFromQemu() [OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c] Match() [OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c] BdsExpandPartitionPartialDevicePathToFull() [IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c] BdsBootDeviceSelect() [IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c] BdsLibBootViaBootOption() [IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c] BdsExpandPartitionPartialDevicePathToFull() [IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c] This should be fine, for two reasons: - the new, earlier call is still under BdsEntry(), - BdsExpandPartitionPartialDevicePathToFull() expects to be called repeatedly, even with the same set of HD() device paths. This function implements its own caching for device paths, likely for performance reasons. That fits this patch well because whatever device paths we expand under PlatformBdsPolicyBehavior() can be quickly looked up in BdsBootDeviceSelect(), so no work (ie. BdsLibConnectAllDriversToAllControllers()) should be wasted. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Chang <mchang@suse.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14665 6f19259b-4bc3-4df7-8a09-765794883524
2013-08-30OvmfPkg NvVarsFileLib: Set NvVars variable after writing vars fileJordan Justen1-12/+42
The volatile 'NvVars' variable indicates that the variables do not need to be loaded from the file again. After we write the variables out to the file, there is clearly no need to load them back from the file. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Chang <mchang@suse.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14613 6f19259b-4bc3-4df7-8a09-765794883524
2013-08-281. Change default PCD in SecurityPkg to 4 (DENY_EXECUTE) in DEC file.Fu Siyuan3-9/+9
2. ASSERT if PCD value is set to 5 (QUERY_USER_ON_SECURITY_VIOLATION). 3. Update override PCD setting from 5 to 4 in platform DSC file. Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ni Ruiyu <ruiyu.ni@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14607 6f19259b-4bc3-4df7-8a09-765794883524
2013-08-23OvmfPkg: Virtio: load used ring element strictly after loading used indexLaszlo Ersek4-0/+4
Enforce in-order execution of these steps even on not sequentially consistent architectures, as discussed in [1]. These changes should be unnecessary on x86 (the only architecture OVMF currently supports), but they align the OVMF virtio code with the virtio specification and could be necessary for future OVMF ports. [1] http://lists.linuxfoundation.org/pipermail/virtualization/2013-June/024547.html Suggested-by: Stefan Hajnoczi <stefanha@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14601 6f19259b-4bc3-4df7-8a09-765794883524
2013-08-23OvmfPkg: Build and use the UEFI shell by defaultJordan Justen6-33/+9
Previously OVMF included the older EFI shell binary when building. Now we will build and use the UEFI shell (ShellPkg) instead. v2: * Don't bother building UEFI shell when USE_OLD_SHELL is defined * Fix errors in OvmfPkgIa32X64.fdf Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14600 6f19259b-4bc3-4df7-8a09-765794883524
2013-08-19OvmfPkg: Use the new DevicePathLib for all platformsRuiyu Ni4-8/+20
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <Ruiyu.ni@Intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14558 6f19259b-4bc3-4df7-8a09-765794883524
2013-08-19OvmfPkg ResetSystemLib: Fix VS build errorRuiyu Ni1-1/+1
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <Ruiyu.ni@Intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14557 6f19259b-4bc3-4df7-8a09-765794883524
2013-08-18OvmfPkg/SecureBootConfigDxe: Avoid illegal accessGary Ching-Pang Lin1-3/+18
When enrolling the certificate from a file, the suffix check function check the last 4 characters to filter out non-DER files. However, if the length of the file name is less than 4, the address prior to the file name will be accessed while it shouldn't. This commit checks the length of the file name to avoid illegal access. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Ching-Pang Lin <glin@suse.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14556 6f19259b-4bc3-4df7-8a09-765794883524
2013-08-18OvmfPkg: allocate the EFI memory map for Linux as Loader DataLaszlo Ersek1-2/+6
In Linux, efi_memblock_x86_reserve_range() and efi_reserve_boot_services() expect that whoever allocates the EFI memmap allocates it in Loader Data type memory. Linux's own exit_boot()-->low_alloc() complies, but SetupLinuxMemmap() in LoadLinuxLib doesn't. The memory type discrepancy leads to efi_memblock_x86_reserve_range() and efi_reserve_boot_services() both trying to reserve the range backing the memmap, resulting in memmap entry truncation in efi_reserve_boot_services(). This fix also makes this allocation consistent with all other persistent allocations in "OvmfPkg/Library/LoadLinuxLib/Linux.c". Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reported-and-tested-by: Borislav Petkov <bp@suse.de> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14555 6f19259b-4bc3-4df7-8a09-765794883524
2013-08-12Update OVMF platform to use new display engine and browser.Eric Dong6-0/+9
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14541 6f19259b-4bc3-4df7-8a09-765794883524
2013-08-12Rollback patch 14537 & 14538, because patch 14537 is not tested by Laszlo ↵Eric Dong6-9/+0
Ersek, but i wrote it. Signed-off-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14539 6f19259b-4bc3-4df7-8a09-765794883524
2013-08-09Update Browser to provide the customization possibilities.Eric Dong6-0/+9
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> MdeModulePkg Patch Tested-by: Laszlo Ersek <lersek@redhat.com> OvmfPkg Patch Tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14537 6f19259b-4bc3-4df7-8a09-765794883524
2013-07-26Update all the code to consume the ConvertDevicePathToText, ↵Ruiyu Ni7-1575/+58
ConvertDevicePathNodeToText, ConvertTextToDevicePath and ConvertTextToDeviceNode APIs in DevicePathLib. Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Elvin Li <elvin.li@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14505 6f19259b-4bc3-4df7-8a09-765794883524
2013-07-18OvmfPkg/Sec: Build identity mapped pages in RAM for X64Jordan Justen1-2/+142
This is based on MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c. Previously we would run using page tables built into the firmware device. If a flash memory is available, it is unsafe for the page tables to be stored in memory since the processor may try to write to the page table data structures. Additionally, when KVM ROM support is enabled for the firmware device, then PEI fails to boot when the page tables are in the firmware device. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14494 6f19259b-4bc3-4df7-8a09-765794883524
2013-07-18OvmfPkg: Add IndustryStandard/X64Paging.hJordan Justen1-0/+99
Taken from MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.h. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14493 6f19259b-4bc3-4df7-8a09-765794883524
2013-07-18OvmfPkg ResetSystemLib: Fix shutdown via UEFI runtime servicesJordan Justen2-4/+9
When the PM base address was moved from 0x400 to 0xb000, this code was missed. This prevented shutdown's via the UEFI system call from working. (For example, at the EFI shell prompt: reset -s) We now use gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress which is currently set at 0xb000. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14492 6f19259b-4bc3-4df7-8a09-765794883524