2010-02-24 00:58:38 +01:00
|
|
|
## @file
|
2009-05-27 23:10:18 +02:00
|
|
|
# Open Virtual Machine Firmware: FDF
|
|
|
|
#
|
2016-04-07 12:19:27 +02:00
|
|
|
# Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
OvmfPkg: use StatusCode Router and Handler from MdeModulePkg
In the Platform Init v1.4a spec,
- Volume 1 "4.7 Status Code Service" defines the
EFI_PEI_SERVICES.ReportStatusCode() service,
- Volume 1 "6.3.5 Status Code PPI (Optional)" defines the
EFI_PEI_PROGRESS_CODE_PPI (equivalent to the above),
- Volume 2 "14.2 Status Code Runtime Protocol" defines the
EFI_STATUS_CODE_PROTOCOL.
These allow PEIMs and DXE (and later) modules to report status codes.
Currently OvmfPkg uses modules from under
"IntelFrameworkModulePkg/Universal/StatusCode/", which produce the above
abstractions (PPI and PROTOCOL) directly, and write the status codes, as
they are reported, to the serial port or to a memory buffer. This is
called "handling" the status codes.
In the Platform Init v1.4a spec,
- Volume 3 "7.2.2 Report Status Code Handler PPI" defines
EFI_PEI_RSC_HANDLER_PPI,
- Volume 3 "7.2.1 Report Status Code Handler Protocol" defines
EFI_RSC_HANDLER_PROTOCOL.
These allow several PEIMs and runtime DXE drivers to register callbacks
for status code handling.
MdeModulePkg offers a PEIM under
"MdeModulePkg/Universal/ReportStatusCodeRouter/Pei" that produces both
EFI_PEI_PROGRESS_CODE_PPI and EFI_PEI_RSC_HANDLER_PPI, and a runtime DXE
driver under "MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe"
that produces both EFI_STATUS_CODE_PROTOCOL and EFI_RSC_HANDLER_PROTOCOL.
MdeModulePkg also offers status code handler modules under
MdeModulePkg/Universal/StatusCodeHandler/ that depend on
EFI_PEI_RSC_HANDLER_PPI and EFI_RSC_HANDLER_PROTOCOL, respectively.
The StatusCodeHandler modules register themselves with
ReportStatusCodeRouter through EFI_PEI_RSC_HANDLER_PPI /
EFI_RSC_HANDLER_PROTOCOL. When another module reports a status code
through EFI_PEI_PROGRESS_CODE_PPI / EFI_STATUS_CODE_PROTOCOL, it reaches
the phase-matching ReportStatusCodeRouter module first, which in turn
passes the status code to the pre-registered, phase-matching
StatusCodeHandler module.
The status code handling in the StatusCodeHandler modules is identical to
the one currently provided by the IntelFrameworkModulePkg modules. Replace
the IntelFrameworkModulePkg modules with the MdeModulePkg ones, so we can
decrease our dependency on IntelFrameworkModulePkg.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Suggested-by: Liming Gao <liming.gao@intel.com>
Fixes: https://tianocore.acgmultimedia.com/show_bug.cgi?id=63
[jordan.l.justen@intel.com: point out IntelFareworkModulePkg typos]
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
[lersek@redhat.com: rewrap to 74 cols; fix IntelFareworkModulePkg typos]
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
2016-08-02 19:25:10 +02:00
|
|
|
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
|
2009-05-27 23:10:18 +02:00
|
|
|
#
|
2010-04-28 14:43:04 +02:00
|
|
|
# This program and the accompanying materials
|
2009-05-27 23:10:18 +02:00
|
|
|
# are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
# which accompanies this distribution. The full text of the license may be found at
|
|
|
|
# http://opensource.org/licenses/bsd-license.php
|
|
|
|
#
|
|
|
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
#
|
2010-02-24 00:58:38 +01:00
|
|
|
##
|
2009-05-27 23:10:18 +02:00
|
|
|
|
|
|
|
################################################################################
|
2013-11-12 19:34:02 +01:00
|
|
|
|
|
|
|
[Defines]
|
2014-07-22 23:57:01 +02:00
|
|
|
!include OvmfPkg.fdf.inc
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build the variable store and the firmware code as one unified flash device
|
|
|
|
# image.
|
|
|
|
#
|
2013-11-12 19:34:20 +01:00
|
|
|
[FD.OVMF]
|
2014-07-22 23:57:01 +02:00
|
|
|
BaseAddress = $(FW_BASE_ADDRESS)
|
|
|
|
Size = $(FW_SIZE)
|
2013-11-12 19:34:20 +01:00
|
|
|
ErasePolarity = 1
|
2014-07-22 23:57:01 +02:00
|
|
|
BlockSize = $(BLOCK_SIZE)
|
|
|
|
NumBlocks = $(FW_BLOCKS)
|
2013-11-12 19:34:20 +01:00
|
|
|
|
2014-07-22 23:56:53 +02:00
|
|
|
!include VarStore.fdf.inc
|
2013-11-12 19:34:20 +01:00
|
|
|
|
2014-07-22 23:57:01 +02:00
|
|
|
$(VARS_SIZE)|$(FVMAIN_SIZE)
|
2010-06-26 00:23:22 +02:00
|
|
|
FV = FVMAIN_COMPACT
|
|
|
|
|
2014-07-22 23:57:01 +02:00
|
|
|
$(SECFV_OFFSET)|$(SECFV_SIZE)
|
2010-01-04 17:17:59 +01:00
|
|
|
FV = SECFV
|
2012-10-04 17:41:15 +02:00
|
|
|
|
2014-07-22 23:57:01 +02:00
|
|
|
#
|
|
|
|
# Build the variable store and the firmware code as separate flash device
|
|
|
|
# images.
|
|
|
|
#
|
|
|
|
[FD.OVMF_VARS]
|
|
|
|
BaseAddress = $(FW_BASE_ADDRESS)
|
|
|
|
Size = $(VARS_SIZE)
|
|
|
|
ErasePolarity = 1
|
|
|
|
BlockSize = $(BLOCK_SIZE)
|
|
|
|
NumBlocks = $(VARS_BLOCKS)
|
|
|
|
|
|
|
|
!include VarStore.fdf.inc
|
|
|
|
|
|
|
|
[FD.OVMF_CODE]
|
|
|
|
BaseAddress = $(CODE_BASE_ADDRESS)
|
|
|
|
Size = $(CODE_SIZE)
|
|
|
|
ErasePolarity = 1
|
|
|
|
BlockSize = $(BLOCK_SIZE)
|
|
|
|
NumBlocks = $(CODE_BLOCKS)
|
|
|
|
|
|
|
|
0x00000000|$(FVMAIN_SIZE)
|
2012-10-04 17:41:15 +02:00
|
|
|
FV = FVMAIN_COMPACT
|
|
|
|
|
2014-07-22 23:57:01 +02:00
|
|
|
$(FVMAIN_SIZE)|$(SECFV_SIZE)
|
2012-10-04 17:41:15 +02:00
|
|
|
FV = SECFV
|
2010-12-31 08:55:38 +01:00
|
|
|
|
2009-05-27 23:10:18 +02:00
|
|
|
################################################################################
|
2010-01-04 17:17:59 +01:00
|
|
|
|
|
|
|
[FD.MEMFD]
|
OvmfPkg: Sec: assert the build-time calculated end of the scratch buffer
The DecompressMemFvs() function in "OvmfPkg/Sec/SecMain.c" uses more
memory, temporarily, than what PEIFV and DXEFV will ultimately need.
First, it uses an output buffer for decompression, second, the
decompression itself needs a scratch buffer (and this scratch buffer is
the highest area that SEC uses).
DecompressMemFvs() used to be called on normal boots only (ie. not on S3
resume), which is why the decompression output buffer and the scratch
buffer were allowed to scribble over RAM. However, we'll soon start to
worry during S3 resume that the runtime OS might tamper with the
pre-decompressed PEIFV, and we'll decompress the firmware volumes on S3
resume too, from pristine flash. For this we'll need to know the end of
the scratch buffer in advance, so we can prepare a non-malicious OS for
it.
Calculate the end of the scratch buffer statically in the FDF files, and
assert in DecompressMemFvs() that the runtime decompression will match it.
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@19036 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-30 19:41:20 +01:00
|
|
|
BaseAddress = $(MEMFD_BASE_ADDRESS)
|
2016-05-31 05:41:46 +02:00
|
|
|
Size = 0xB00000
|
2009-05-27 23:10:18 +02:00
|
|
|
ErasePolarity = 1
|
|
|
|
BlockSize = 0x10000
|
2016-05-31 05:41:46 +02:00
|
|
|
NumBlocks = 0xB0
|
2009-05-27 23:10:18 +02:00
|
|
|
|
2014-01-21 20:38:34 +01:00
|
|
|
0x000000|0x006000
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesSize
|
|
|
|
|
2014-03-04 09:03:23 +01:00
|
|
|
0x006000|0x001000
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageSize
|
|
|
|
|
OvmfPkg: PlatformPei: protect SEC's GUIDed section handler table thru S3
OVMF's SecMain is unique in the sense that it links against the following
two libraries *in combination*:
- IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/
LzmaCustomDecompressLib.inf
- MdePkg/Library/BaseExtractGuidedSectionLib/
BaseExtractGuidedSectionLib.inf
The ExtractGuidedSectionLib library class allows decompressor modules to
register themselves (keyed by GUID) with it, and it allows clients to
decompress file sections with a registered decompressor module that
matches the section's GUID.
BaseExtractGuidedSectionLib is a library instance (of type BASE) for this
library class. It has no constructor function.
LzmaCustomDecompressLib is a compatible decompressor module (of type
BASE). Its section type GUID is
gLzmaCustomDecompressGuid == EE4E5898-3914-4259-9D6E-DC7BD79403CF
When OVMF's SecMain module starts, the LzmaCustomDecompressLib constructor
function is executed, which registers its LZMA decompressor with the above
GUID, by calling into BaseExtractGuidedSectionLib:
LzmaDecompressLibConstructor() [GuidedSectionExtraction.c]
ExtractGuidedSectionRegisterHandlers() [BaseExtractGuidedSectionLib.c]
GetExtractGuidedSectionHandlerInfo()
PcdGet64 (PcdGuidedExtractHandlerTableAddress) -- NOTE THIS
Later, during a normal (non-S3) boot, SecMain utilizes this decompressor
to get information about, and to decompress, sections of the OVMF firmware
image:
SecCoreStartupWithStack() [OvmfPkg/Sec/SecMain.c]
SecStartupPhase2()
FindAndReportEntryPoints()
FindPeiCoreImageBase()
DecompressMemFvs()
ExtractGuidedSectionGetInfo() [BaseExtractGuidedSectionLib.c]
ExtractGuidedSectionDecode() [BaseExtractGuidedSectionLib.c]
Notably, only the extraction depends on full-config-boot; the registration
of LzmaCustomDecompressLib occurs unconditionally in the SecMain EFI
binary, triggered by the library constructor function.
This is where the bug happens. BaseExtractGuidedSectionLib maintains the
table of GUIDed decompressors (section handlers) at a fixed memory
location; selected by PcdGuidedExtractHandlerTableAddress (declared in
MdePkg.dec). The default value of this PCD is 0x1000000 (16 MB).
This causes SecMain to corrupt guest OS memory during S3, leading to
random crashes. Compare the following two memory dumps, the first taken
right before suspending, the second taken right after resuming a RHEL-7
guest:
crash> rd -8 -p 1000000 0x50
1000000: c0 00 08 00 02 00 00 00 00 00 00 00 00 00 00 00 ................
1000010: d0 33 0c 00 00 c9 ff ff c0 10 00 01 00 88 ff ff .3..............
1000020: 0a 6d 57 32 0f 00 00 00 38 00 00 01 00 88 ff ff .mW2....8.......
1000030: 00 00 00 00 00 00 00 00 73 69 67 6e 61 6c 6d 6f ........signalmo
1000040: 64 75 6c 65 2e 73 6f 00 00 00 00 00 00 00 00 00 dule.so.........
vs.
crash> rd -8 -p 1000000 0x50
1000000: 45 47 53 49 01 00 00 00 20 00 00 01 00 00 00 00 EGSI.... .......
1000010: 20 01 00 01 00 00 00 00 a0 01 00 01 00 00 00 00 ...............
1000020: 98 58 4e ee 14 39 59 42 9d 6e dc 7b d7 94 03 cf .XN..9YB.n.{....
1000030: 00 00 00 00 00 00 00 00 73 69 67 6e 61 6c 6d 6f ........signalmo
1000040: 64 75 6c 65 2e 73 6f 00 00 00 00 00 00 00 00 00 dule.so.........
The "EGSI" signature corresponds to EXTRACT_HANDLER_INFO_SIGNATURE
declared in
MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.c.
Additionally, the gLzmaCustomDecompressGuid (quoted above) is visible at
guest-phys offset 0x1000020.
Fix the problem as follows:
- Carve out 4KB from the 36KB gap that we currently have between
PcdOvmfLockBoxStorageBase + PcdOvmfLockBoxStorageSize == 8220 KB
and
PcdOvmfSecPeiTempRamBase == 8256 KB.
- Point PcdGuidedExtractHandlerTableAddress to 8220 KB (0x00807000).
- Cover the area with an EfiACPIMemoryNVS type memalloc HOB, if S3 is
supported and we're not currently resuming.
The 4KB size that we pick is an upper estimate for
BaseExtractGuidedSectionLib's internal storage size. The latter is
calculated as follows (see GetExtractGuidedSectionHandlerInfo()):
sizeof(EXTRACT_GUIDED_SECTION_HANDLER_INFO) + // 32
PcdMaximumGuidedExtractHandler * (
sizeof(GUID) + // 16
sizeof(EXTRACT_GUIDED_SECTION_DECODE_HANDLER) + // 8
sizeof(EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER) // 8
)
OVMF sets PcdMaximumGuidedExtractHandler to 16 decimal (which is the
MdePkg default too), yielding 32 + 16 * (16 + 8 + 8) == 544 bytes.
Regarding the lifecycle of the new area:
(a) when and how it is initialized after first boot of the VM
The library linked into SecMain finds that the area lacks the signature.
It initializes the signature, plus the rest of the structure. This is
independent of S3 support.
Consumption of the area is also limited to SEC (but consumption does
depend on full-config-boot).
(b) how it is protected from memory allocations during DXE
It is not, in the general case; and we don't need to. Nothing else links
against BaseExtractGuidedSectionLib; it's OK if DXE overwrites the area.
(c) how it is protected from the OS
When S3 is enabled, we cover it with AcpiNVS in InitializeRamRegions().
When S3 is not supported, the range is not protected.
(d) how it is accessed on the S3 resume path
Examined by the library linked into SecMain. Registrations update the
table in-place (based on GUID matches).
(e) how it is accessed on the warm reset path
If S3 is enabled, then the OS won't damage the table (due to (c)), hence
see (d).
If S3 is unsupported, then the OS may or may not overwrite the
signature. (It likely will.) This is identical to the pre-patch status.
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@15433 6f19259b-4bc3-4df7-8a09-765794883524
2014-04-05 23:26:09 +02:00
|
|
|
0x007000|0x001000
|
|
|
|
gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|gUefiOvmfPkgTokenSpaceGuid.PcdGuidedExtractHandlerTableSize
|
|
|
|
|
2014-01-21 20:38:43 +01:00
|
|
|
0x010000|0x008000
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize
|
|
|
|
|
2014-01-21 20:39:13 +01:00
|
|
|
0x020000|0x0E0000
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize
|
|
|
|
FV = PEIFV
|
|
|
|
|
2016-05-31 05:41:46 +02:00
|
|
|
0x100000|0xA00000
|
2014-01-21 20:39:13 +01:00
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize
|
|
|
|
FV = DXEFV
|
2009-05-27 23:10:18 +02:00
|
|
|
|
|
|
|
################################################################################
|
2010-01-04 17:17:59 +01:00
|
|
|
|
|
|
|
[FV.SECFV]
|
OvmfPkg: add a Name GUID to each Firmware Volume
The FDF spec mentions the FvNameGuid statement for [FV.xxxx] sections, but
the detailed description can be found in Volume 3 of the Platform Init
spec (which is at 1.4a currently).
Adding an FvNameGuid statement to [FV.xxx] has the following effects
(implemented by "BaseTools/Source/C/GenFv/GenFvInternalLib.c"):
- The EFI_FIRMWARE_VOLUME_HEADER.ExtHeaderOffset field is set to a nonzero
value, pointing after EFI_FIRMWARE_VOLUME_HEADER itself (although not
directly, see below).
- An EFI_FIRMWARE_VOLUME_EXT_HEADER object is created at the pointed-to
address. This object is not followed by any
EFI_FIRMWARE_VOLUME_EXT_ENTRY (= extension) entries, so it only
specifies the Name GUID for the firmware volume.
The EFI_FIRMWARE_VOLUME_EXT_HEADER for each firmware volume can be found
in the Build directory as a separate file (20 bytes in size):
Build/Ovmf*/*_GCC*/FV/*.ext
- The new data consume 48 bytes in the following volumes: SECFV,
FVMAIN_COMPACT, DXEFV. They comprise:
- 16 padding bytes,
- EFI_FFS_FILE_HEADER2 (8 bytes in total: no Name and ExtendedSize
fields, and Type=EFI_FV_FILETYPE_FFS_PAD),
- EFI_FIRMWARE_VOLUME_EXT_HEADER (20 bytes, see above),
- 4 padding bytes.
(The initial 16 padding bytes and the EFI_FFS_FILE_HEADER2 structure are
the reason why EFI_FIRMWARE_VOLUME_HEADER.ExtHeaderOffset does not point
immediately past EFI_FIRMWARE_VOLUME_HEADER.)
The sizes of the firmware volumes don't change, only their internal
usages grow by 48 bytes. I verified that the statements and calculations
in "OvmfPkg/DecomprScratchEnd.fdf.inc" are unaffected and remain valid.
- The new data consume 0 bytes in PEIFV. This is because PEIFV has enough
internal padding at the moment to accomodate the above structures
without a growth in usage.
In the future, firmware volumes can be identified by Name GUID (Fv(...)
device path nodes), rather than memory location (MemoryMapped(...) device
path nodes). This is supposed to improve stability for persistent device
paths that refer to FFS files; for example, UEFI boot options.
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Suggested-by: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-07-12 16:48:47 +02:00
|
|
|
FvNameGuid = 763BED0D-DE9F-48F5-81F1-3E90E1B1A015
|
2010-01-04 17:17:59 +01:00
|
|
|
BlockSize = 0x1000
|
|
|
|
FvAlignment = 16
|
|
|
|
ERASE_POLARITY = 1
|
|
|
|
MEMORY_MAPPED = TRUE
|
|
|
|
STICKY_WRITE = TRUE
|
|
|
|
LOCK_CAP = TRUE
|
|
|
|
LOCK_STATUS = TRUE
|
|
|
|
WRITE_DISABLED_CAP = TRUE
|
|
|
|
WRITE_ENABLED_CAP = TRUE
|
|
|
|
WRITE_STATUS = TRUE
|
|
|
|
WRITE_LOCK_CAP = TRUE
|
|
|
|
WRITE_LOCK_STATUS = TRUE
|
|
|
|
READ_DISABLED_CAP = TRUE
|
|
|
|
READ_ENABLED_CAP = TRUE
|
|
|
|
READ_STATUS = TRUE
|
|
|
|
READ_LOCK_CAP = TRUE
|
|
|
|
READ_LOCK_STATUS = TRUE
|
|
|
|
|
2009-05-27 23:10:18 +02:00
|
|
|
#
|
2010-01-04 17:17:59 +01:00
|
|
|
# SEC Phase modules
|
2009-05-27 23:10:18 +02:00
|
|
|
#
|
2010-01-04 17:17:59 +01:00
|
|
|
# The code in this FV handles the initial firmware startup, and
|
2014-01-21 20:39:13 +01:00
|
|
|
# decompresses the PEI and DXE FVs which handles the rest of the boot sequence.
|
2009-05-27 23:10:18 +02:00
|
|
|
#
|
2010-01-04 17:17:59 +01:00
|
|
|
INF OvmfPkg/Sec/SecMain.inf
|
|
|
|
|
2014-08-19 01:04:00 +02:00
|
|
|
INF RuleOverride=RESET_VECTOR OvmfPkg/ResetVector/ResetVector.inf
|
2010-01-04 17:17:59 +01:00
|
|
|
|
2009-05-27 23:10:18 +02:00
|
|
|
################################################################################
|
2014-01-21 20:39:13 +01:00
|
|
|
[FV.PEIFV]
|
OvmfPkg: add a Name GUID to each Firmware Volume
The FDF spec mentions the FvNameGuid statement for [FV.xxxx] sections, but
the detailed description can be found in Volume 3 of the Platform Init
spec (which is at 1.4a currently).
Adding an FvNameGuid statement to [FV.xxx] has the following effects
(implemented by "BaseTools/Source/C/GenFv/GenFvInternalLib.c"):
- The EFI_FIRMWARE_VOLUME_HEADER.ExtHeaderOffset field is set to a nonzero
value, pointing after EFI_FIRMWARE_VOLUME_HEADER itself (although not
directly, see below).
- An EFI_FIRMWARE_VOLUME_EXT_HEADER object is created at the pointed-to
address. This object is not followed by any
EFI_FIRMWARE_VOLUME_EXT_ENTRY (= extension) entries, so it only
specifies the Name GUID for the firmware volume.
The EFI_FIRMWARE_VOLUME_EXT_HEADER for each firmware volume can be found
in the Build directory as a separate file (20 bytes in size):
Build/Ovmf*/*_GCC*/FV/*.ext
- The new data consume 48 bytes in the following volumes: SECFV,
FVMAIN_COMPACT, DXEFV. They comprise:
- 16 padding bytes,
- EFI_FFS_FILE_HEADER2 (8 bytes in total: no Name and ExtendedSize
fields, and Type=EFI_FV_FILETYPE_FFS_PAD),
- EFI_FIRMWARE_VOLUME_EXT_HEADER (20 bytes, see above),
- 4 padding bytes.
(The initial 16 padding bytes and the EFI_FFS_FILE_HEADER2 structure are
the reason why EFI_FIRMWARE_VOLUME_HEADER.ExtHeaderOffset does not point
immediately past EFI_FIRMWARE_VOLUME_HEADER.)
The sizes of the firmware volumes don't change, only their internal
usages grow by 48 bytes. I verified that the statements and calculations
in "OvmfPkg/DecomprScratchEnd.fdf.inc" are unaffected and remain valid.
- The new data consume 0 bytes in PEIFV. This is because PEIFV has enough
internal padding at the moment to accomodate the above structures
without a growth in usage.
In the future, firmware volumes can be identified by Name GUID (Fv(...)
device path nodes), rather than memory location (MemoryMapped(...) device
path nodes). This is supposed to improve stability for persistent device
paths that refer to FFS files; for example, UEFI boot options.
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Suggested-by: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-07-12 16:48:47 +02:00
|
|
|
FvNameGuid = 6938079B-B503-4E3D-9D24-B28337A25806
|
2010-01-04 17:17:59 +01:00
|
|
|
BlockSize = 0x10000
|
|
|
|
FvAlignment = 16
|
2009-05-27 23:10:18 +02:00
|
|
|
ERASE_POLARITY = 1
|
|
|
|
MEMORY_MAPPED = TRUE
|
|
|
|
STICKY_WRITE = TRUE
|
|
|
|
LOCK_CAP = TRUE
|
|
|
|
LOCK_STATUS = TRUE
|
|
|
|
WRITE_DISABLED_CAP = TRUE
|
|
|
|
WRITE_ENABLED_CAP = TRUE
|
|
|
|
WRITE_STATUS = TRUE
|
|
|
|
WRITE_LOCK_CAP = TRUE
|
|
|
|
WRITE_LOCK_STATUS = TRUE
|
|
|
|
READ_DISABLED_CAP = TRUE
|
|
|
|
READ_ENABLED_CAP = TRUE
|
|
|
|
READ_STATUS = TRUE
|
|
|
|
READ_LOCK_CAP = TRUE
|
|
|
|
READ_LOCK_STATUS = TRUE
|
|
|
|
|
2010-01-04 17:17:59 +01:00
|
|
|
APRIORI PEI {
|
|
|
|
INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# PEI Phase modules
|
|
|
|
#
|
|
|
|
INF MdeModulePkg/Core/Pei/PeiMain.inf
|
|
|
|
INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf
|
OvmfPkg: use StatusCode Router and Handler from MdeModulePkg
In the Platform Init v1.4a spec,
- Volume 1 "4.7 Status Code Service" defines the
EFI_PEI_SERVICES.ReportStatusCode() service,
- Volume 1 "6.3.5 Status Code PPI (Optional)" defines the
EFI_PEI_PROGRESS_CODE_PPI (equivalent to the above),
- Volume 2 "14.2 Status Code Runtime Protocol" defines the
EFI_STATUS_CODE_PROTOCOL.
These allow PEIMs and DXE (and later) modules to report status codes.
Currently OvmfPkg uses modules from under
"IntelFrameworkModulePkg/Universal/StatusCode/", which produce the above
abstractions (PPI and PROTOCOL) directly, and write the status codes, as
they are reported, to the serial port or to a memory buffer. This is
called "handling" the status codes.
In the Platform Init v1.4a spec,
- Volume 3 "7.2.2 Report Status Code Handler PPI" defines
EFI_PEI_RSC_HANDLER_PPI,
- Volume 3 "7.2.1 Report Status Code Handler Protocol" defines
EFI_RSC_HANDLER_PROTOCOL.
These allow several PEIMs and runtime DXE drivers to register callbacks
for status code handling.
MdeModulePkg offers a PEIM under
"MdeModulePkg/Universal/ReportStatusCodeRouter/Pei" that produces both
EFI_PEI_PROGRESS_CODE_PPI and EFI_PEI_RSC_HANDLER_PPI, and a runtime DXE
driver under "MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe"
that produces both EFI_STATUS_CODE_PROTOCOL and EFI_RSC_HANDLER_PROTOCOL.
MdeModulePkg also offers status code handler modules under
MdeModulePkg/Universal/StatusCodeHandler/ that depend on
EFI_PEI_RSC_HANDLER_PPI and EFI_RSC_HANDLER_PROTOCOL, respectively.
The StatusCodeHandler modules register themselves with
ReportStatusCodeRouter through EFI_PEI_RSC_HANDLER_PPI /
EFI_RSC_HANDLER_PROTOCOL. When another module reports a status code
through EFI_PEI_PROGRESS_CODE_PPI / EFI_STATUS_CODE_PROTOCOL, it reaches
the phase-matching ReportStatusCodeRouter module first, which in turn
passes the status code to the pre-registered, phase-matching
StatusCodeHandler module.
The status code handling in the StatusCodeHandler modules is identical to
the one currently provided by the IntelFrameworkModulePkg modules. Replace
the IntelFrameworkModulePkg modules with the MdeModulePkg ones, so we can
decrease our dependency on IntelFrameworkModulePkg.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Suggested-by: Liming Gao <liming.gao@intel.com>
Fixes: https://tianocore.acgmultimedia.com/show_bug.cgi?id=63
[jordan.l.justen@intel.com: point out IntelFareworkModulePkg typos]
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
[lersek@redhat.com: rewrap to 74 cols; fix IntelFareworkModulePkg typos]
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
2016-08-02 19:25:10 +02:00
|
|
|
INF MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.inf
|
|
|
|
INF MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf
|
2010-01-04 17:17:59 +01:00
|
|
|
INF OvmfPkg/PlatformPei/PlatformPei.inf
|
|
|
|
INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
|
2014-03-04 09:03:06 +01:00
|
|
|
INF UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf
|
OvmfPkg: add PEIM for providing TSEG-as-SMRAM during PEI
"MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf" is the
LockBoxLib instance with SMRAM access for the PEI phase.
Said library instance must, and can, access the LockBox data in SMRAM
directly if it is invoked before SMBASE relocation / SMI handler
installation. In that case, it only needs PEI_SMM_ACCESS_PPI from the
platform, and it doesn't depend on EFI_PEI_SMM_COMMUNICATION_PPI.
OVMF satisfies the description in SVN r18823 ("MdeModulePkg:
SmmLockBoxPeiLib: work without EFI_PEI_SMM_COMMUNICATION_PPI"): in OVMF,
only S3Resume2Pei links against SmmLockBoxPeiLib.
Therefore, introduce a PEIM that produces the PEI_SMM_ACCESS_PPI
interface, enabling SmmLockBoxPeiLib to work; we can omit including
"UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.inf".
The load / installation order of S3Resume2Pei and SmmAccessPei is
indifferent. SmmAccessPei produces the gEfiAcpiVariableGuid HOB during its
installation (which happens during PEI), but S3Resume2Pei accesses the HOB
only when the DXE IPL calls its S3RestoreConfig2 PPI member, as last act
of PEI.
MCH_SMRAM_D_LCK and MCH_ESMRAMC_T_EN are masked out the way they are, in
SmmAccessPeiEntryPoint() and SmramAccessOpen() respectively, in order to
prevent VS20xx from warning about the (otherwise fully intentional)
truncation in the UINT8 casts. (Warnings reported by Michael Kinney.)
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19040 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-30 19:41:38 +01:00
|
|
|
!if $(SMM_REQUIRE) == TRUE
|
|
|
|
INF OvmfPkg/SmmAccess/SmmAccessPei.inf
|
|
|
|
!endif
|
OvmfPkg: include UefiCpuPkg/CpuMpPei
In the next patch we're going to put EFI_PEI_MP_SERVICES_PPI to use.
CpuMpPei uses the following PCDs from gUefiCpuPkgTokenSpaceGuid, beyond
those already used by CpuDxe:
- PcdCpuMicrocodePatchAddress and PcdCpuMicrocodePatchRegionSize: these
control whether CpuMpPei performs microcode update. If the region size
is zero, then the microcode update is skipped. UefiCpuPkg.dec sets the
region size to zero by default, which is appropriate for OVMF.
- PcdCpuApLoopMode and PcdCpuApTargetCstate: the former controls how
CpuMpPei puts the APs to sleep: 1 -- HLT, 2 -- MWAIT, 3 -- busy wait
(with PAUSE). The latter PCD is only relevant if the former PCD is 2
(MWAIT). In order to be consistent with SeaBIOS and with CpuDxe itself,
we choose HLT. That's the default set by UefiCpuPkg.dec.
Furthermore, although CpuMpPei could consume SecPeiCpuExceptionHandlerLib
technically, it is supposed to consume PeiCpuExceptionHandlerLib. See:
- http://thread.gmane.org/gmane.comp.bios.edk2.devel/12703
- git commit a81abf161666 ("UefiCpuPkg/ExceptionLib: Import
PeiCpuExceptionHandlerLib module"), part of the series linked above.
Jeff recommended to resolve CpuExceptionHandlerLib to
PeiCpuExceptionHandlerLib for all PEIMs:
- http://thread.gmane.org/gmane.comp.bios.edk2.devel/14471/focus=14477
Since at the moment we have no resolution in place that would cover this
for PEIMs (from either [LibraryClasses] or [LibraryClasses.common.PEIM]),
it's easy to do.
Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-07-06 18:09:16 +02:00
|
|
|
INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf
|
2010-01-04 17:17:59 +01:00
|
|
|
|
2010-02-25 22:53:06 +01:00
|
|
|
################################################################################
|
|
|
|
|
|
|
|
[FV.DXEFV]
|
OvmfPkg: add a Name GUID to each Firmware Volume
The FDF spec mentions the FvNameGuid statement for [FV.xxxx] sections, but
the detailed description can be found in Volume 3 of the Platform Init
spec (which is at 1.4a currently).
Adding an FvNameGuid statement to [FV.xxx] has the following effects
(implemented by "BaseTools/Source/C/GenFv/GenFvInternalLib.c"):
- The EFI_FIRMWARE_VOLUME_HEADER.ExtHeaderOffset field is set to a nonzero
value, pointing after EFI_FIRMWARE_VOLUME_HEADER itself (although not
directly, see below).
- An EFI_FIRMWARE_VOLUME_EXT_HEADER object is created at the pointed-to
address. This object is not followed by any
EFI_FIRMWARE_VOLUME_EXT_ENTRY (= extension) entries, so it only
specifies the Name GUID for the firmware volume.
The EFI_FIRMWARE_VOLUME_EXT_HEADER for each firmware volume can be found
in the Build directory as a separate file (20 bytes in size):
Build/Ovmf*/*_GCC*/FV/*.ext
- The new data consume 48 bytes in the following volumes: SECFV,
FVMAIN_COMPACT, DXEFV. They comprise:
- 16 padding bytes,
- EFI_FFS_FILE_HEADER2 (8 bytes in total: no Name and ExtendedSize
fields, and Type=EFI_FV_FILETYPE_FFS_PAD),
- EFI_FIRMWARE_VOLUME_EXT_HEADER (20 bytes, see above),
- 4 padding bytes.
(The initial 16 padding bytes and the EFI_FFS_FILE_HEADER2 structure are
the reason why EFI_FIRMWARE_VOLUME_HEADER.ExtHeaderOffset does not point
immediately past EFI_FIRMWARE_VOLUME_HEADER.)
The sizes of the firmware volumes don't change, only their internal
usages grow by 48 bytes. I verified that the statements and calculations
in "OvmfPkg/DecomprScratchEnd.fdf.inc" are unaffected and remain valid.
- The new data consume 0 bytes in PEIFV. This is because PEIFV has enough
internal padding at the moment to accomodate the above structures
without a growth in usage.
In the future, firmware volumes can be identified by Name GUID (Fv(...)
device path nodes), rather than memory location (MemoryMapped(...) device
path nodes). This is supposed to improve stability for persistent device
paths that refer to FFS files; for example, UEFI boot options.
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Suggested-by: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-07-12 16:48:47 +02:00
|
|
|
FvNameGuid = 7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1
|
2010-02-25 22:53:06 +01:00
|
|
|
BlockSize = 0x10000
|
|
|
|
FvAlignment = 16
|
|
|
|
ERASE_POLARITY = 1
|
|
|
|
MEMORY_MAPPED = TRUE
|
|
|
|
STICKY_WRITE = TRUE
|
|
|
|
LOCK_CAP = TRUE
|
|
|
|
LOCK_STATUS = TRUE
|
|
|
|
WRITE_DISABLED_CAP = TRUE
|
|
|
|
WRITE_ENABLED_CAP = TRUE
|
|
|
|
WRITE_STATUS = TRUE
|
|
|
|
WRITE_LOCK_CAP = TRUE
|
|
|
|
WRITE_LOCK_STATUS = TRUE
|
|
|
|
READ_DISABLED_CAP = TRUE
|
|
|
|
READ_ENABLED_CAP = TRUE
|
|
|
|
READ_STATUS = TRUE
|
|
|
|
READ_LOCK_CAP = TRUE
|
|
|
|
READ_LOCK_STATUS = TRUE
|
|
|
|
|
|
|
|
APRIORI DXE {
|
2013-07-26 05:14:08 +02:00
|
|
|
INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
|
2010-02-25 22:53:06 +01:00
|
|
|
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
|
2015-11-30 19:49:03 +01:00
|
|
|
!if $(SMM_REQUIRE) == FALSE
|
2013-11-12 19:35:01 +01:00
|
|
|
INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
|
2015-11-30 19:49:03 +01:00
|
|
|
!endif
|
2010-02-25 22:53:06 +01:00
|
|
|
}
|
|
|
|
|
2009-05-27 23:10:18 +02:00
|
|
|
#
|
|
|
|
# DXE Phase modules
|
|
|
|
#
|
|
|
|
INF MdeModulePkg/Core/Dxe/DxeMain.inf
|
|
|
|
|
OvmfPkg: use StatusCode Router and Handler from MdeModulePkg
In the Platform Init v1.4a spec,
- Volume 1 "4.7 Status Code Service" defines the
EFI_PEI_SERVICES.ReportStatusCode() service,
- Volume 1 "6.3.5 Status Code PPI (Optional)" defines the
EFI_PEI_PROGRESS_CODE_PPI (equivalent to the above),
- Volume 2 "14.2 Status Code Runtime Protocol" defines the
EFI_STATUS_CODE_PROTOCOL.
These allow PEIMs and DXE (and later) modules to report status codes.
Currently OvmfPkg uses modules from under
"IntelFrameworkModulePkg/Universal/StatusCode/", which produce the above
abstractions (PPI and PROTOCOL) directly, and write the status codes, as
they are reported, to the serial port or to a memory buffer. This is
called "handling" the status codes.
In the Platform Init v1.4a spec,
- Volume 3 "7.2.2 Report Status Code Handler PPI" defines
EFI_PEI_RSC_HANDLER_PPI,
- Volume 3 "7.2.1 Report Status Code Handler Protocol" defines
EFI_RSC_HANDLER_PROTOCOL.
These allow several PEIMs and runtime DXE drivers to register callbacks
for status code handling.
MdeModulePkg offers a PEIM under
"MdeModulePkg/Universal/ReportStatusCodeRouter/Pei" that produces both
EFI_PEI_PROGRESS_CODE_PPI and EFI_PEI_RSC_HANDLER_PPI, and a runtime DXE
driver under "MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe"
that produces both EFI_STATUS_CODE_PROTOCOL and EFI_RSC_HANDLER_PROTOCOL.
MdeModulePkg also offers status code handler modules under
MdeModulePkg/Universal/StatusCodeHandler/ that depend on
EFI_PEI_RSC_HANDLER_PPI and EFI_RSC_HANDLER_PROTOCOL, respectively.
The StatusCodeHandler modules register themselves with
ReportStatusCodeRouter through EFI_PEI_RSC_HANDLER_PPI /
EFI_RSC_HANDLER_PROTOCOL. When another module reports a status code
through EFI_PEI_PROGRESS_CODE_PPI / EFI_STATUS_CODE_PROTOCOL, it reaches
the phase-matching ReportStatusCodeRouter module first, which in turn
passes the status code to the pre-registered, phase-matching
StatusCodeHandler module.
The status code handling in the StatusCodeHandler modules is identical to
the one currently provided by the IntelFrameworkModulePkg modules. Replace
the IntelFrameworkModulePkg modules with the MdeModulePkg ones, so we can
decrease our dependency on IntelFrameworkModulePkg.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Suggested-by: Liming Gao <liming.gao@intel.com>
Fixes: https://tianocore.acgmultimedia.com/show_bug.cgi?id=63
[jordan.l.justen@intel.com: point out IntelFareworkModulePkg typos]
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
[lersek@redhat.com: rewrap to 74 cols; fix IntelFareworkModulePkg typos]
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
2016-08-02 19:25:10 +02:00
|
|
|
INF MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf
|
|
|
|
INF MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
|
2009-05-27 23:10:18 +02:00
|
|
|
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
|
|
|
|
|
|
|
|
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
|
|
|
|
INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
|
2010-01-04 17:17:59 +01:00
|
|
|
INF MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
|
2009-05-27 23:10:18 +02:00
|
|
|
INF PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf
|
2009-12-09 03:18:21 +01:00
|
|
|
INF UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf
|
2009-05-27 23:10:18 +02:00
|
|
|
INF UefiCpuPkg/CpuDxe/CpuDxe.inf
|
|
|
|
INF PcAtChipsetPkg/8254TimerDxe/8254Timer.inf
|
OvmfPkg: prevent 64-bit MMIO BAR degradation if there is no CSM
According to edk2 commit
"MdeModulePkg/PciBus: do not improperly degrade resource"
and to the EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL definition in the
Platform Init 1.4a specification, a platform can provide such a protocol
in order to influence the PCI resource allocation performed by the PCI Bus
driver.
In particular it is possible instruct the PCI Bus driver, with a
"wildcard" hint, to allocate the 64-bit MMIO BARs of a device in 64-bit
address space, regardless of whether the device features an option ROM.
(By default, the PCI Bus driver considers an option ROM reason enough for
allocating the 64-bit MMIO BARs in 32-bit address space. It cannot know if
BDS will launch a legacy boot option, and under legacy boot, a legacy BIOS
binary from a combined option ROM could be dispatched, and fail to access
MMIO BARs in 64-bit address space.)
In platform code we can ascertain whether a CSM is present or not. If not,
then legacy BIOS binaries in option ROMs can't be dispatched, hence the
BAR degradation is detrimental, and we should prevent it. This is expected
to conserve the 32-bit address space for 32-bit MMIO BARs.
The driver added in this patch could be simplified based on the following
facts:
- In the Ia32 build, the 64-bit MMIO aperture is always zero-size, hence
the driver will exit immediately. Therefore the driver could be omitted
from the Ia32 build.
- In the Ia32X64 and X64 builds, the driver could be omitted if CSM_ENABLE
was defined (because in that case the degradation would be justified).
On the other hand, if CSM_ENABLE was undefined, then the driver could be
included, and it could provide the hint unconditionally (without looking
for the Legacy BIOS protocol).
These short-cuts are not taken because they would increase the differences
between the OVMF DSC/FDF files. If we can manage without extreme
complexity, we should use dynamic logic (vs. build time configuration),
plus keep conditional compilation to a minimum.
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-18 20:13:41 +02:00
|
|
|
INF OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.inf
|
OvmfPkg: add PciHotPlugInitDxe
After IncompatiblePciDeviceSupportDxe, this is another small driver /
protocol implementation that tweaks the behavior of the PCI bus driver in
edk2.
The protocol is specified in the Platform Init Spec v1.4a, Volume 5,
Chapter 12.6 "PCI Hot Plug PCI Initialization Protocol". This
implementation steers the PCI bus driver to reserve the following
resources ("padding") for each PCI bus, in addition to the BARs of the
devices on that PCI bus:
- 2MB of 64-bit non-prefetchable MMIO aperture,
- 512B of IO port space.
The goal is to reserve room for devices hot-plugged at runtime even if the
bridge receiving the device is empty at boot time.
The 2MB MMIO size is inspired by SeaBIOS. The 512B IO port size is
actually only 1/8th of the PCI spec mandated reservation, but the
specified size of 4096 has proved wasteful (given the limited size of our
IO port space -- see commit bba734ab4c7c). Especially on Q35, where every
PCIe root port and downstream port qualifies as a separate bridge (capable
of accepting a single device).
Test results for this patch:
- regardless of our request for 64-bit MMIO reservation, it is downgraded
to 32-bit,
- although we request 512B alignment for the IO port space reservation,
the next upstream bridge rounds it up to 4096B.
Cc: "Johnson, Brian J." <bjohnson@sgi.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Suggested-by: Andrew Fish <afish@apple.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
2016-06-30 20:16:06 +02:00
|
|
|
INF OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
|
2016-01-26 01:18:36 +01:00
|
|
|
INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
|
2009-10-20 05:44:25 +02:00
|
|
|
INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
|
2016-08-10 07:31:02 +02:00
|
|
|
INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
|
2009-05-27 23:10:18 +02:00
|
|
|
INF MdeModulePkg/Universal/Metronome/Metronome.inf
|
2009-07-15 01:32:41 +02:00
|
|
|
INF PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf
|
2009-07-07 06:54:01 +02:00
|
|
|
|
2010-03-21 01:34:15 +01:00
|
|
|
INF OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf
|
2013-12-11 17:58:22 +01:00
|
|
|
INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
|
2016-03-12 18:03:33 +01:00
|
|
|
INF OvmfPkg/Virtio10Dxe/Virtio10.inf
|
2012-10-08 09:32:59 +02:00
|
|
|
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
|
2012-10-18 19:07:48 +02:00
|
|
|
INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
|
2016-02-24 09:27:30 +01:00
|
|
|
INF OvmfPkg/VirtioRngDxe/VirtioRng.inf
|
2015-02-28 21:33:11 +01:00
|
|
|
INF OvmfPkg/XenIoPciDxe/XenIoPciDxe.inf
|
2014-10-29 07:48:50 +01:00
|
|
|
INF OvmfPkg/XenBusDxe/XenBusDxe.inf
|
2014-10-29 07:51:42 +01:00
|
|
|
INF OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf
|
2012-03-09 18:38:53 +01:00
|
|
|
|
|
|
|
!if $(SECURE_BOOT_ENABLE) == TRUE
|
OvmfPkg: disable stale fork of SecureBootConfigDxe
OvmfPkg forked SecureBootConfigDxe from SecurityPkg in SVN r13635 (git
commit 8c71ec8f). Since then, the original (in
"SecurityPkg/VariableAuthenticated/SecureBootConfigDxe") has diverged
significantly.
The initial diff between the original and the fork, when the fork was made
(ie. at SVN r13635), reads as follows:
> diff -ur SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfig.vfr OvmfPkg/SecureBootConfigDxe/SecureBootConfig.vfr
> --- SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfig.vfr 2014-09-30 23:35:28.598067147 +0200
> +++ OvmfPkg/SecureBootConfigDxe/SecureBootConfig.vfr 2014-08-09 02:40:35.824851626 +0200
> @@ -51,7 +51,7 @@
> questionid = KEY_SECURE_BOOT_ENABLE,
> prompt = STRING_TOKEN(STR_SECURE_BOOT_PROMPT),
> help = STRING_TOKEN(STR_SECURE_BOOT_HELP),
> - flags = INTERACTIVE | RESET_REQUIRED,
> + flags = INTERACTIVE,
> endcheckbox;
> endif;
>
> @@ -158,7 +158,7 @@
> questionid = KEY_SECURE_BOOT_DELETE_PK,
> prompt = STRING_TOKEN(STR_DELETE_PK),
> help = STRING_TOKEN(STR_DELETE_PK_HELP),
> - flags = INTERACTIVE | RESET_REQUIRED,
> + flags = INTERACTIVE,
> endcheckbox;
> endif;
> endform;
> diff -ur SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf OvmfPkg/SecureBootConfigDxe/SecureBootConfigDxe.inf
> --- SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf 2014-09-30 23:35:28.598067147 +0200
> +++ OvmfPkg/SecureBootConfigDxe/SecureBootConfigDxe.inf 2014-09-30 23:35:28.577067027 +0200
> @@ -1,5 +1,8 @@
> ## @file
> -# Component name for SecureBoot configuration module.
> +# Component name for SecureBoot configuration module for OVMF.
> +#
> +# Need custom SecureBootConfigDxe for OVMF that does not force
> +# resets after PK changes since OVMF doesn't have persistent variables
> #
> # Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
> # This program and the accompanying materials
> diff -ur SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c OvmfPkg/SecureBootConfigDxe/SecureBootConfigImpl.c
> --- SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c 2014-09-30 23:35:28.599067153 +0200
> +++ OvmfPkg/SecureBootConfigDxe/SecureBootConfigImpl.c 2014-09-30 23:35:28.578067033 +0200
> @@ -2559,7 +2559,7 @@
> NULL
> );
> } else {
> - *ActionRequest = EFI_BROWSER_ACTION_REQUEST_RESET;
> + *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
> }
> break;
The commit message is not overly verbose:
OvmfPkg: Add custom SecureBootConfigDxe that doesn't reset
We don't force a platform reset for OVMF when PK is changed in custom
mode setup.
But the INF file hunk is telling:
Need custom SecureBootConfigDxe for OVMF that does not force resets
after PK changes since OVMF doesn't have persistent variables
We do have persistent variables now. Let's disable the (now obsolete)
OvmfPkg fork, and revert to the (well maintained) SecurityPkg-provided
config driver.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Gary Lin <glin@suse.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16191 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-02 10:08:05 +02:00
|
|
|
INF SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
|
2012-03-09 18:38:53 +01:00
|
|
|
!endif
|
|
|
|
|
2009-05-27 23:10:18 +02:00
|
|
|
INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
|
|
|
|
INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
|
|
|
|
INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
|
|
|
|
INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
|
|
|
|
INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
|
|
|
|
INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
|
|
|
|
INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
|
2016-06-28 21:09:53 +02:00
|
|
|
INF MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf
|
2016-04-18 03:47:55 +02:00
|
|
|
INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
|
|
|
|
INF MdeModulePkg/Application/UiApp/UiApp.inf
|
2009-05-27 23:10:18 +02:00
|
|
|
INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
|
2009-06-30 17:57:29 +02:00
|
|
|
INF MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
|
2009-05-27 23:10:18 +02:00
|
|
|
INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
|
|
|
|
INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
|
2016-03-30 23:49:37 +02:00
|
|
|
INF MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
|
2009-05-27 23:10:18 +02:00
|
|
|
INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
|
|
|
|
INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
|
|
|
|
INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
|
OvmfPkg: enable SATA controller
In this patch, we replace the traditional IDE driver stack that comes from
PcAtChipsetPkg and IntelFrameworkModulePkg with more featureful drivers
from OvmfPkg and MdeModulePkg. The resultant driver stack is compatible
with the previous one, but provides more protocols, on more kinds of
virtual hardware.
Remove:
- PcAtChipsetPkg/Bus/Pci/IdeControllerDxe/IdeControllerDxe.inf
(removing EFI_IDE_CONTROLLER_INIT_PROTOCOL [1])
Remove the dependent:
- IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf
(removing EFI_DISK_INFO_PROTOCOL [2],
EFI_BLOCK_IO_PROTOCOL [3])
As replacement, add:
- OvmfPkg/SataControllerDxe/SataControllerDxe.inf
(supplying EFI_IDE_CONTROLLER_INIT_PROTOCOL [1])
On top of which, add the dependent:
- MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
(providing EFI_ATA_PASS_THRU_PROTOCOL,
EFI_EXT_SCSI_PASS_THRU_PROTOCOL)
On top of which, add the dependent:
- MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
(supplying EFI_DISK_INFO_PROTOCOL [2],
EFI_BLOCK_IO_PROTOCOL [3],
providing EFI_BLOCK_IO2PROTOCOL,
EFI_STORAGE_SECURITY_COMMAND_PROTOCOL)
Cc: Alexander Graf <agraf@suse.de>
Cc: Reza Jelveh <reza.jelveh@tuhh.de>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Gabriel L. Somlo <somlo@cmu.edu>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Reza Jelveh <reza.jelveh@tuhh.de>
[lersek@redhat.com: rewrote commit message]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18532 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-22 13:18:45 +02:00
|
|
|
INF OvmfPkg/SataControllerDxe/SataControllerDxe.inf
|
|
|
|
INF MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
|
|
|
|
INF MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
|
2016-02-02 16:30:25 +01:00
|
|
|
INF MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
|
2009-05-27 23:10:18 +02:00
|
|
|
INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
|
|
|
|
INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
|
2013-08-12 04:24:32 +02:00
|
|
|
INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
|
2011-01-21 17:50:47 +01:00
|
|
|
INF MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf
|
2009-05-27 23:10:18 +02:00
|
|
|
|
|
|
|
INF PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.inf
|
|
|
|
INF IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.inf
|
2011-10-26 09:08:32 +02:00
|
|
|
|
|
|
|
!ifndef $(SOURCE_DEBUG_ENABLE)
|
2009-05-27 23:10:18 +02:00
|
|
|
INF IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf
|
2011-10-26 09:08:32 +02:00
|
|
|
!endif
|
|
|
|
|
2009-05-27 23:10:18 +02:00
|
|
|
INF IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf
|
|
|
|
INF IntelFrameworkModulePkg/Bus/Isa/IsaFloppyDxe/IsaFloppyDxe.inf
|
|
|
|
|
2011-08-14 00:54:37 +02:00
|
|
|
INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
|
|
|
|
INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
|
|
|
|
|
2009-05-27 23:10:18 +02:00
|
|
|
INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
|
2012-05-31 01:15:00 +02:00
|
|
|
INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
|
2009-10-07 18:01:09 +02:00
|
|
|
INF RuleOverride=ACPITABLE OvmfPkg/AcpiTables/AcpiTables.inf
|
2014-03-04 09:03:50 +01:00
|
|
|
INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf
|
2014-03-04 09:04:13 +01:00
|
|
|
INF MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf
|
2009-05-27 23:10:18 +02:00
|
|
|
|
2016-04-06 07:58:40 +02:00
|
|
|
INF FatPkg/EnhancedFatDxe/Fat.inf
|
2011-06-26 20:58:41 +02:00
|
|
|
|
2013-08-23 20:45:47 +02:00
|
|
|
!ifndef $(USE_OLD_SHELL)
|
2011-06-26 20:58:41 +02:00
|
|
|
INF ShellPkg/Application/Shell/Shell.inf
|
|
|
|
!else
|
2010-06-29 06:55:13 +02:00
|
|
|
INF RuleOverride = BINARY USE = X64 EdkShellBinPkg/FullShell/FullShell.inf
|
2011-06-26 20:58:41 +02:00
|
|
|
!endif
|
2009-05-27 23:10:18 +02:00
|
|
|
|
2016-09-26 08:45:06 +02:00
|
|
|
INF MdeModulePkg/Logo/LogoDxe.inf
|
2010-07-26 20:07:19 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Network modules
|
|
|
|
#
|
2013-05-15 20:20:39 +02:00
|
|
|
!if $(E1000_ENABLE)
|
2010-07-26 20:07:19 +02:00
|
|
|
FILE DRIVER = 5D695E11-9B3F-4b83-B25F-4A8D5D69BE07 {
|
|
|
|
SECTION PE32 = Intel3.5/EFIX64/E3507X2.EFI
|
|
|
|
}
|
2013-05-15 20:20:39 +02:00
|
|
|
!endif
|
2010-07-26 20:07:19 +02:00
|
|
|
INF MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf
|
|
|
|
INF MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
|
|
|
|
INF MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
|
|
|
|
INF MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
|
|
|
|
INF MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
|
|
|
|
INF MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
|
|
|
|
INF MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
|
|
|
|
INF MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
|
|
|
|
INF MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
|
2014-12-19 20:13:44 +01:00
|
|
|
!if $(NETWORK_IP6_ENABLE) == TRUE
|
|
|
|
INF NetworkPkg/Ip6Dxe/Ip6Dxe.inf
|
|
|
|
INF NetworkPkg/TcpDxe/TcpDxe.inf
|
|
|
|
INF NetworkPkg/Udp6Dxe/Udp6Dxe.inf
|
|
|
|
INF NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
|
|
|
|
INF NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
|
|
|
|
INF NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
|
|
|
|
!if $(SECURE_BOOT_ENABLE) == TRUE
|
|
|
|
INF NetworkPkg/IScsiDxe/IScsiDxe.inf
|
|
|
|
!else
|
|
|
|
INF MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
|
|
|
|
!endif
|
|
|
|
!else
|
|
|
|
INF MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
|
2010-07-26 20:07:19 +02:00
|
|
|
INF MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
|
|
|
|
INF MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
|
2015-08-23 03:44:15 +02:00
|
|
|
!endif
|
|
|
|
!if $(HTTP_BOOT_ENABLE) == TRUE
|
|
|
|
INF NetworkPkg/DnsDxe/DnsDxe.inf
|
2015-08-28 10:12:42 +02:00
|
|
|
INF NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
|
2015-08-23 03:44:15 +02:00
|
|
|
INF NetworkPkg/HttpDxe/HttpDxe.inf
|
|
|
|
INF NetworkPkg/HttpBootDxe/HttpBootDxe.inf
|
2014-12-19 20:13:44 +01:00
|
|
|
!endif
|
2013-06-14 09:41:13 +02:00
|
|
|
INF OvmfPkg/VirtioNetDxe/VirtioNet.inf
|
2010-12-31 08:55:38 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Usb Support
|
|
|
|
#
|
|
|
|
INF MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf
|
|
|
|
INF MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
|
2015-03-16 20:57:34 +01:00
|
|
|
INF MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
|
2010-12-31 08:55:38 +01:00
|
|
|
INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
|
|
|
|
INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
|
|
|
|
INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
|
|
|
|
|
2011-11-10 23:04:49 +01:00
|
|
|
!ifdef $(CSM_ENABLE)
|
|
|
|
INF IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf
|
|
|
|
INF IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
|
|
|
|
INF RuleOverride=CSM OvmfPkg/Csm/Csm16/Csm16.inf
|
|
|
|
!endif
|
|
|
|
|
2012-07-11 00:43:19 +02:00
|
|
|
INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf
|
2016-08-16 17:35:52 +02:00
|
|
|
INF OvmfPkg/VirtioGpuDxe/VirtioGpu.inf
|
2014-03-22 08:12:55 +01:00
|
|
|
INF OvmfPkg/PlatformDxe/Platform.inf
|
2012-07-11 00:43:19 +02:00
|
|
|
|
2015-11-30 19:41:43 +01:00
|
|
|
!if $(SMM_REQUIRE) == TRUE
|
|
|
|
INF OvmfPkg/SmmAccess/SmmAccess2Dxe.inf
|
2015-11-30 19:41:48 +01:00
|
|
|
INF OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
|
2015-11-30 19:46:55 +01:00
|
|
|
INF UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf
|
2015-11-30 19:41:52 +01:00
|
|
|
INF MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
|
|
|
|
INF MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
|
2015-11-30 19:41:56 +01:00
|
|
|
INF UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
|
2015-11-30 19:42:15 +01:00
|
|
|
INF MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf
|
2015-11-30 19:48:46 +01:00
|
|
|
INF UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf
|
2015-11-30 19:41:43 +01:00
|
|
|
|
2015-11-30 19:48:59 +01:00
|
|
|
#
|
2015-11-30 19:49:03 +01:00
|
|
|
# Variable driver stack (SMM)
|
|
|
|
#
|
|
|
|
INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf
|
|
|
|
INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
|
|
|
|
INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
|
|
|
|
INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf
|
|
|
|
|
|
|
|
!else
|
|
|
|
|
|
|
|
#
|
|
|
|
# Variable driver stack (non-SMM)
|
2015-11-30 19:48:59 +01:00
|
|
|
#
|
|
|
|
INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
|
|
|
|
INF OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf
|
|
|
|
INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
|
|
|
|
INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
|
2015-11-30 19:49:03 +01:00
|
|
|
!endif
|
2015-11-30 19:48:59 +01:00
|
|
|
|
2009-05-27 23:10:18 +02:00
|
|
|
################################################################################
|
|
|
|
|
2010-06-26 00:23:22 +02:00
|
|
|
[FV.FVMAIN_COMPACT]
|
OvmfPkg: add a Name GUID to each Firmware Volume
The FDF spec mentions the FvNameGuid statement for [FV.xxxx] sections, but
the detailed description can be found in Volume 3 of the Platform Init
spec (which is at 1.4a currently).
Adding an FvNameGuid statement to [FV.xxx] has the following effects
(implemented by "BaseTools/Source/C/GenFv/GenFvInternalLib.c"):
- The EFI_FIRMWARE_VOLUME_HEADER.ExtHeaderOffset field is set to a nonzero
value, pointing after EFI_FIRMWARE_VOLUME_HEADER itself (although not
directly, see below).
- An EFI_FIRMWARE_VOLUME_EXT_HEADER object is created at the pointed-to
address. This object is not followed by any
EFI_FIRMWARE_VOLUME_EXT_ENTRY (= extension) entries, so it only
specifies the Name GUID for the firmware volume.
The EFI_FIRMWARE_VOLUME_EXT_HEADER for each firmware volume can be found
in the Build directory as a separate file (20 bytes in size):
Build/Ovmf*/*_GCC*/FV/*.ext
- The new data consume 48 bytes in the following volumes: SECFV,
FVMAIN_COMPACT, DXEFV. They comprise:
- 16 padding bytes,
- EFI_FFS_FILE_HEADER2 (8 bytes in total: no Name and ExtendedSize
fields, and Type=EFI_FV_FILETYPE_FFS_PAD),
- EFI_FIRMWARE_VOLUME_EXT_HEADER (20 bytes, see above),
- 4 padding bytes.
(The initial 16 padding bytes and the EFI_FFS_FILE_HEADER2 structure are
the reason why EFI_FIRMWARE_VOLUME_HEADER.ExtHeaderOffset does not point
immediately past EFI_FIRMWARE_VOLUME_HEADER.)
The sizes of the firmware volumes don't change, only their internal
usages grow by 48 bytes. I verified that the statements and calculations
in "OvmfPkg/DecomprScratchEnd.fdf.inc" are unaffected and remain valid.
- The new data consume 0 bytes in PEIFV. This is because PEIFV has enough
internal padding at the moment to accomodate the above structures
without a growth in usage.
In the future, firmware volumes can be identified by Name GUID (Fv(...)
device path nodes), rather than memory location (MemoryMapped(...) device
path nodes). This is supposed to improve stability for persistent device
paths that refer to FFS files; for example, UEFI boot options.
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Suggested-by: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-07-12 16:48:47 +02:00
|
|
|
FvNameGuid = 48DB5E17-707C-472D-91CD-1613E7EF51B0
|
2009-05-27 23:10:18 +02:00
|
|
|
FvAlignment = 16
|
|
|
|
ERASE_POLARITY = 1
|
|
|
|
MEMORY_MAPPED = TRUE
|
|
|
|
STICKY_WRITE = TRUE
|
|
|
|
LOCK_CAP = TRUE
|
|
|
|
LOCK_STATUS = TRUE
|
|
|
|
WRITE_DISABLED_CAP = TRUE
|
|
|
|
WRITE_ENABLED_CAP = TRUE
|
|
|
|
WRITE_STATUS = TRUE
|
|
|
|
WRITE_LOCK_CAP = TRUE
|
|
|
|
WRITE_LOCK_STATUS = TRUE
|
|
|
|
READ_DISABLED_CAP = TRUE
|
|
|
|
READ_ENABLED_CAP = TRUE
|
|
|
|
READ_STATUS = TRUE
|
|
|
|
READ_LOCK_CAP = TRUE
|
|
|
|
READ_LOCK_STATUS = TRUE
|
|
|
|
|
2010-06-26 00:23:22 +02:00
|
|
|
FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
|
2011-04-12 17:08:51 +02:00
|
|
|
SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
|
2014-01-21 20:39:13 +01:00
|
|
|
#
|
|
|
|
# These firmware volumes will have files placed in them uncompressed,
|
|
|
|
# and then both firmware volumes will be compressed in a single
|
|
|
|
# compression operation in order to achieve better overall compression.
|
|
|
|
#
|
|
|
|
SECTION FV_IMAGE = PEIFV
|
|
|
|
SECTION FV_IMAGE = DXEFV
|
2011-04-12 17:08:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
OvmfPkg: Sec: assert the build-time calculated end of the scratch buffer
The DecompressMemFvs() function in "OvmfPkg/Sec/SecMain.c" uses more
memory, temporarily, than what PEIFV and DXEFV will ultimately need.
First, it uses an output buffer for decompression, second, the
decompression itself needs a scratch buffer (and this scratch buffer is
the highest area that SEC uses).
DecompressMemFvs() used to be called on normal boots only (ie. not on S3
resume), which is why the decompression output buffer and the scratch
buffer were allowed to scribble over RAM. However, we'll soon start to
worry during S3 resume that the runtime OS might tamper with the
pre-decompressed PEIFV, and we'll decompress the firmware volumes on S3
resume too, from pristine flash. For this we'll need to know the end of
the scratch buffer in advance, so we can prepare a non-malicious OS for
it.
Calculate the end of the scratch buffer statically in the FDF files, and
assert in DecompressMemFvs() that the runtime decompression will match it.
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@19036 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-30 19:41:20 +01:00
|
|
|
!include DecomprScratchEnd.fdf.inc
|
|
|
|
|
2009-05-27 23:10:18 +02:00
|
|
|
################################################################################
|
|
|
|
|
|
|
|
[Rule.Common.SEC]
|
|
|
|
FILE SEC = $(NAMED_GUID) {
|
2010-03-01 07:47:58 +01:00
|
|
|
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
|
2009-05-27 23:10:18 +02:00
|
|
|
UI STRING ="$(MODULE_NAME)" Optional
|
|
|
|
VERSION STRING ="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
|
|
|
|
}
|
|
|
|
|
2010-06-26 00:23:22 +02:00
|
|
|
[Rule.Common.PEI_CORE]
|
|
|
|
FILE PEI_CORE = $(NAMED_GUID) {
|
2015-07-09 10:55:23 +02:00
|
|
|
PE32 PE32 Align=Auto $(INF_OUTPUT)/$(MODULE_NAME).efi
|
2010-06-26 00:23:22 +02:00
|
|
|
UI STRING ="$(MODULE_NAME)" Optional
|
|
|
|
VERSION STRING ="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
|
2009-10-07 18:01:09 +02:00
|
|
|
}
|
|
|
|
|
2009-05-27 23:10:18 +02:00
|
|
|
[Rule.Common.PEIM]
|
|
|
|
FILE PEIM = $(NAMED_GUID) {
|
2010-03-01 07:47:58 +01:00
|
|
|
PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
|
2015-07-09 10:55:23 +02:00
|
|
|
PE32 PE32 Align=Auto $(INF_OUTPUT)/$(MODULE_NAME).efi
|
2009-05-27 23:10:18 +02:00
|
|
|
UI STRING="$(MODULE_NAME)" Optional
|
|
|
|
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
|
|
|
|
}
|
|
|
|
|
|
|
|
[Rule.Common.DXE_CORE]
|
|
|
|
FILE DXE_CORE = $(NAMED_GUID) {
|
2010-03-01 07:47:58 +01:00
|
|
|
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
|
2009-05-27 23:10:18 +02:00
|
|
|
UI STRING="$(MODULE_NAME)" Optional
|
|
|
|
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
|
|
|
|
}
|
|
|
|
|
2010-06-26 00:23:22 +02:00
|
|
|
[Rule.Common.DXE_DRIVER]
|
2009-05-27 23:10:18 +02:00
|
|
|
FILE DRIVER = $(NAMED_GUID) {
|
2010-03-01 07:47:58 +01:00
|
|
|
DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
|
|
|
|
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
|
2009-05-27 23:10:18 +02:00
|
|
|
UI STRING="$(MODULE_NAME)" Optional
|
|
|
|
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
|
2016-04-19 09:17:03 +02:00
|
|
|
RAW ACPI Optional |.acpi
|
|
|
|
RAW ASL Optional |.aml
|
2009-05-27 23:10:18 +02:00
|
|
|
}
|
|
|
|
|
2010-06-26 00:23:22 +02:00
|
|
|
[Rule.Common.DXE_RUNTIME_DRIVER]
|
2009-05-27 23:10:18 +02:00
|
|
|
FILE DRIVER = $(NAMED_GUID) {
|
2010-03-01 07:47:58 +01:00
|
|
|
DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
|
|
|
|
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
|
2009-05-27 23:10:18 +02:00
|
|
|
UI STRING="$(MODULE_NAME)" Optional
|
|
|
|
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
|
|
|
|
}
|
|
|
|
|
2010-06-26 00:23:22 +02:00
|
|
|
[Rule.Common.UEFI_DRIVER]
|
2009-05-27 23:10:18 +02:00
|
|
|
FILE DRIVER = $(NAMED_GUID) {
|
2010-03-01 07:47:58 +01:00
|
|
|
DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
|
|
|
|
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
|
2009-05-27 23:10:18 +02:00
|
|
|
UI STRING="$(MODULE_NAME)" Optional
|
|
|
|
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
|
|
|
|
}
|
|
|
|
|
2010-06-29 06:55:13 +02:00
|
|
|
[Rule.Common.UEFI_DRIVER.BINARY]
|
2010-06-29 20:34:32 +02:00
|
|
|
FILE DRIVER = $(NAMED_GUID) {
|
2010-06-29 06:55:13 +02:00
|
|
|
DXE_DEPEX DXE_DEPEX Optional |.depex
|
|
|
|
PE32 PE32 |.efi
|
|
|
|
UI STRING="$(MODULE_NAME)" Optional
|
|
|
|
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
|
|
|
|
}
|
2012-08-15 02:03:59 +02:00
|
|
|
|
2009-05-27 23:10:18 +02:00
|
|
|
[Rule.Common.UEFI_APPLICATION]
|
|
|
|
FILE APPLICATION = $(NAMED_GUID) {
|
2010-03-01 07:47:58 +01:00
|
|
|
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
|
2009-05-27 23:10:18 +02:00
|
|
|
UI STRING="$(MODULE_NAME)" Optional
|
|
|
|
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
|
|
|
|
}
|
|
|
|
|
2010-06-29 06:55:13 +02:00
|
|
|
[Rule.Common.UEFI_APPLICATION.BINARY]
|
|
|
|
FILE APPLICATION = $(NAMED_GUID) {
|
|
|
|
PE32 PE32 |.efi
|
|
|
|
UI STRING="$(MODULE_NAME)" Optional
|
|
|
|
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
|
|
|
|
}
|
2012-08-15 02:03:59 +02:00
|
|
|
|
2009-08-11 07:30:52 +02:00
|
|
|
[Rule.Common.USER_DEFINED.ACPITABLE]
|
2009-05-27 23:10:18 +02:00
|
|
|
FILE FREEFORM = $(NAMED_GUID) {
|
2009-10-07 18:01:09 +02:00
|
|
|
RAW ACPI |.acpi
|
|
|
|
RAW ASL |.aml
|
2009-05-27 23:10:18 +02:00
|
|
|
}
|
|
|
|
|
2011-11-10 23:04:49 +01:00
|
|
|
[Rule.Common.USER_DEFINED.CSM]
|
|
|
|
FILE FREEFORM = $(NAMED_GUID) {
|
|
|
|
RAW BIN |.bin
|
|
|
|
}
|
|
|
|
|
2010-07-26 20:07:19 +02:00
|
|
|
[Rule.Common.SEC.RESET_VECTOR]
|
|
|
|
FILE RAW = $(NAMED_GUID) {
|
2014-08-19 01:04:00 +02:00
|
|
|
RAW BIN Align = 16 |.bin
|
2010-07-26 20:07:19 +02:00
|
|
|
}
|
2015-11-30 19:41:52 +01:00
|
|
|
|
|
|
|
[Rule.Common.SMM_CORE]
|
|
|
|
FILE SMM_CORE = $(NAMED_GUID) {
|
|
|
|
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
|
|
|
|
UI STRING="$(MODULE_NAME)" Optional
|
|
|
|
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
|
|
|
|
}
|
2015-11-30 19:41:56 +01:00
|
|
|
|
|
|
|
[Rule.Common.DXE_SMM_DRIVER]
|
|
|
|
FILE SMM = $(NAMED_GUID) {
|
|
|
|
SMM_DEPEX SMM_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
|
|
|
|
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
|
|
|
|
UI STRING="$(MODULE_NAME)" Optional
|
|
|
|
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
|
|
|
|
}
|