Enable MinPlatform stage 4 (OS boot) functionality. It adds ACPI, SMBIOS and SMM drivers required for stage 4. This should boot Windows and Linux with PIIX4 or Q35 configurations. In the current state, SMM only works on Qemu Q35 system if you set SMM_REQUIRED = TRUE in QemuOpenBoardPkg.dsc or via command-line.
Cc: Leif Lindholm <quic_llind...@quicinc.com> Cc: Michael D Kinney <michael.d.kin...@intel.com> Cc: Isaac Oram <isaac.w.o...@intel.com> Cc: Pedro Falcato <pedro.falc...@gmail.com> Cc: Gerd Hoffmann <kra...@redhat.com> Cc: Stefan Hajnoczi <stefa...@gmail.com> Signed-off-by: Theo Jehl <theojeh...@gmail.com> --- .../Include/Dsc/Stage4.dsc.inc | 56 +++++++++++++++++ .../QemuOpenBoardPkg/QemuOpenBoardPkg.dsc | 14 ++++- .../QemuOpenBoardPkg/QemuOpenBoardPkg.fdf | 61 +++++++++++++++++++ 3 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage4.dsc.inc diff --git a/Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage4.dsc.inc b/Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage4.dsc.inc new file mode 100644 index 000000000000..283c235b44c0 --- /dev/null +++ b/Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage4.dsc.inc @@ -0,0 +1,56 @@ +## @file +# Common DSC content to begin Stage 4 enabling +# +# @copyright +# Copyright (C) 2022 Theo Jehl +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + + +[LibraryClasses] + !if $(SMM_REQUIRED) == TRUE + SpiFlashCommonLib | IntelSiliconPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf + !endif + +[LibraryClasses.Common.DXE_SMM_DRIVER] + LockBoxLib | MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxSmmLib.inf + SmmCpuPlatformHookLib | OvmfPkg/Library/SmmCpuPlatformHookLibQemu/SmmCpuPlatformHookLibQemu.inf + SmmCpuFeaturesLib | OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf + +[Components.$(DXE_ARCH)] + OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf + MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf + OvmfPkg/SataControllerDxe/SataControllerDxe.inf + MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf + MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf + MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf + MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf + MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf + MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf + MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf + + !if $(SMM_REQUIRED) == TRUE + OvmfPkg/SmmAccess/SmmAccess2Dxe.inf + OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf + MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf + MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf + + MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf + UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf + + MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.inf + MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf + UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf + MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf + IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceSmm.inf + !endif + + # + # SMBIOS Support + # + MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf { + <LibraryClasses> + NULL | OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.inf + } + OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf diff --git a/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc b/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc index 55a7b7e6cdb6..f5c317c83e6a 100644 --- a/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc +++ b/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc @@ -50,7 +50,7 @@ # Stage 5 - boot to OS with security boot enabled # Stage 6 - boot with advanced features enabled # - gMinPlatformPkgTokenSpaceGuid.PcdBootStage | 3 + gMinPlatformPkgTokenSpaceGuid.PcdBootStage | 4 # # MinPlatform common include for required feature PCD @@ -99,7 +99,7 @@ gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable | TRUE !if $(SMM_REQUIRED) == TRUE - gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire | FALSE + gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire | TRUE gUefiCpuPkgTokenSpaceGuid.PcdCpuHotPlugSupport | FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache | FALSE !endif @@ -133,6 +133,7 @@ !include QemuOpenBoardPkg/Include/Dsc/Stage1.dsc.inc !include QemuOpenBoardPkg/Include/Dsc/Stage2.dsc.inc !include QemuOpenBoardPkg/Include/Dsc/Stage3.dsc.inc +!include QemuOpenBoardPkg/Include/Dsc/Stage4.dsc.inc [LibraryClasses.Common] QemuOpenFwCfgLib | QemuOpenBoardPkg/Library/QemuOpenFwCfgLib/QemuOpenFwCfgLib.inf @@ -157,3 +158,12 @@ DebugLib | OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf [Components.$(DXE_ARCH)] + MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf + MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf + OvmfPkg/SataControllerDxe/SataControllerDxe.inf + MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf + MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf + MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf + MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf + MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf + MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf diff --git a/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf b/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf index d07f9b4e7b80..5af0f0f2faa2 100644 --- a/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf +++ b/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf @@ -237,10 +237,69 @@ SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize = 0x800000 # Stage 4 Firmware Volumes # ########################### +[FV.FvOsBootUncompressed] + !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf + FvNameGuid = 4bb59c22-e1b8-414e-9de8-559db4054c4c + + INF OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf + + INF PcAtChipsetPkg/Bus/Pci/IdeControllerDxe/IdeControllerDxe.inf + INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf + INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf + INF FatPkg/EnhancedFatDxe/Fat.inf + + INF MdeModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.inf + INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf + + # ACPI + INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf + INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf + + # Buses + + INF MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf + INF MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf + INF MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf + INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf + INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf + + INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf + INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf + + INF OvmfPkg/SataControllerDxe/SataControllerDxe.inf + + INF MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf + INF MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf + + INF MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf + + !if $(SMM_REQUIRED) == TRUE + INF OvmfPkg/SmmAccess/SmmAccess2Dxe.inf + INF OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf + INF MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf + INF MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf + INF MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf + INF MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.inf + INF MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf + INF UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf + INF UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf + INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf + INF IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceSmm.inf + !endif + + INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf + INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf + [FV.FvOsBoot] !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf FvNameGuid = AE8F0EA0-1614-422D-ABC1-C518596F1678 + FILE FV_IMAGE = 4bb59c22-e1b8-414e-9de8-559db4054c4c { + SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE { + SECTION FV_IMAGE = FvOsBootUncompressed + } + } + ########################### # # Stage 5 Firmware Volumes @@ -249,6 +308,8 @@ SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize = 0x800000 [FV.FvSecurity] !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf FvNameGuid = 1AE6AB90-9431-425B-9A92-ED2708A4E982 + !include MinPlatformPkg/Include/Fdf/CoreSecurityLateInclude.fdf + !include MinPlatformPkg/Include/Fdf/CoreSecurityPreMemoryInclude.fdf ########################### # -- 2.37.0 (Apple Git-136) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#93726): https://edk2.groups.io/g/devel/message/93726 Mute This Topic: https://groups.io/mt/93665760/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-