Commit Graph

32158 Commits

Author SHA1 Message Date
Yuwei Chen 5b5481526f BaseTools: fixing FMMT ShrinkFv issue
1. FvLength not change issue;
2. FileSystemGuid align with File Size;

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2023-12-11 10:12:52 +00:00
Yuwei Chen 59f0d350a9 BaseTools: FMMT support ELF UPLD parser
FMMT add new function to support the .elf file parsing.
Using '-v' option, the UPLD info will be printed out.

'''
- UNIVERSAL_PAYLOAD_INFO
  - 4 bytes align (BOOLEAN)
    - Identifier
    - SpecRevision
    - Attribute
    - Revision
    - Capability
    - ProducerId
    - ImageId
UPLD Buffer
'''

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2023-12-11 10:12:52 +00:00
Yuwei Chen 9627447625 BaseTools: FMMT replace output file is not generated successfully
For replace function, when target Ffs and new ffs are with
same size, the output file can not be generated successfully.
This patch fixes this issue.

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2023-12-11 10:12:52 +00:00
Yuwei Chen b5f5106c1e BaseTools: FMMT replace new free space fixing in replace
In FMMT replace function, when newffs size <= targetffs size,
the new free space is calculated wrong as loss the pad data delta size.
That will cause invalid binary generated.
This patch fixes this issue.

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2023-12-11 10:12:52 +00:00
Nhi Pham bb13a4adab StandaloneMmPkg/StandaloneMmHobLib: Remove HOB creation
According to the discussion in "StandaloneMmPkg: Fix HOB space and
heap space conflicted issue" [1], Standalone MM modules should be HOB
consumers where HOB is read-only. Therefore, this patch removes the
supported functions for HOB creation in the StandaloneMmHobLib.

[1] https://edk2.groups.io/g/devel/message/108333

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Oliver Smith-Denny <osde@linux.microsoft.com>
Signed-off-by: Nhi Pham <nhiphambka@gmail.com>
2023-12-11 03:30:39 +00:00
ManickamX Srinivasan 85a5141a32 MdePkg: Add UEFI v2.10 ISA memory type definition
New memory type as defined in UEFI standard v2.10

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: T V Krishnamoorthy <krishnamoorthy.t.v@intel.com>
Signed-off-by: ManickamX Srinivasan <manickamx.srinivasan@intel.com>
Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-12-09 01:50:07 +00:00
ManickamX Srinivasan 3c40ee8c68 MdePkg: Define the DevicePath argument from LoadImage as optional
Update the EFI LoadImage API in accordance with the
UEFI v2.10 specification.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: T V Krishnamoorthy <krishnamoorthy.t.v@intel.com>
Signed-off-by: ManickamX Srinivasan <manickamx.srinivasan@intel.com>
Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-12-08 22:52:02 +00:00
Laszlo Ersek 2cd9d5f6fa Maintainers.txt: add Aaron Young as MptScsi and PvScsi reviewer
I asked Aaron if he'd be willing to take the "R" role for the MptScsi and
PvScsi drivers in OvmfPkg, given their low maintenance needs and previous
commit 1774a44ad9 ("Maintainers.txt: Remove MptScsi and PvScsi
reviewers", 2022-07-28). Designate Aaron as reviewer for those drivers,
with many thanks.

Cc: Aaron Young <aaron.young@oracle.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231121140145.11151-1-lersek@redhat.com>
Reviewed-by: Aaron Young <aaron.young@oracle.com>
2023-12-08 13:25:11 +00:00
Laszlo Ersek ff22700fc0 Maintainers.txt: add Laszlo Ersek as a UefiCpuPkg maintainer
I intend to assist with the maintenance of the following files and
directories:

  UefiCpuPkg/CpuDxe/
  UefiCpuPkg/CpuIo2Dxe/
  UefiCpuPkg/CpuIo2Smm/CpuIo2Mm.c
  UefiCpuPkg/CpuIo2Smm/CpuIo2Mm.h
  UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c
  UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
  UefiCpuPkg/CpuMpPei/
  UefiCpuPkg/CpuS3DataDxe/
  UefiCpuPkg/Include/AcpiCpuData.h
  UefiCpuPkg/Include/CpuHotPlugData.h
  UefiCpuPkg/Include/Library/CpuPageTableLib.h
  UefiCpuPkg/Include/Library/LocalApicLib.h
  UefiCpuPkg/Include/Library/MmSaveStateLib.h
  UefiCpuPkg/Include/Library/MpInitLib.h
  UefiCpuPkg/Include/Library/SmmCpuFeaturesLib.h
  UefiCpuPkg/Include/Library/SmmCpuPlatformHookLib.h
  UefiCpuPkg/Include/Protocol/SmmCpuService.h
  UefiCpuPkg/Include/Register/
  UefiCpuPkg/Include/StuffRsbNasm.inc
  UefiCpuPkg/Library/BaseXApicX2ApicLib/
  UefiCpuPkg/Library/CpuExceptionHandlerLib/
  UefiCpuPkg/Library/CpuPageTableLib/CpuPageTable.h
  UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
  UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableMap.c
  UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableParse.c
  UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c
  UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf
  UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h
  UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c
  UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
  UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
  UefiCpuPkg/Library/MpInitLib/Ia32/CreatePageTable.c
  UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm
  UefiCpuPkg/Library/MpInitLib/MpEqu.inc
  UefiCpuPkg/Library/MpInitLib/MpHandOff.h
  UefiCpuPkg/Library/MpInitLib/MpLib.c
  UefiCpuPkg/Library/MpInitLib/MpLib.h
  UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
  UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
  UefiCpuPkg/Library/MpInitLib/X64/CreatePageTable.c
  UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm
  UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c
  UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf
  UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/
  UefiCpuPkg/Library/SmmCpuRendezvousLib/
  UefiCpuPkg/PiSmmCpuDxeSmm/
  UefiCpuPkg/UefiCpuPkg.dec
  UefiCpuPkg/UefiCpuPkg.dsc
  UefiCpuPkg/Universal/Acpi/S3Resume2Pei/

Cc: Andrew Fish <afish@apple.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231116215058.8113-4-lersek@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-08 13:25:11 +00:00
Laszlo Ersek 408ca20a95 Maintainers.txt: add Laszlo Ersek as an OvmfPkg maintainer
I intend to assist with the maintenance of the following files and
directories:

  OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c
  OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
  OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
  OvmfPkg/AcpiPlatformDxe/EntryPoint.c
  OvmfPkg/CpuHotplugSmm/
  OvmfPkg/CpuS3DataDxe/
  OvmfPkg/EnrollDefaultKeys/
  OvmfPkg/Fdt/FdtPciHostBridgeLib/
  OvmfPkg/Fdt/FdtPciPcdProducerLib/
  OvmfPkg/Fdt/HighMemDxe/
  OvmfPkg/Fdt/VirtioFdtDxe/
  OvmfPkg/Include/Dsc/NetworkComponents.dsc.inc
  OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc
  OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc
  OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc
  OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc
  OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc
  OvmfPkg/Include/Dsc/OvmfTpmPcds.dsc.inc
  OvmfPkg/Include/Dsc/OvmfTpmPcdsHii.dsc.inc
  OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc
  OvmfPkg/Include/Fdf/FvmainCompactScratchEnd.fdf.inc
  OvmfPkg/Include/Fdf/OvmfPkgDefines.fdf.inc
  OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc
  OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc
  OvmfPkg/Include/Fdf/VarStore.fdf.inc
  OvmfPkg/Include/Guid/MicrosoftVendor.h
  OvmfPkg/Include/Guid/OvmfPkKek1AppPrefix.h
  OvmfPkg/Include/Guid/OvmfPlatformConfig.h
  OvmfPkg/Include/Guid/QemuKernelLoaderFsMedia.h
  OvmfPkg/Include/Guid/QemuRamfb.h
  OvmfPkg/Include/Guid/RootBridgesConnectedEventGroup.h
  OvmfPkg/Include/Guid/VirtioMmioTransport.h
  OvmfPkg/Include/IndustryStandard/E820.h
  OvmfPkg/Include/IndustryStandard/I440FxPiix4.h
  OvmfPkg/Include/IndustryStandard/LegacyVgaBios.h
  OvmfPkg/Include/IndustryStandard/LinuxBzimage.h
  OvmfPkg/Include/IndustryStandard/Q35MchIch9.h
  OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h
  OvmfPkg/Include/IndustryStandard/QemuFwCfg.h
  OvmfPkg/Include/IndustryStandard/QemuLoader.h
  OvmfPkg/Include/IndustryStandard/QemuPciBridgeCapabilities.h
  OvmfPkg/Include/IndustryStandard/QemuTpm.h
  OvmfPkg/Include/IndustryStandard/Virtio.h
  OvmfPkg/Include/IndustryStandard/Virtio095.h
  OvmfPkg/Include/IndustryStandard/Virtio095Net.h
  OvmfPkg/Include/IndustryStandard/Virtio10.h
  OvmfPkg/Include/IndustryStandard/Virtio10Net.h
  OvmfPkg/Include/IndustryStandard/VirtioBlk.h
  OvmfPkg/Include/IndustryStandard/VirtioFs.h
  OvmfPkg/Include/IndustryStandard/VirtioGpu.h
  OvmfPkg/Include/IndustryStandard/VirtioNet.h
  OvmfPkg/Include/IndustryStandard/VirtioScsi.h
  OvmfPkg/Include/IndustryStandard/VirtioSerial.h
  OvmfPkg/Include/Library/AcpiPlatformLib.h
  OvmfPkg/Include/Library/NestedInterruptTplLib.h
  OvmfPkg/Include/Library/PciCapLib.h
  OvmfPkg/Include/Library/PciCapPciIoLib.h
  OvmfPkg/Include/Library/PciCapPciSegmentLib.h
  OvmfPkg/Include/Library/PciHostBridgeUtilityLib.h
  OvmfPkg/Include/Library/PlatformBmPrintScLib.h
  OvmfPkg/Include/Library/PlatformInitLib.h
  OvmfPkg/Include/Library/QemuBootOrderLib.h
  OvmfPkg/Include/Library/QemuFwCfgLib.h
  OvmfPkg/Include/Library/QemuFwCfgS3Lib.h
  OvmfPkg/Include/Library/QemuFwCfgSimpleParserLib.h
  OvmfPkg/Include/Library/QemuLoadImageLib.h
  OvmfPkg/Include/Library/VirtNorFlashPlatformLib.h
  OvmfPkg/Include/Library/VirtioLib.h
  OvmfPkg/Include/Library/VirtioMmioDeviceLib.h
  OvmfPkg/Include/OvmfPlatforms.h
  OvmfPkg/Include/Pcd/CpuHotEjectData.h
  OvmfPkg/Include/Protocol/OvmfLoadedX86LinuxKernel.h
  OvmfPkg/Include/Protocol/VirtioDevice.h
  OvmfPkg/IncompatiblePciDeviceSupportDxe/
  OvmfPkg/Library/AcpiPlatformLib/
  OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c
  OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.h
  OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c
  OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf
  OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c
  OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.inf
  OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c
  OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf
  OvmfPkg/Library/BaseCachingPciExpressLib/
  OvmfPkg/Library/BasePciCapLib/
  OvmfPkg/Library/BasePciCapPciSegmentLib/
  OvmfPkg/Library/DxePciLibI440FxQ35/
  OvmfPkg/Library/GenericQemuLoadImageLib/
  OvmfPkg/Library/LockBoxLib/
  OvmfPkg/Library/NestedInterruptTplLib/
  OvmfPkg/Library/PciHostBridgeLib/
  OvmfPkg/Library/PciHostBridgeUtilityLib/
  OvmfPkg/Library/PlatformBmPrintScLib/
  OvmfPkg/Library/PlatformBootManagerLib/
  OvmfPkg/Library/PlatformDebugLibIoPort/DebugIoPortQemu.c
  OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
  OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.c
  OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.h
  OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetectRom.c
  OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
  OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf
  OvmfPkg/Library/PlatformInitLib/Cmos.c
  OvmfPkg/Library/PlatformInitLib/MemDetect.c
  OvmfPkg/Library/PlatformInitLib/Platform.c
  OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf
  OvmfPkg/Library/PlatformSecureLib/
  OvmfPkg/Library/PxeBcPcdProducerLib/
  OvmfPkg/Library/QemuBootOrderLib/
  OvmfPkg/Library/QemuFwCfgLib/
  OvmfPkg/Library/QemuFwCfgS3Lib/
  OvmfPkg/Library/QemuFwCfgSimpleParserLib/
  OvmfPkg/Library/ResetSystemLib/BaseResetShutdown.c
  OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf
  OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c
  OvmfPkg/Library/ResetSystemLib/DxeResetSystemLib.inf
  OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
  OvmfPkg/Library/SmbiosVersionLib/
  OvmfPkg/Library/SmmCpuFeaturesLib/
  OvmfPkg/Library/SmmCpuPlatformHookLibQemu/
  OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/
  OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/
  OvmfPkg/Library/TlsAuthConfigLib/
  OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/
  OvmfPkg/Library/UefiPciCapPciIoLib/
  OvmfPkg/Library/VirtioLib/
  OvmfPkg/Library/VirtioMmioDeviceLib/
  OvmfPkg/Library/X86QemuLoadImageLib/
  OvmfPkg/License.txt
  OvmfPkg/LinuxInitrdDynamicShellCommand/
  OvmfPkg/LocalApicTimerDxe/
  OvmfPkg/OvmfPkg.ci.yaml
  OvmfPkg/OvmfPkg.dec
  OvmfPkg/OvmfPkgIa32.dsc
  OvmfPkg/OvmfPkgIa32.fdf
  OvmfPkg/OvmfPkgIa32X64.dsc
  OvmfPkg/OvmfPkgIa32X64.fdf
  OvmfPkg/OvmfPkgX64.dsc
  OvmfPkg/OvmfPkgX64.fdf
  OvmfPkg/PciHotPlugInitDxe/
  OvmfPkg/PlatformCI/
  OvmfPkg/PlatformDxe/
  OvmfPkg/PlatformHasAcpiDtDxe/
  OvmfPkg/PlatformPei/ClearCache.c
  OvmfPkg/PlatformPei/FeatureControl.c
  OvmfPkg/PlatformPei/Fv.c
  OvmfPkg/PlatformPei/MemDetect.c
  OvmfPkg/PlatformPei/MemTypeInfo.c
  OvmfPkg/PlatformPei/Platform.c
  OvmfPkg/PlatformPei/Platform.h
  OvmfPkg/PlatformPei/PlatformPei.inf
  OvmfPkg/QemuFlashFvbServicesRuntimeDxe/
  OvmfPkg/QemuKernelLoaderFsDxe/
  OvmfPkg/QemuRamfbDxe/
  OvmfPkg/QemuVideoDxe/
  OvmfPkg/README
  OvmfPkg/Sec/Ia32/SecEntry.nasm
  OvmfPkg/Sec/SecMain.c
  OvmfPkg/Sec/SecMain.inf
  OvmfPkg/Sec/X64/SecEntry.nasm
  OvmfPkg/SioBusDxe/
  OvmfPkg/SmbiosPlatformDxe/EntryPoint.c
  OvmfPkg/SmbiosPlatformDxe/Qemu.c
  OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c
  OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h
  OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
  OvmfPkg/SmmAccess/
  OvmfPkg/SmmControl2Dxe/
  OvmfPkg/Tcg/Tcg2Config/
  OvmfPkg/VirtNorFlashDxe/
  OvmfPkg/Virtio10Dxe/
  OvmfPkg/VirtioBlkDxe/
  OvmfPkg/VirtioFsDxe/
  OvmfPkg/VirtioGpuDxe/
  OvmfPkg/VirtioNetDxe/
  OvmfPkg/VirtioPciDeviceDxe/
  OvmfPkg/VirtioRngDxe/
  OvmfPkg/VirtioScsiDxe/

Cc: Andrew Fish <afish@apple.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231116215058.8113-3-lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-08 13:25:11 +00:00
Laszlo Ersek b59574a066 Maintainers.txt: add Laszlo Ersek as an ArmVirtPkg maintainer
I intend to assist with the maintenance of the following files and
directories:

  ArmVirtPkg/ArmVirt.dsc.inc
  ArmVirtPkg/ArmVirtPkg.dec
  ArmVirtPkg/ArmVirtQemu.dsc
  ArmVirtPkg/ArmVirtQemu.fdf
  ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
  ArmVirtPkg/ArmVirtRules.fdf.inc
  ArmVirtPkg/Include/Guid/EarlyPL011BaseAddress.h
  ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h
  ArmVirtPkg/Include/Library/FdtSerialPortAddressLib.h
  ArmVirtPkg/Library/ArmVirtDxeHobLib/
  ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/
  ArmVirtPkg/Library/ArmVirtPL031FdtClientLib/
  ArmVirtPkg/Library/ArmVirtPsciResetSystemLib/
  ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/
  ArmVirtPkg/Library/ArmVirtTimerFdtClientLib/
  ArmVirtPkg/Library/DebugLibFdtPL011Uart/
  ArmVirtPkg/Library/FdtPL011SerialPortLib/
  ArmVirtPkg/Library/FdtSerialPortAddressLib/
  ArmVirtPkg/Library/NorFlashQemuLib/
  ArmVirtPkg/Library/PlatformBootManagerLib/
  ArmVirtPkg/Library/PlatformPeiLib/
  ArmVirtPkg/Library/QemuVirtMemInfoLib/
  ArmVirtPkg/MemoryInitPei/
  ArmVirtPkg/PlatformCI/
  ArmVirtPkg/PrePi/
  ArmVirtPkg/VarStore.fdf.inc

Cc: Andrew Fish <afish@apple.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231116215058.8113-2-lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-08 13:25:11 +00:00
Michael Roth e8c23d1e27 OvmfPkg/MemEncryptSevLib: Fix address overflow during PVALIDATE
The struct used for GHCB-based page-state change requests uses a 40-bit
bit-field for the GFN, which is shifted by PAGE_SHIFT to generate a
64-bit address. However, anything beyond 40-bits simply gets shifted off
when doing this, which will cause issues when dealing with 1TB+
addresses. Fix this by casting the 40-bit GFN values to 64-bit ones
prior to shifting it by PAGE_SHIFT.

Fixes: ade62c18f4 ("OvmfPkg/MemEncryptSevLib: add support to validate system RAM")
Signed-off-by: Michael Roth <michael.roth@amd.com>
Message-Id: <20231115175153.813213-1-michael.roth@amd.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-08 13:25:11 +00:00
Wu, Jiaxin 7eb5040607 UefiCpuPkg/PiSmmCpuDxeSmm: Get processor extended information
This patch is to extend SmmAddProcessor function to get processor
extended information. It's to complete commit 1fadd18d.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231115111553.6592-3-jiaxin.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2023-12-08 13:25:11 +00:00
Wu, Jiaxin ad0b1cc144 UefiCpuPkg/BaseXApicLib: Fix CPUID_V2_EXTENDED_TOPOLOGY detection
This patch is to complete 170d4ce8, sync the change to BaseXApicLib.

Checking the max cpuid leaf is not enough to figure whenever
CPUID_V2_EXTENDED_TOPOLOGY is supported.  Intel SDM says:

Software must detect the presence of CPUID leaf 1FH by verifying
(a) the highest leaf index supported by CPUID is >= 1FH, and
(b) CPUID.1FH:EBX[15:0] reports a non-zero value.

The same is true for CPUID leaf 0BH.

This patch adds the EBX check to GetProcessorLocation2ByApicId().  The
patch also fixes the existing check in GetProcessorLocationByApicId() to
be in line with the spec by looking at bits 15:0.  The comments are
updated with a quote from the Intel SDM.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Message-Id: <20231115111553.6592-2-jiaxin.wu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
2023-12-08 13:25:11 +00:00
Page Chen fe2abc9b74 ShellPkg: Fix typos
begining->beginning
dirve->drive
duplicat->duplicate
fuly->fully
Funciton->Function
Functino->Function
optioanl->optional
poitners->pointers
rountine->routine
sucessful->successful
sucessfully->successfully

Signed-off-by: Page Chen <paiching_chen@apple.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Andrew Fish <afish@apple.com>
Message-Id: <829d2bed2a848229d719d7ae7b64ef1a47782720.1699557986.git.paiching_chen@apple.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
2023-12-08 13:25:11 +00:00
Laszlo Ersek eccdab611c OvmfPkg: remove CSM_ENABLE build macro
At this point, the CSM_ENABLE conditionals only bracket the !error
directives that we added at the front of this series; it's time to remove
CSM_ENABLE.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Corvin Köhne <corvink@freebsd.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-38-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 605248f0fd OvmfPkg: remove Pcd8259LegacyModeEdgeLevel and Pcd8259LegacyModeMask
The following PCDs are unused at this point; remove them:

- Pcd8259LegacyModeEdgeLevel
- Pcd8259LegacyModeMask

This shrinks the list of resources scheduled for removal to nil.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael Roth <michael.roth@amd.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-37-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek cf9030f69f OvmfPkg: remove gEfiLegacy8259ProtocolGuid
At this point, gEfiLegacy8259ProtocolGuid is unused; remove it.

This shrinks the list of resources scheduled for removal to:

- PCDs:
  - Pcd8259LegacyModeEdgeLevel
  - Pcd8259LegacyModeMask

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-36-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 67864ffd52 OvmfPkg: remove 8259InterruptControllerDxe
8259InterruptControllerDxe is not used by any platforms at this point,
remove it.

This patch removes mentions of the following CSM resources from the source
code:

- GUIDs (protocols or otherwise):
  - gEfiLegacy8259ProtocolGuid

- headers:
  - Protocol/Legacy8259.h

- PCDs:
  - Pcd8259LegacyModeEdgeLevel
  - Pcd8259LegacyModeMask

which extends the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiLegacy8259ProtocolGuid

- headers:
  - Protocol/Legacy8259.h

- PCDs:
  - Pcd8259LegacyModeEdgeLevel
  - Pcd8259LegacyModeMask

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-35-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek fb5c153abd OvmfPkg: exclude 8259InterruptControllerDxe
With 8254TimerDxe gone, no module in OVMF consumes
gEfiLegacy8259ProtocolGuid; exclude 8259InterruptControllerDxe therefore.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-34-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 05cffb6637 OvmfPkg: remove 8254TimerDxe
8254TimerDxe is not used by any platforms at this point, remove it.

This patch removes mentions of the following CSM resources from the source
code:

- GUIDs (protocols or otherwise):
  - gEfiLegacy8259ProtocolGuid

- headers:
  - Protocol/Legacy8259.h

which extends the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiLegacy8259ProtocolGuid

- headers:
  - Protocol/Legacy8259.h

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-33-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 89bd992b1f OvmfPkg: exclude 8254TimerDxe
In the original three OVMF platforms, CSM_ENABLE selects the legacy timer
driver; exclude it. Instead, include LocalApicTimerDxe unconditionally
(which in turn consumes PcdFSBClock).

Background: commits c37cbc030d ("OvmfPkg: Switch timer in build time for
OvmfPkg", 2022-04-02) and 07c0c2eb0a ("OvmfPkg: fix PcdFSBClock",
2022-05-25).

Regression test: verified that the BDS progress bar still advanced at
normal speed in each platform.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-32-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 0e0a0a5ee8 OvmfPkg: remove Csm16
Csm16 is not used by any platform at this point, remove it.

This shrinks the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiLegacy8259ProtocolGuid

- headers:
  - Protocol/Legacy8259.h

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-31-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 528ae029ad OvmfPkg: remove Rule.Common.USER_DEFINED.CSM from all FDF files
We no longer have

  INF  RuleOverride=CSM OvmfPkg/Csm/Csm16/Csm16.inf

lines in any of the OVMF platform FDF files; remove the CSM rules
themselves.

(Note that some of the more recent platforms had cargo-culted this rule
from the original ones, without ever referencing the rule with
RuleOverride=CSM. Remove those rules as well.)

Cc: Anatol Belski <anbelski@linux.microsoft.com>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Corvin Köhne <corvink@freebsd.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jianyong Wu <jianyong.wu@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-30-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek e8f860d924 OvmfPkg: exclude Csm16.inf / Csm16.bin
The Csm16 module wraps the CONFIG_CSM build of SeaBIOS. "Csm16.inf" has
FILE_GUID 1547B4F3-3E8A-4FEF-81C8-328ED647AB1A, which was previously
referenced by the (now removed) CsmSupportLib, under the name
SYSTEM_ROM_FILE_GUID.

Nothing relies on the SeaBIOS binary any longer, so exclude the Csm16
module from all OVMF platforms.

(Note that the "OvmfPkg/Bhyve/Csm/BhyveCsm16/BhyveCsm16.inf" pathname that
the BhyveX64 platform refers to is bogus anyway.)

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Corvin Köhne <corvink@freebsd.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-29-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 769c46a9a2 OvmfPkg: remove <FrameworkDxe.h>
The <FrameworkDxe.h> header is not used by any source file at this point,
remove it.

<FrameworkDxe.h> is a thin wrapper for including all header files under
the "OvmfPkg/Csm/Include/Framework" directory. Remove that directory at
the same time (nothing else references contents in that directory
directly).

Consequently, the "OvmfPkg/Csm/Include" directory becomes empty, and git
automatically deletes it; remove that include path from
"OvmfPkg/OvmfPkg.dec".

This shrinks the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - SYSTEM_ROM_FILE_GUID (1547B4F3-3E8A-4FEF-81C8-328ED647AB1A)
  - gEfiLegacy8259ProtocolGuid

- headers:
  - Protocol/Legacy8259.h

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-28-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek f14317e9ba OvmfPkg: remove gEfiLegacyInterruptProtocolGuid
At this point, gEfiLegacyInterruptProtocolGuid is unused; remove it.

This shrinks the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - SYSTEM_ROM_FILE_GUID (1547B4F3-3E8A-4FEF-81C8-328ED647AB1A)
  - gEfiLegacy8259ProtocolGuid

- headers:
  - FrameworkDxe.h
  - Protocol/Legacy8259.h

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-27-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 504a0fed85 OvmfPkg: remove gEfiLegacyBiosProtocolGuid
At this point, gEfiLegacyBiosProtocolGuid is unused; remove it.

This shrinks the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - SYSTEM_ROM_FILE_GUID (1547B4F3-3E8A-4FEF-81C8-328ED647AB1A)
  - gEfiLegacy8259ProtocolGuid
  - gEfiLegacyInterruptProtocolGuid

- headers:
  - FrameworkDxe.h
  - Protocol/Legacy8259.h
  - Protocol/LegacyInterrupt.h

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-26-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek dd63cb95af OvmfPkg: remove gEfiLegacyBiosPlatformProtocolGuid
At this point, gEfiLegacyBiosPlatformProtocolGuid is unused; remove it.

This shrinks the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - SYSTEM_ROM_FILE_GUID (1547B4F3-3E8A-4FEF-81C8-328ED647AB1A)
  - gEfiLegacy8259ProtocolGuid
  - gEfiLegacyBiosProtocolGuid
  - gEfiLegacyInterruptProtocolGuid

- headers:
  - FrameworkDxe.h
  - Protocol/Legacy8259.h
  - Protocol/LegacyBios.h
  - Protocol/LegacyInterrupt.h

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-25-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek f19b3d0cdc OvmfPkg: remove gEfiFirmwareVolumeProtocolGuid
At this point, gEfiFirmwareVolumeProtocolGuid is unused; remove it.

This shrinks the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - SYSTEM_ROM_FILE_GUID (1547B4F3-3E8A-4FEF-81C8-328ED647AB1A)
  - gEfiLegacy8259ProtocolGuid
  - gEfiLegacyBiosPlatformProtocolGuid
  - gEfiLegacyBiosProtocolGuid
  - gEfiLegacyInterruptProtocolGuid

- headers:
  - FrameworkDxe.h
  - Protocol/Legacy8259.h
  - Protocol/LegacyBios.h
  - Protocol/LegacyBiosPlatform.h
  - Protocol/LegacyInterrupt.h

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-24-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek bc495d89d4 OvmfPkg: remove CsmSupportLib
CsmSupportLib is not used by any platform at this point, remove it.

This patch removes mentions of the following CSM resources from the source
code [*]:

- GUIDs (protocols or otherwise):
  - SYSTEM_ROM_FILE_GUID (1547B4F3-3E8A-4FEF-81C8-328ED647AB1A)
  - gEfiFirmwareVolumeProtocolGuid (by cutting the
    <Protocol/FirmwareVolume.h> link)
  - gEfiLegacyBiosPlatformProtocolGuid
  - gEfiLegacyBiosProtocolGuid
  - gEfiLegacyInterruptProtocolGuid

- headers:
  - FrameworkDxe.h
  - Protocol/FirmwareVolume.h
  - Protocol/LegacyBiosPlatform.h
  - Protocol/LegacyInterrupt.h

which extends the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - SYSTEM_ROM_FILE_GUID (1547B4F3-3E8A-4FEF-81C8-328ED647AB1A)
  - gEfiFirmwareVolumeProtocolGuid
  - gEfiLegacy8259ProtocolGuid
  - gEfiLegacyBiosPlatformProtocolGuid
  - gEfiLegacyBiosProtocolGuid
  - gEfiLegacyInterruptProtocolGuid

- headers:
  - FrameworkDxe.h
  - Protocol/FirmwareVolume.h
  - Protocol/Legacy8259.h
  - Protocol/LegacyBios.h
  - Protocol/LegacyBiosPlatform.h
  - Protocol/LegacyInterrupt.h

[*] Note that gEfiLegacyRegion2ProtocolGuid, while a CSM-related protocol,
cannot be scheduled for removal, because the protocol GUID is defined in
"MdePkg.dec", and it's not only "OvmfPkg/Csm/CsmSupportLib" that produces
it in all of edk2, but also "MdeModulePkg/Universal/LegacyRegion2Dxe" (not
used by OVMF). For the same reason, the "Protocol/LegacyRegion2.h" header
(from MdePkg) cannot be scheduled for removal.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-23-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 86cc0f15d9 OvmfPkg: unplug CsmSupportLib from BdsDxe
CsmSupportLib is effectively a hack. It produces the following protocols:

- Legacy Bios Platform,
- Legacy Interrupt,
- Legacy Region2.

(Note that the "OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf" file contains
an error where it claims that "Legacy Bios Platform" is "consumed" -- it
is not; the lib instance produces that protocol).

At the same time, the library instance consumes
gEfiLegacyBiosProtocolGuid.

This *seemingly* creates a circular dependency with LegacyBiosDxe, because
that driver has the exact opposite protocol usage patterns. The solution
is that LegacyBiosDxe has a DEPEX on the protocols produced by
CsmSupportLib, while CsmSupportLib consumes the Legacy Bios Protocol from
LegacyBiosDxe only in the member functions of the protocols it produces.
Therefore, once BdsDxe is dispatched, and the CsmSupportLib constructor
exposes those three protocols, LegacyBiosDxe can also be started by the
DXE dispatcher, and then the protocols from CsmSupportLib become
functional.

But the main reason why CsmSupportLib is a hack is that it should be a
normal platform DXE driver (called e.g. "CsmSupportDxe"), and not a NULL
class library that's randomly hooked into BdsDxe.

Given that we have removed LegacyBiosDxe earlier (so there is no DEPEX we
need to satisfy now, conceptually), unhook CsmSupportLib from BdsDxe.

--*--

Note that in the BhyveX64 platform, the pathname
"OvmfPkg/Bhyve/Csm/CsmSupportLib/CsmSupportLib.inf" is bogus, and has
always been, since commit 656419f922 ("Add BhyvePkg, to support the
bhyve hypervisor", 2020-07-31).

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Corvin Köhne <corvink@freebsd.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-22-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 8bd14e685e OvmfPkg: remove LegacyBiosDxe PCDs
The following PCDs are unused at this point; remove them:

- PcdEbdaReservedMemorySize
- PcdEndOpromShadowAddress
- PcdHighPmmMemorySize
- PcdLegacyBiosCacheLegacyRegion
- PcdLowPmmMemorySize
- PcdOpromReservedMemoryBase
- PcdOpromReservedMemorySize

This shrinks the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiLegacy8259ProtocolGuid
  - gEfiLegacyBiosPlatformProtocolGuid
  - gEfiLegacyBiosProtocolGuid
  - gEfiLegacyInterruptProtocolGuid

- headers:
  - FrameworkDxe.h
  - Protocol/Legacy8259.h
  - Protocol/LegacyBios.h
  - Protocol/LegacyBiosPlatform.h
  - Protocol/LegacyInterrupt.h

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-21-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 9d4becddba OvmfPkg: remove gEfiLegacyBiosGuid
At this point, gEfiLegacyBiosGuid is unused; remove it.

This shrinks the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiLegacy8259ProtocolGuid
  - gEfiLegacyBiosPlatformProtocolGuid
  - gEfiLegacyBiosProtocolGuid
  - gEfiLegacyInterruptProtocolGuid

- headers:
  - FrameworkDxe.h
  - Protocol/Legacy8259.h
  - Protocol/LegacyBios.h
  - Protocol/LegacyBiosPlatform.h
  - Protocol/LegacyInterrupt.h

- PCDs:
  - PcdEbdaReservedMemorySize
  - PcdEndOpromShadowAddress
  - PcdHighPmmMemorySize
  - PcdLegacyBiosCacheLegacyRegion
  - PcdLowPmmMemorySize
  - PcdOpromReservedMemoryBase
  - PcdOpromReservedMemorySize

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-20-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 5161ba8ea0 OvmfPkg: remove gEfiIsaAcpiProtocolGuid
At this point, gEfiIsaAcpiProtocolGuid is unused; remove it.

This shrinks the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiLegacy8259ProtocolGuid
  - gEfiLegacyBiosGuid
  - gEfiLegacyBiosPlatformProtocolGuid
  - gEfiLegacyBiosProtocolGuid
  - gEfiLegacyInterruptProtocolGuid

- headers:
  - FrameworkDxe.h
  - Guid/LegacyBios.h
  - Protocol/Legacy8259.h
  - Protocol/LegacyBios.h
  - Protocol/LegacyBiosPlatform.h
  - Protocol/LegacyInterrupt.h

- PCDs:
  - PcdEbdaReservedMemorySize
  - PcdEndOpromShadowAddress
  - PcdHighPmmMemorySize
  - PcdLegacyBiosCacheLegacyRegion
  - PcdLowPmmMemorySize
  - PcdOpromReservedMemoryBase
  - PcdOpromReservedMemorySize

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-19-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 0730f564ad OvmfPkg: remove gEfiIsaIoProtocolGuid
At this point, gEfiIsaIoProtocolGuid is unused; remove it.

Recursively, this patch removes mentions of the following further CSM
resources from the source code:

- GUIDs (protocols or otherwise):
  - gEfiIsaAcpiProtocolGuid (by cutting the <Protocol/IsaAcpi.h> link)

- headers:
  - Protocol/IsaAcpi.h

This changes the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiIsaAcpiProtocolGuid
  - gEfiLegacy8259ProtocolGuid
  - gEfiLegacyBiosGuid
  - gEfiLegacyBiosPlatformProtocolGuid
  - gEfiLegacyBiosProtocolGuid
  - gEfiLegacyInterruptProtocolGuid

- headers:
  - FrameworkDxe.h
  - Guid/LegacyBios.h
  - Protocol/IsaAcpi.h
  - Protocol/Legacy8259.h
  - Protocol/LegacyBios.h
  - Protocol/LegacyBiosPlatform.h
  - Protocol/LegacyInterrupt.h

- PCDs:
  - PcdEbdaReservedMemorySize
  - PcdEndOpromShadowAddress
  - PcdHighPmmMemorySize
  - PcdLegacyBiosCacheLegacyRegion
  - PcdLowPmmMemorySize
  - PcdOpromReservedMemoryBase
  - PcdOpromReservedMemorySize

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-18-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek d7e41ce340 OvmfPkg: exclude NullMemoryTestDxe driver
NullMemoryTestDxe was included in the OVMF platforms in historical commit
999a815e9f ("OvmfPkg: Add NullMemoryTestDxe driver", 2011-01-21). It
produces gEfiGenericMemTestProtocolGuid. With LegacyBiosDxe gone, the only
consumer of this protocol in all of edk2 is
"EmulatorPkg/Library/PlatformBmLib/PlatformBmMemoryTest.c". Thus, exclude
NullMemoryTestDxe from all OVMF platforms.

(Notably, ArmVirtPkg platforms don't include NullMemoryTestDxe either.)

Cc: Anatol Belski <anbelski@linux.microsoft.com>
Cc: Andrei Warkentin <andrei.warkentin@intel.com>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Corvin Köhne <corvink@freebsd.org>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jianyong Wu <jianyong.wu@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael Roth <michael.roth@amd.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-17-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek f0c5d652d9 OvmfPkg: remove LegacyBiosDxe
LegacyBiosDxe is not used by any platform at this point, remove it.

This patch removes mentions of the following CSM resources from the source
code [*] [**]:

- GUIDs (protocols or otherwise):
  - gEfiIsaIoProtocolGuid
  - gEfiLegacy8259ProtocolGuid
  - gEfiLegacyBiosGuid
  - gEfiLegacyBiosPlatformProtocolGuid
  - gEfiLegacyBiosProtocolGuid
  - gEfiLegacyInterruptProtocolGuid

- headers:
  - FrameworkDxe.h
  - Guid/LegacyBios.h
  - Protocol/IsaIo.h
  - Protocol/Legacy8259.h
  - Protocol/LegacyBios.h
  - Protocol/LegacyBiosPlatform.h
  - Protocol/LegacyInterrupt.h

- PCDs:
  - PcdEbdaReservedMemorySize
  - PcdEndOpromShadowAddress
  - PcdHighPmmMemorySize
  - PcdLegacyBiosCacheLegacyRegion
  - PcdLowPmmMemorySize
  - PcdOpromReservedMemoryBase
  - PcdOpromReservedMemorySize

which extends the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiIsaIoProtocolGuid
  - gEfiLegacy8259ProtocolGuid
  - gEfiLegacyBiosGuid
  - gEfiLegacyBiosPlatformProtocolGuid
  - gEfiLegacyBiosProtocolGuid
  - gEfiLegacyInterruptProtocolGuid

- headers:
  - FrameworkDxe.h
  - Guid/LegacyBios.h
  - Protocol/IsaIo.h
  - Protocol/Legacy8259.h
  - Protocol/LegacyBios.h
  - Protocol/LegacyBiosPlatform.h
  - Protocol/LegacyInterrupt.h

- PCDs:
  - PcdEbdaReservedMemorySize
  - PcdEndOpromShadowAddress
  - PcdHighPmmMemorySize
  - PcdLegacyBiosCacheLegacyRegion
  - PcdLowPmmMemorySize
  - PcdOpromReservedMemoryBase
  - PcdOpromReservedMemorySize

[*] Note that gEfiGenericMemTestProtocolGuid, while not a CSM-related
protocol, also becomes useless in the OVMF platforms, so we'll deal with
that later in the series as well.

[**] Note that gEfiLegacyRegion2ProtocolGuid, while a CSM-related
protocol, cannot be scheduled for removal, because the protocol GUID is
defined in "MdePkg.dec", and it's not only "OvmfPkg/Csm/CsmSupportLib"
that produces it in all of edk2, but also
"MdeModulePkg/Universal/LegacyRegion2Dxe" (not used by OVMF). For the same
reason, the "Protocol/LegacyRegion2.h" header (from MdePkg) cannot be
scheduled for removal.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-16-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 209480b047 Revert "OvmfPkg: don't assign PCI BARs above 4GiB when CSM enabled"
This reverts commit c7341877f6.

That commit was a later (2019-06-26), heavier weight exclusion of 64-bit
BARs when a CSM was included, and is similarly superfluous now, so revert
it.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-15-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 87d0e572c8 OvmfPkg/IncompatiblePciDeviceSupportDxe: ignore CSM presence
The UEFI protocol database cannot contain gEfiLegacyBiosProtocolGuid any
longer, after excluding LegacyBiosDxe from the OVMF platforms. Therefore,
instruct PciBusDxe from IncompatiblePciDeviceSupportDxe to allocate 64-bit
BARs above 4 GB regardless of a CSM.

Regression test: in commit 855743f717 ("OvmfPkg: prevent 64-bit MMIO BAR
degradation if there is no CSM", 2016-05-25), where we introduced
IncompatiblePciDeviceSupportDxe, we said, "By default, the PCI Bus driver
considers an option ROM reason enough for allocating the 64-bit MMIO BARs
in 32-bit address space". Therefore it suffices to verify the 64-bit BARs
of a device for which QEMU provides an option ROM. The simplest case is
the virtio-net-pci device. And indeed, with this patch applied, the log
contains:

> PciBus: Discovered PCI @ [04|00|00]  [VID = 0x1AF4, DID = 0x1041]
>    BAR[1]: Type =  Mem32; Alignment = 0xFFF;    Length = 0x1000;        Offset = 0x14
>    BAR[4]: Type = PMem64; Alignment = 0x3FFF;   Length = 0x4000;        Offset = 0x20

This portion shows that Bus|Device|Function 04|00|00 is a (modern)
virito-net-pci device [VID = 0x1AF4, DID = 0x1041].

> PciBus: Resource Map for Bridge [00|01|03]
> Type =  Mem32; Base = 0x81200000;       Length = 0x200000;      Alignment = 0x1FFFFF
>    Base = Padding;      Length = 0x200000;      Alignment = 0x1FFFFF
>    Base = 0x81200000;   Length = 0x1000;        Alignment = 0xFFF;      Owner = PCI [04|00|00:14]
> Type =  Mem32; Base = 0x81A43000;       Length = 0x1000;        Alignment = 0xFFF
> Type = PMem64; Base = 0x800200000;      Length = 0x100000;      Alignment = 0xFFFFF
>    Base = 0x800200000;  Length = 0x4000;        Alignment = 0x3FFF;     Owner = PCI [04|00|00:20]

This quote shows that 04|00|00 has a BAR at 0x8_0020_0000.

(It also shows that the device is behind a bridge (PCIe root port) whose
own BDF is 00|01|03.)

> [Security] 3rd party image[7CEEB418] can be loaded after EndOfDxe: PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x0)/Offset(0x10E00,0x273FF).
> None of Tcg2Protocol/CcMeasurementProtocol is installed.
> InstallProtocolInterface: [EfiLoadedImageProtocol] 7D2E5140
> Loading driver at 0x0007CA9F000 EntryPoint=0x0007CAA5447 1af41000.efi
> InstallProtocolInterface: [EfiLoadedImageDevicePathProtocol] 7D5B2198

And this part finally shows that the iPXE option ROM for the device
(1af41000.efi) was detected and is loaded. (Same PCIe root port, and PCIe
root ports can only host a single device.)

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-14-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 934b7f5a73 OvmfPkg: exclude LegacyBiosDxe
LegacyBiosDxe is the core CSM driver. It procudes
gEfiLegacyBiosProtocolGuid, on top of several smaller, more foundational
legacy BIOS protocols, whose drivers we've not excluded yet. In the course
of tearing down CSM support in (reverse) dependency order, exclude
LegacyBiosDxe at this point.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Corvin Köhne <corvink@freebsd.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-13-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek ec60da4232 OvmfPkg: remove Bios Video PCDs
PcdBiosVideoSetTextVgaModeEnable, PcdBiosVideoCheckVbeEnable and
PcdBiosVideoCheckVgaEnable are unused at this point, remove them.

This shrinks the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiLegacyBiosGuid
  - gEfiLegacyBiosProtocolGuid

- headers:
  - FrameworkDxe.h
  - Guid/LegacyBios.h
  - Protocol/LegacyBios.h

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-12-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 4493d74e18 OvmfPkg: remove gEfiVgaMiniPortProtocolGuid
At this point, gEfiVgaMiniPortProtocolGuid is unused; remove it.

This shrinks the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiLegacyBiosGuid
  - gEfiLegacyBiosProtocolGuid

- headers:
  - FrameworkDxe.h
  - Guid/LegacyBios.h
  - Protocol/LegacyBios.h

- PCDs:
  - PcdBiosVideoCheckVbeEnable
  - PcdBiosVideoCheckVgaEnable
  - PcdBiosVideoSetTextVgaModeEnable

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-11-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 59dc8743ce OvmfPkg: remove Csm/BiosThunk/VideoDxe
Csm/BiosThunk/VideoDxe is not used by any platform at this point, remove
it.

This patch removes mentions of the following CSM resources from the source
code:

- GUIDs (protocols or otherwise):
  - gEfiLegacyBiosGuid
  - gEfiLegacyBiosProtocolGuid
  - gEfiVgaMiniPortProtocolGuid

- headers:
  - FrameworkDxe.h
  - Guid/LegacyBios.h
  - Protocol/LegacyBios.h
  - Protocol/VgaMiniPort.h

- PCDs:
  - PcdBiosVideoCheckVbeEnable
  - PcdBiosVideoCheckVgaEnable
  - PcdBiosVideoSetTextVgaModeEnable

which extends the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiLegacyBiosGuid
  - gEfiLegacyBiosProtocolGuid
  - gEfiVgaMiniPortProtocolGuid

- headers:
  - FrameworkDxe.h
  - Guid/LegacyBios.h
  - Protocol/LegacyBios.h
  - Protocol/VgaMiniPort.h

- PCDs:
  - PcdBiosVideoCheckVbeEnable
  - PcdBiosVideoCheckVgaEnable
  - PcdBiosVideoSetTextVgaModeEnable

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-10-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek ac79397267 OvmfPkg: exclude the CSM-based VideoDxe driver
The CSM-based VideoDxe driver is a special UEFI_DRIVER module that both
follows and doesn't follow the UEFI driver model.

Namely, in the Supported and Start members of its Driver Binding Protocol
instance, it consumes the Legacy Bios Protocol directly from the UEFI
protocol database, as opposed to (only) opening protocols on the handle
that it is supposed to bind.

Furthermore, the driver "marks" its own image handle with the
NULL-interface "Legacy Bios" (pseudo-protocol) GUID, in order to "inform
back" the provider of the Legacy Bios Protocol, i.e., LegacyBiosDxe, that
VideoDxe is a "BIOS Thunk Driver" in the system.

Quoting "OvmfPkg/Csm/Include/Guid/LegacyBios.h", such a driver follows the
UEFI Driver Model, but still uses the Int86() or FarCall() services of the
Legacy Bios Protocol as the basis for the UEFI protocol it produces.

In a sense, there is a circular dependency between VideoDxe and
LegacyBiosDxe; each knows about the other. However, VideoDxe is a
UEFI_DRIVER, while LegacyBiosDxe is a platform DXE_DRIVER with a very long
DEPEX. Therefore, for keeping dependencies conceptually intact, first
exclude VideoDxe from the OVMF platforms. Always include the
hypervisor-specific real UEFI video driver.

--*--

Note that the pathname
"IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf" in the bhyve
platform DSC and FDF files is bogus anyway.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Corvin Köhne <corvink@freebsd.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-9-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek e948ceeb80 OvmfPkg: remove gEfiLegacyDevOrderVariableGuid
At this point, gEfiLegacyDevOrderVariableGuid is unused; remove it.

This shrinks the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiLegacyBiosProtocolGuid

- headers:
  - Protocol/LegacyBios.h

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-8-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 545a5f6b68 OvmfPkg: remove LegacyBootMaintUiLib
LegacyBootMaintUiLib is not used by any platform at this point, remove it.

This patch removes mentions of the following CSM resources from the source
code:

- GUIDs (protocols or otherwise):
  - gEfiLegacyBiosProtocolGuid
  - gEfiLegacyDevOrderVariableGuid

- headers:
  - Guid/LegacyDevOrder.h
  - Protocol/LegacyBios.h

which extends the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiLegacyBiosProtocolGuid
  - gEfiLegacyDevOrderVariableGuid

- headers:
  - Guid/LegacyDevOrder.h
  - Protocol/LegacyBios.h

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-7-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 237a0564d4 OvmfPkg: unplug LegacyBootMaintUiLib from UiApp
LegacyBootMaintUiLib registers a form (HII Config Access Protocol
instance) with UiApp, for configuring legacy boot options; stop plugging
it into UiApp.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Corvin Köhne <corvink@freebsd.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-6-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 3f3e90d678 OvmfPkg: remove LegacyBootManagerLib
LegacyBootManagerLib is not used by any platform at this point, remove it.

This patch removes mentions of the following CSM resources from the source
code:

- GUIDs (protocols or otherwise):
  - gEfiLegacyBiosProtocolGuid
  - gEfiLegacyDevOrderVariableGuid

- headers:
  - Guid/LegacyDevOrder.h
  - Protocol/LegacyBios.h

which extends the list of resources scheduled for removal to:

- GUIDs (protocols or otherwise):
  - gEfiLegacyBiosProtocolGuid
  - gEfiLegacyDevOrderVariableGuid

- headers:
  - Guid/LegacyDevOrder.h
  - Protocol/LegacyBios.h

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-5-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00
Laszlo Ersek 0600bea167 OvmfPkg: unplug LegacyBootManagerLib from BdsDxe and UiApp
Don't register the LegacyBmRefreshAllBootOption() and LegacyBmBoot()
functions in BdsDxe and UiApp.

Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Corvin Köhne <corvink@freebsd.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4588
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20231110235820.644381-4-lersek@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-12-07 18:04:57 +00:00