Files
ovmf/ovmf-Revert-OvmfPkg-RiscVVirt-Add-SecureBootDefaultKeysIn.patch
YI HSIN Lyu d9ff8fd6f6 - Update to edk2-stable202511
- Patches (git log --oneline --date-order edk2-stable202505..edk2-stable202508):
        46548b1ada MdeModulePkg: Update brotli submodule
        9e4d3b3163 BaseTools: Update brotli submodule
        6c6d4d2d52 MdePkg: Add PCI Express 7.0 Header Support
        c624a06aa3 ArmPkg,UefiCpuPkg: fix boot failure with LPA2
        7446762732 MdePkg,UefiCpuPkg: fix wrong DS bit and add helper to check it
        1c74842bd0 ArmPkg/Library: fix: Incorrect SectionLength Calculation.
        49d4753385 MdeModulePkg: CoreDxe: Handle multilple MemoryAllocationModules
        a3a180e2bc MdeModulePkg: Update Brotli Compress to 1.2.0
        6d82549396 BaseTools: Update Brotli Compress to 1.2.0
        059332bda3 ArmPkg/Library: Fix for coverity issue OVERRUN
        05b677c9de UefiCpuPkg/MtrrLib: Prevent MTRR usage with SEV guests
        b98ccecdec MdePkg: Add code to detect running as an SEV guest
        8058a94f60 MdePkg: Add IPMI Mailbox Size Define
        b7d91dbe8a BaseTools/GenFW: RISC-V: Detect Zicfilp extension
        cb8c8c9285 FmpDevicePkg: GetImageInfo Add missing conditions
        641bd54258 UefiCpuPkg/SmmCpuFeaturesLib: Add Standalone MM support for AMD family
        2ff1029cc3 RedfishPkg: Add missing FreePool to fix memory leak issue
        9b71501f6c NetworkPkg/SnpDxe: Fix Snp used uninitialized
        94065db3dc MdeModulePkg: ArmFfaLib: Add FFA_YIELD handling
        ed79e67369 IntelFsp2Pkg: Add check if current OS support tkinter or not
        aba2b4e221 EmulatorPkg/Win/Host: Fix loaded DLL page protections
        2509b4be74 ArmPlatformPkg: Update transfer list register usage before stack setup
        05429cbe91 OvmfPkg: Expand EnrollDefaultKeys with Microsoft 2023 keys
        98d1f8a6fd BaseTools: Remove DXE_SAL_DRIVER
        41f7c0cd9e NetworkPkg: Remove DXE_SAL_DRIVER
        b089a6a445 EmbeddedPkg: Remove DXE_SAL_DRIVER
        5467d6037d ArmVirtPkg: Remove DXE_SAL_DRIVER
        8b00092e3f ArmPlatformPkg: Remove DXE_SAL_DRIVER
        9e740df0bd ArmPkg: Remove DXE_SAL_DRIVER
        d36680ad13 SecurityPkg: Remove DXE_SAL_DRIVER
        c6e5c20cb9 MdePkg: Remove DXE_SAL_DRIVER
        147e9a053e MdeModulePkg: Remove DXE_SAL_DRIVER
        59c3e63fc6 OvmfPkg: Use FvLib from MdePkg
        426da7fb1a IntelFsp2WrapperPkg: Rebase FSP-S and FSP-I if Image Base not match
        29a66468cb MdePkg: Copy FvLib to MdePkg
        d145aef952 MdeModulePkg/Core/Dxe: Fix TPL inversion from DEBUG() message
        302cc88ab3 NetworkPkg/SnpDxe: Update SnpDxe SNP_DRIVER struct out of DMA-able memory.
        a074649c60 CryptoPkg: Fix coverity warnings in CryptoPkg.
        c6cea09e9a SecurityPkg: Trace and return status are handled.
        ff0edeaaa8 StandaloneMmPkg/Core/Dispatcher: Use more generic MMRAM term in comment
        64a1aca08f MdeModulePkg: Fix UEFI runtime driver loading after EndOfDxe
        7ce19889f9 DynamicTablesPkg: Add the parser for EArchCommonObjTpm2DeviceInfo
        e29efd220d DynamicTablesPkg: PCIE SSDT Add root port devices
        01d4c1d51c DynamicTablesPkg: Update PCIe config space object
        8366881b06 DynamicTablesPkg: Add PCIe root port namespace object
        76c5005ce8 DynamicTablesPkg: Add X64 libraries to meta files
        0a3d688b1b DynamicTablesPkg: Enhance X64 PCIe SSDT _CRS generation
        cec2c6bbcc MdeModulePkg: Always Initialize Separate Exception Stacks
        1d6f2f0d8d MdeModulePkg: CpuExceptionHandlerLibNull: Return Success On Null Func
        34cd1aca46 UefiCpuPkg: MpInitLib: Fix Task Register Race Condition GP Fault
        e67f405713 UefiCpuPkg: Always Initialize Separate AP Exception Stacks
        f64b4065b7 UefiCpuPkg/CpuDxe: fix page table walk in confidential VM
        44214c0cdf MdeModulePkg/AcpiTableDxe:Improving InitializeAcpiTableDxe behavior.
        9f31aa33d8 MdeModulePkg:Completed InstallAcpiTableFromAcpiSiliconHob AddTableList
        c22d6957f4 MdeModulePkg/AcpiTableDxe:Fixed memory corruption issue
        47dc9e310b IntelFsp2Pkg: Update GenYamlCfg script
        db4d323909 UefiCpuPkg/PeiMpLib: Only allocate ACPI NVS AP loop code buffer on S3
        e494b25fe3 BaseTools:Remove deprecated ast.Str import for Python 3.14 compatibility
        2241651b17 BaseTools: Add Quoting to Python Path on Windows
        174933ebf6 IntelFsp2Pkg/GenCfgOpt.py: Fix line endings in Linux environments
        0fa57975b0 MdePkg: Acpi66: Add defined IOVT Signature
        aeb27b18ce EmulatorPkg/BuildOptions: Add CLANGPDB DLINK_FLAGS flags to build options
        e49ec97d12 OvmfPkg/BuildOptions : Add CLANGPDB DLINK_FLAGS flags to build options
        ffa859492a StandaloneMmPkg/BuildOptions : Add CLANGPDB DLINK_FLAGS to build options
        519ccd4d59 SecurityPkg/BuildOptions : Add CLANGPDB DLINK_FLAGS flags to build options
        1527320ad2 CryptoPkg/BuildOptions : Add CLANGPDB DLINK_FLAGS flags to build options
        f80a406aa9 MdeModulePkg: CoreGetMemoryMap: Account for Unaccepted Entries
        3731699a63 PrmPkg: Remove notes from Readme that do not apply
        12a908e09c PrmPkg/Samples: Update INF files for GCC/CLANG
        c16e88e301 PrmPkg/Include: Fix GCC/CLANG PRM Module DLL Export issues
        3980808abf BaseTools/Scripts: KEEP .prmexportdescriptor data sections
        47b0261613 BaseTools/Source/C/GenFw: Add --image-version option
        7a3bcd6684 BaseTools/Source/C/GenFw: Add no symbols check to --prm
        b5bab75e58 MdeModulePkg: DXE Core: Correct Usage of EFI_MEMORY_ATTRIBUTE_MASK
        1e7a83cbb6 BaseTools/FMMT: Fix errors when operating the FV with CRC32 section
        c9eb3717b4 MdeModulePkg: ScsiDiskDxe: Query Write Protected State
        d428ca6fe2 MdePkg: ATAPI: Add ATA_CMD_MODE_SENSE6 Definition
        fe52108211 EmbeddedPkg/VirtualRealTimeClockLib: Use SOURCE_DATE_EPOCH
        fcc568ca6e BaseTools/build.py: set BUILD_TIME_EPOCH if not already in environment
        5ca97bf64f BaseTools/build.py: language cleanup around CheckEnvVariable
        9e815d789b ShellPkg/SmbiosView: Display Type 44 "Referenced Handle" field
        28b7a6d5ea ShellPkg/SmbiosView: Display Type 2 Contained Objects info
        a0e8b71ee5 ShellPkg: Review SMBIOS 3.9 specification
        e27cfda33b OvmfPkg/IoMmuDxe: Fix 1M and 2M buffer handling
        2522020ee1 UnitTestFrameworkPkg: Use 8MB stack for MSFT and CLANGPDB
        597d061e09 MdeModulePkg/DxeCapsuleLibFmp:Added PCD for EmbeddedDriver Support
        9c06ac56fb SecurityPkg: Tcg2StandaloneMmArm: Enable TPM FFA Instance to Register PPI
        4883960e5e SecurityPkg: Tcg2AcpiFfa: Correct TPM Instance Validation
        ff96eb4c2c MdePkg: Restore ARM processor macro in CPER header
        faeee00490 MdeModulePkg/FvSimpleFileSystemDxe: Remove Iso639Language
        56989e2d24 FatPkg/EnhancedFatDxe: Remove Iso639Language
        aace3eebd2 DynamicTablesPkg: Use abstract tokens in token generator
        f09ea5f672 ArmVirtPkg/KvmtoolCfgMgrDxe: Update DynamicPlatRepoLib usage
        954ee29013 DynamicTablesPkg/FdtHwInfoParserLib: Add Arm IORT parser
        ba69c6d514 DynamicTablesPkg: FdtHwInfoParserLib: Generate GIC ITS group objects
        b0aac86c0d DynamicTablesPkg: Add helper to add array as a CmObj
        12690ffbb8 DynamicTablesPkg: Add helper to add CmObj with given token
        2ad74b956b DynamicTablesPkg/FdtHwInfoParserLib: Support 1 PMU IRQ per core
        549b473b23 MdePkg/BaseFdtLib: Add FdtGetPhandle wrapper
        80eaa563ec MdeModulePkg/HiiDatabaseDxe: Avoid unexpected memory free
        aff203c3ce Maintainers.txt: Remove myself as BaseTools maintainer
        3b83fe3958 BaseTools: Disable GCC relax on LoongArch
        0070fd1aec CryptoPkg: Fix build of MbedTlsLib
        4bb6dd8296 CryptoPkg: Simplify MSFT FLINK_FLAGS
        0f0b472ae5 OvmfPkg/PlatformInitLib: add sanity checks to igvm code
        ab04d09555 EmbeddedPkg: Clear keyboard queue buffer after reading
        0cad130cb4 MdeModulePkg : Clear keyboard queue buffer after reading
        f98662c5e3 MdePkg/MockFdtLib: add FdtLib mock functions
        5cf1be671b ShellPkg/pci.c: Fix typo in source code.
        5550d8f0b7 ShellPkg: Add PCIe boundary check and enhance DVSEC size calculation
        da44b3b24a PrmPkg: Set DXE_RUNTIME_DRIVER section alignment
        baf0ae3b1d SecurityPkg: rename PeilessSecMeasureNullLib
        d95e578b25 ArmPlatformPkg: rename LcdHwLibNull and LcdPlatformLibNull
        d52fa6da67 ArmPkg: rename ArmMtlNullLib
        01b9f27dbb ArmPlatformPkg/PlatformPei: generate TPM event log hobs
        f1f672b898 ArmPkg/SemihostFs: fix crash when file open fails
        edb5331f78 .github/workflows: Add PR formatting validator
        bfbd5d70e8 .github/GitHub.py: Add output and env helpers
        d3a64baf4b NetworkPkg/UefiPxeBcDxe: Add buffer check before reporting status code
        90771630bf UefiCpuPkg/ArmMmuLib: Add support for LPA2
        5ec21149a7 ArmPkg/CpuDxe: Add support for LPA2 page table entry format
        6e01bfcca2 ArmPkg/CpuDxe: Add support for signed page table levels
        3916260189 ArmPkg/ArmLib: Add 52-bit VA support helper (LPA2)
        c5e4e7e78a MdePkg/ArmLib: Add prototype for 52-bit VA support helper
        8c50ce60c4 MdePkg/AArch64: Add LPA2 related constants
        fe22ac2932 OvmfPkg/igvm: add IgvmSecureBootDxe
        5a6a9f7955 OvmfPkg/X86QemuLoadImageLib: do not use the legacy linux loader in CVMs.
        8b22c532b3 ShellPkg/Library: rework Shell...CommandsLib Load.c
        aa29d51637 ShellPkg: Use the newly introduced ShellPrintDefaultEx() alias
        9ff74659a8 OvmfPkg: Use the newly introduced ShellPrintHiiDefaultEx() alias
        c71d0e7153 PrmPkg: Use the newly introduced ShellPrintHiiDefaultEx() alias
        c4a8b001f3 ShellPkg: Use the newly introduced ShellPrintHiiDefaultEx() alias
        432feb6b56 NetworkPkg: Use the newly introduced ShellPrintHiiDefaultEx() alias
        44a3048c7c ShellPkg/ShellLib.h: Add aliases for ShellPrintEx() and ShellPrintHiiEx()
        9363f19900 ShellPkg/Connect: Extract a ConnectFromEfiVariable() function
        53f83ae00d ShellPkg/Connect: Extract a ConnectConsoles() function
        bcfbaf5f00 ShellPkg/Connect: Simplify error handling in ShellConnectFromDevPaths()
        7ae7bd8ef2 ShellPkg/DrvCfg: Simplify error handling in ParseBufferConfig()
        3fcea99da0 ShellPkg/DrvCfg: Extract a ParseBufferConfig() function
        16ffc09be1 ShellPkg/MemMap: Extract a ParseMemoryDescriptors() function
        5ff8948a12 ShellPkg/MemMap: Create arrays of MemoryType configuration and Page
        25daa0fcc9 ShellPkg/MemMap: Create array of MemoryType names
        0f57fc7cf7 ShellPkg/Dmem: Remove return parameter from DisplayXXX() functions
        2bebeb1ad4 ShellPkg/Dmem: Remove unnecessary EfiGetSystemConfigurationTable() calls
        482781a7f9 ShellPkg/Dmem: Simplify logic by inverting Address checks
        e78453fb54 ShellPkg/Dmem: Replace per-System Table variable by indexed arrays
        0235ac23c5 ShellPkg/Dmem: Remove Memory Range Capsule support
        cf67a0c78e ShellPkg/Dmem: Remove remaining of SAL System Table
        ace36ed376 ShellPkg/Dmem: Extract a DisplaySystemTable() function
        a51255072e OvmfPkg/EmuVariableFvbRuntimeDxe: initialize emu variable fvb from rom
        289b23ec12 ArmPlatformPkg/PeilessSec: apply PeilessSecMeasureLib in PeilessSec
        9bca0ee3b2 SecurityPkg/Library: introduce PeilessSecMeasureLib
        9c651ef83a SecurityPkg/Library: introduce HashLibTpm2PeilessSec
        ba079eda61 ArmPkg: Smbios: Update ProcessorSubClassDxe for new SMBIOS structures
        34e3bd44ff DynamicTablesPkg: Add SmbiosSmcLib
        3e62dbf504 DynamicTablesPkg: DynamicTableManagerDxe: Fix NULL pointer dereference
        6979b733ac DynamicTablesPkg: Smbios Processor Information (Type 4)
        d755753ef8 DynamicTablesPkg: Smbios Cache Information (Type 7)
        dfac150bdf MdePkg: SmBios: Add structs for cache size and configuration data
        a08905a62a DynamicTablesPkg: Implement abstract CM_OBJECT_TOKENs
        fad3450348 MdePkg: Smbios: Add AArch64 ProcessorId variant for type 4 table
        5a8411a7b0 DynamicTablesPkg: Add SMBIOS table generation
        a4492241a7 DynamicTablesPkg: Move ACPI building & change DEPEX on protocol
        06a1adf23d MdePkg/SmBios.h: Add New definition for Invalid Handle
        8f63fce994 DynamicTablesPkg: Add Ordered dispatch support for SMBIOS tables
        6544b894a9 DynamicTablesPkg: Update SMBIOS dispatcher dependency table
        54eabaf6b4 DynamicTablesPkg: Add SMBIOS table dispatcher
        4b0ba678eb DynamicTablesPkg: Define a SMBIOS Structure/Table type
        64b62a0879 UefiCpuPkg/MmSaveStateLib: On AMD MmSaveStateLib, add support AmdSysCallLib
        3ebcf121dc OvmfPkg: Add AmdSysCallLibNull in DSC files.
        1f5faa68ce UefiCpuPkg/AmdSysCallLib: Add AmdSysCallLib headers and Null library
        a04994ff64 OvmfPkg/MemFD: swap memory log buffer and pei firmware volume
        38370cf492 OvmfPkg/igvm: add PlatformIgvmVpCount
        251462324f OvmfPkg/QemuKernelLoaderFsDxe: add support for igvm data blobs
        c36111cfca OvmfPkg/igvm: handle igvm data hobs
        f52a46375b OvmfPkg/igvm: add IgvmData struct header + guid
        5e8db785e4 OvmfPkg/igvm: add igvm memory map support.
        313004a57f OvmfPkg/igvm: add igvm regions to reset vector
        e566e1e536 OvmfPkg/igvm: reserve two pages for igvm support in memfd
        bc431cece3 ShellPkg: add support for AGDI table in acpiview
        19a72dd1e1 MdePkg: AgdiTable: add support for Arm Agdi table
        2a6708a786 OvmfPkg/build.sh: Remove support for IA32 architecture
        7b971810b0 MdeModulePkg: Update to support mouse z-axis in ConSplitterDxe
        3c454cf7d4 BaseTools/Plugin/HostBasedUnitTestRunner: Add CLANG support
        55a5ec63fe UnitTestFrameworkPkg/UnitTestDebugAddressLib: Remove extra options
        07da104cfb UnitTestFrameworkPkg/GoogleTestLib: Remove extra options
        0838bf1531 UnitTestFrameworkPkg/SubhookLib: Update GCC defines
        6e65f7df90 UnitTestFrameworkPkg/CmockaLib: Add CLANGPDB support
        81a7efddd5 UnitTestFrameworkPkg/Include: Update GoogleTestLib for CLANG
        9731114a00 UnitTestFrameworkPkg: Add CLANGDWARF and CLANGPDB support
        f832329add UnitTestFrameworkPkg: Set defines for CLANGPDB builds
        8310dfa9f4 CryptoPkg/Library/OpensslLib: Add back PKCS12 support
        2ff173af12 BaseTools: Remove ARM32 Support
        bc31103006 MdePkg: Remove ARM32 Support from CompilerIntrinsicsLib
        49b3eb5907 MdePkg: Remove ARM32 Support from BaseLib
        84c026111c MdePkg: Remove ARM32 Support
        c7ada42ce4 MdePkg: Remove ARM32 Support from BaseCpuLib
        756fd38a80 MdePkg: Remove ARM32 Support from PE/COFF Libs
        9ca3dc9b0d MdePkg: Remove ARM32 Support from BaseSynchronizationLib
        673ff79628 MdePkg: Remove ARM32 Support from BaseIoIntrinsicLib
        0dc21d1f75 MdePkg: Remove ARM32 Support from BaseMemoryLibOptDxe
        f05cf0fd66 MdePkg: Remove ARM32 Support from ArmS*cLib
        7838ee347b MdePkg: Remove ARM32 Support from Service Table Libs
        abfe5b2869 MdePkg: Remove ARM32 Support from StackCheckLib
        5984676364 MdePkg: Remove ARM32 Support from UnitTests
        5f9e2eac7a UnitTestFrameworkPkg: Remove ARM32 Support
        ef79d58427 MdeModulePkg: Remove ARM32 Support
        80de048c1b ArmPkg: Remove ARM32 Support
        f73b53c283 ArmPkg: Remove Incorrect ArmPkg.dsc Sections
        cdc8858e19 ArmPkg: Remove ARM32 Support from ArmLib
        4261eb1bef ArmPkg: Remove ARM32 Support from ArmHvcLib
        889676ac60 ArmPkg: Remove ARM32 Support from ArmMonitorLib
        4bd1f47642 ArmPkg: Remove ARM32 Support from SMBIOS
        79e9dee6c7 ArmPkg: Remove ARM32 Support from ArmExceptionLib
        a40d7f7d0b ArmPkg: Remove ARM32 Support from CpuDxe
        f75198f592 ArmPkg: Remove ARM32 Support from ArmStandaloneMmCoreEntryPoint
        88b5cb3e12 ArmPkg: Remove ARM32 Support from DefaultExceptionHandlerLib
        3741a42087 ArmPkg: Remove ARM32 Support from ArmGicDxe
        bacb949dd9 ArmPkg: Remove ARM32 Support from SemiHostFs
        cebf57e701 ArmPkg: Remove ARM32 Comments and Supported Arch
        45147d3021 ArmPlatformPkg: Remove ARM32 Support from ArmPlatformLibNull
        dc1ccc9daf  ArmPlatformPkg: Remove ARM32 Support from Sec
        737ca4ea4f ArmPlatformPkg: Remove ARM32 Support from PeilessSec
        b9b1365a76 ArmPlatformPkg: Remove ARM32 Comment and Supported Architecture
        c6ff778056 OvmfPkg: Drop ARM32 Support
        2ba9441e0b CryptoPkg: Drop ARM32 Support
        90dc87714c EmulatorPkg: Drop ARM32 Support
        9b8cab36cd FatPkg: Drop ARM32 Support
        b1f7c444e1 DynamicTablesPkg: Drop ARM32 Support
        45fde54948 EmbeddedPkg: Drop ARM32 Support
        2c059facb3 FmpDevicePkg: Drop ARM32 Support
        1764d4eb2b NetworkPkg: Drop ARM32 Support
        470a80094c RedfishPkg: Drop ARM32 Support
        2b0ce49c50 PrmPkg: Drop ARM32 Support
        08ae634ccb SecurityPkg: Drop ARM32 Support
        9c657c3685 ShellPkg: Remove ARM32 Support
        18e94d0d4b SignedCapsulePkg: Drop ARM32 Support
        7cf721dd4d StandaloneMmPkg: Drop ARM32 Support
        3d50e76f03 UefiPayloadPkg: Drop ARM32 Support
        08c27faeed UefiCpuPkg: Drop ARM32 Support
        215e45bdb3 .azurepipelines,.github,.pytool: Disable ARM32 at Top Level/Pipelines
        f451d187c3 ShellPkg: AcpiView: Fix CodeQL Error
        12797dd337 BaseTools: Align Pre-Processor Macros for CLANGPDB and CLANGDWARF
        21eff866e7 SecurityPkg/Tpm2DeviceLibDTpm: Remove global variable for command code
        b15f98e68f OvmfPkg/IntelTdx: Fix TDVF boot failure with odd-sized memory below 2816M
        17691a2641 FmpDevicePkg/FmpDxe: Improve handling of XDR certs
        18d053d682 IntelFsp2Pkg/FspSecCore: Reserve 32B when calling C function in 64bit
        fb43f0c085 CryptoPkg: Add support to set TLS security level.
        ba41bd096a MdeModulePkg/TerminalDxe: Improve the implementation of AnsiTestString
        0053bbf833 MdeModulePkg/TerminalDxe: Add missing types for TestString function
        8a07311710 MdeModulePkg: Add PcdDelayedDispatchMaxEntries
        32711df057 DynamicTablesPkg: Drop IA32 support
        81f9f6d7b3 CryptoPkg/BaseCryptLibMbedTls: Fix wrong return in X509GetIssuerName
        bd9cb33424 CryptoPkg/BaseCryptLibMbedTls: Fix DateTime conversion from char to int
        238a6175fb BaseTools/Conf: Add support for C++ compiler flags
        5dadbbac0b BaseTools/Conf: Remove -nostdlib -nostdlibinc for CLANG
        6e992efa8d BaseTools/Conf: Remove -imacros from GCC_ASM_FLAGS
        95c5f119bd BaseTools/Conf: Make ASLCC_FLAGS independent of CC_FLAGS
        23dd3eafb8 BaseTools/Conf: USER_DEFINED/HOST_APPLICATION CLANG support
        a63bbb35d9 EmulatorPkg/Unix/Host: Add CLANGDWARF support and reduce warnings
        a9cf21e835 BaseTools/Conf: Fix build_rule.template for CLANGDWARF
        24803543ea EmulatorPkg/Win/Host: Remove set but not used variables
        7f557cd133 EmulatorPkg/Unix/Host: Fix set but unused variables
        0bc550f466 UnitTestFrameworkPkg/SampleGoogleTest: Add missing override keyword
        62861fed5d Maintainers.txt: Replace Swee Aun with Star as reviewer for StandaloneMmPkg
        82a03a8248 RedfishPkg/JsonLib: Define NO_MSABI_VA_FUNCS for GCC X64
        ff39a5d2dd CryptoPkg/BaseCryptLib: Fix MODULE_TYPE for unit tests
        ae95326c2c CryptoPkg/BaseCryptLib: Remove tolower() for unit tests
        1e5aeff417 UefiCpuPkg/MtrrLib: Update unit tests for CLANGPDB
        d87583e720 MdePkg/Library/BaseLib: Remove __chkstk() from BaseLib
        2636488e7b MdePkg/Test/MockSmmServicesTableLib: Fix struct init
        f57fab9b1d MdeModulePkg/Test/Include: Fix SecurityManagement include guard
        c4ca5ee091 MdeModulePkg/Universal/DisplayEngineDxe: Fix GCCNOLTO error
        9ac6e450e4 NetworkPkg/UefiPceBcDxe/GoogleTest: Add missing EFIAPI
        b05c8d7b80 NetworkPkg/Dhcp6Dxe/GoogleTest: Fix init of complex struct
        0d26d944d9 MdeModulePkg/Universal/DriverSampleDxe: Fix VFR warnings
        2a8d98d0a5 OvmfPkg/IntelTdx: Update TDVF README.md
        b4e6443f89 SecurityPkg: Tpm2DeviceLibFfa: Recognize CRB Interface Version 2
        b24663ee58 SecurityPkg: Tpm2DeviceLibDTpm: Recognize CRB Interface Version 2
        3a5563593a MdePkg: TpmPtp: Add CRB Interface Version 2 Definition
        11ecff34f3 ArmVirtPkg/ArmVirtQemu,ArmVirtQemuKernel: Allow users to enable SNP
        6690201491 .pytool: Update Uncrustify to 73.0.11
        d347a7e8bc BaseTools/VfrCompile: Fix compiler warning C++17 does not allow register
        dfbb7de3c6 ArmPkg: ArmPsciMpServicesDxe: Fix MPIDR usage from CoreInfo
        1fc19a0d52 ArmPkg: ArmPsciMpServicesDxe: Fix core disable/enable if the timer expires
        c502e2c58e MdeModulePkg/UnicodeCollation: Fix uninitialized variable usage
        3a53c57967 StandaloneMmPkg: Optimize MM core image size alignment
        1780373897 MdeModulePkg/DxeMain: Add debug code for Event Group notify functions
        282a324bf4 MdeModulePkg/ArmFfaLib: Add MemoryAllocationLib
        2558af552d MdeModulePkg/ArmFfaLib: Add HobLib to StMm instances
        615e5ca40a EmbeddedPkg/PrePiLib: minor cleanup in FfsProcessSection ()
        24fd71dcaa EmbeddedPkg/PrePiLib: eliminate unneeded variable in FfsProcessSection ()
        6b19b447c5 EmbeddedPkg/PrePiLib: refactor FfsProcessSection ()
        4a1dca59f6 OvmfPkg/ResetVector: reorganize #vc exit handler setup.
        6d90162e28 OvmfPkg/ResetVector: move ReloadFlat32 call
        ea5a8582e7 OvmfPkg/MemFd: switch Microvm build to include
        f8953fd9bd OvmfPkg/MemFd: switch OvmfPkgIa32X64 build to include
        4b1711d431 OvmfPkg/MemFd: add AmdSev changes, switch AmdSev build to include
        9d282ec2d9 OvmfPkg/MemFd: move MEMFD config from OvmfPkgX64 to include file
        502f0dfda4 OvmfPkg: Add NETWORK_ISCSI_DEFAULT_ENABLE build flag
        10b310f9b2 StandaloneMmPkg/Ipl: Do not check return status of MmCore's entry point
        9b931ae81f FmpDevicePkg/Library: Correct comment description
        b471ed2969 ArmVirtPkg: Drop ARM Virtual Platforms
        1fb88ffe28 OvmfPkg: Remove OVMF IA32
        20f24c0f67 OvmfPkg/MemEncryptSevLib: Check if SEV-SNP coherency mitigitation is needed
        f41f938b35 OvmfPkg/ResetVector: Make ReceivedVc a flag in SEV-ES workarea
        07ba06fdf7 MdePkg: Add the COHERENCY_SFW_NO CPUID bit field
        3b0d834db2 OvmfPkg/MemEncryptSevLib: Evict cache lines during SNP memory validation
        406aeb5a97 ShellPkg/SmbiosView: Add decode for DSP0134 SMBIOS Spec v3.9.0
        9e1c211b6c MdePkg/IndustryStandard: Define enums for DSP0134 SMBIOS Spec v3.9.0
        5739530817 MdePkg: Add MockSpiNorFlashProtocol
        f5d3291379 Maintainers.txt: Add vishalo as reviewer for AARCH64 support
        d7832b4800 MdeModulePkg: consider UNSUPPORTED return as valid in ArmFfaStandaloneMmLib
        d8e875e625 Global: fix ArmFfaLibRun() caller couldn't get ret-args
        57230fff6b ArmPlatformPkg,EmbeddedPkg,MdeModulePkg: Move RealTimeClockLib header
        438045682b MdePkg/Inclde: Deprecate EFI_UNICODE_COLLATION_PROTOCOL_GUID
        cf5f907cd5 ShellPkg: Deprecate EFI_UNICODE_COLLATION_PROTOCOL_GUID
        a46697f735 MdeModulePkg: Deprecate EFI_UNICODE_COLLATION_PROTOCOL_GUID
        9898567e2b FatPkg/EnhanceFatDxe:Deprecate EFI_UNICODE_COLLATION_PROTOCOL_GUID
        8bd3787e4b MdePkg/Include: Deprecate EFI_DEVICE_IO_PROTOCOL
        e27779e2c1 ShellPkg/Library: Deprecate EFI_DEVICE_IO_PROTOCOL
        80fddcaeb8 MdePkg/Include: Deprecate UNICODE_COLLATION_INTERFACE
        b1e018c0ad MdePkg/Include: Deprecate EFI_NVDIMM_LABEL_FLAGS_UPDATING
        a860818324 MdePkg/Include: Deprecate EFI_NVDIMM_LABEL_FLAGS_RESERVED
        ff668af879 MdePkg/Include: Deprecate EFI_IP4_CONFIG_PROTOCOL
        c3cab06d2b ShellPkg/Library: Deprecate EFI_IP4_CONFIG_PROTOCOL
        85770fd453 MdePkg: Add support for PCIe Extended IDs
        c992bffaef ShellPkg: Add support for PCIe Extended IDs
        338f5079f7 MdePkg: Enable CompilerIntrinsicsLib for LoongArch
        6093cfcdd1 BaseTools: PatchCheck.py: Allow MultiPkg Commits For Subject Check
        d250191042 BaseTools/PatchCheck.py: Check CI Options Before Parsing
        65485e195f UefiCpuPkg/MpInitLib: Ensure AP wake up on WakeUpByInitSipiSipi mode
        1dacf4c408 CryptoPkg: Add SNI support
        41cde6e2e3 NetworkPkg/TlsDxe: Add SNI support
        4e41744142 MdePkg/Nvme.h: Add Power Loss Signaling defination
        1bbd68755c BaseTools: Update architectures in target.template
        a80a53ccf2 MdeModulePkg/UiApp: Remove unused variable
        fcbf985673 MdePkg/ArmFfaMemMgmtLib: Fix typo in structure definition and comments
        f718b0ffd6 ShellPkg/UefiShellDebug1CommandsLib: Add MRDIMM entry to QueryTable
        397479d748 MdePkg/IndustryStandard: Add MRDIMM into Smbios.h
        2efffed938 MdePkg/Library/BaseRngLib/Riscv: use CPU RNG instructions only
        77293f4711 MdePkg: Correct comments for ResolutionY and ResolutionZ in SimplePointer.h
        fa92e9bd05 MdeModulePkg UsbMouseDxe: Correct some parameter comments
        aeea04341c MdeModulePkg: Fix malformed terminal control sequences
        060bb0e5a7 SecurityPkg/FvReportPei: Improve CheckStoredHashFv() description
        5025fc1eda ArmPkg/ArmTransferList: add TPM_EVENT_LOG information
        a9cad8a1fb ArmPkg/Library/ArmTransferList: add helper to get TransferList
        35a3ceb882 OvmfPkg/RiscVVirt: Add SecureBootDefaultKeysInit module.
        7374b2b224 OvmfPkg/RiscVVirt: Expand variable store size for secure boot
        32ea243c27 OvmfPkg/RiscVVirt: Resolve missing TPM Modules/Libraries
        62929b3022 OvmfPkg/RiscVVirt/PlatformPei: Enable TPM Device Discovery
        6bbdcecc0a OvmfPkg/Tcg2Config: Add RISC-V Support for TPM Device Discovery
        8bdc0c2a9a UefiCpuPkg/BaseRiscV64CpuTimerLib: Ensure mTimeBase is initialized
        d14e964692 ArmVirtPkg/ArmVirtQemu: Introduce support for MemDebugLib.
        41c48d2a7c OvmfPkg/MemDebugLogLib: move QemuFwCfgSimpleParserLib to LibraryClasses
        839e79f62b OvmfPkg/MemDebugLogLib: unoptimize PEIM and PEI_CORE
        4b041f09d6 RedfishPkg/PlatformConfig: Use en-US if no x-uefi-redfish string
        20609b499e RedfishPkg/RedfishPlatformConfig: Expose suppressed HII options to Redfish
        6755c9d82c UefiPayloadPkg: RISCV: Licensing Fix
        60803295c3 pip: bump pylibfdt from 1.7.2 to 1.7.2.post1
        8404e44c63 UefiPayloadPkg: update stack address print to 64 bit
        a56c2eb07e MdePkg/BaseFdtLib: Remove unused macros and string APIs
        fc0fffa7e9 pip-requirements: Add pylibfdt and pefile
        31402d2a31 CryptoPkg: Add Unit Test Host of Mbedtls CryptoLib
        d2bdf8dda6 CryptoPkg: Fix array index out of bounds in RsaGetPrivateKeyFromPem
        dc9cdf6c90 CryptoPkg: Add PKCS7 test case for partial certificate chains
        d188ad6a1f NetworkPkg/WifiConnectionManagerDxe: UI Disconnect
        68a7665250 UefiPayloadPkg/FmpDeviceSmmLib: Add for full chip flashing via SMMSTOREv2
        2736239aca UefiPayloadPkg/SmmStore: Add API to read/write/erase any flash block
        e7a1b29553 UefiPayloadPkg/UefiPayloadPkg.dsc: Enable FMP updates
        f53b19f6c8 UefiPayloadPkg: Enable processing of capsules
        d43451b520 MdeModulePkg: Add PcdCapsuleFmpSupport
        cc149a8eaa UefiPayloadPkg/UefiPayloadEntry: Import update capsules from bootloader
        8b2433c2f5 UefiPayloadPkg/BlSupportDxe: Publish ESRT with an entry for system firmware
        f3a5772aca UefiPayloadPkg/BlParseLib: Add parsing of firmware info
        450784d3fd UefiPayloadPkg/SblParseLib.inf: Add missing GUIDs
        433bbe6e49 BaseTools: DSC: fix processing !include in multiarch subsections
        829e42d3a3 MdeModulePkg/PeiCore: Print GUID of FV and FvFile in debug log
        8682d3ea0a SecurityPkg/Tpm2CommandLib: Update not found RC for Public NV Read
        42ba637432 .pytool: Use Tianocore Uncrustify release
        0e1e079f4c MdeModulePkg: Improve the implementation of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
        296c2e7edb MdeModulePkg: Simplify PrintInternal function to fit wide character
        eb3354a499 MdeModulePkg/HiiDatabaseDxe: Avoid assert in InternalGetString
        305e5845e6 BaseTools/VfrCompile: Add check for setting string default to number
  - Update ovmf-OvmfPkg-ArmVirtPkg-Keep-JSON-stack-cookie-files.patch
      - Rename ArmVirtQemu-AARCH64 path to ArmVirtQemu-AArch64 due to build path updates
      - Remove IA32, ArmVirtQemu-ARM, and Ovmf3264 because IA32 and ARM32 have been deprecated.
  - Update brotli Compress to 1.2.0
      - brotli-e230f474b87134e8c6c85b630084c612057f253e.tar.gz
          - e230f474b8.tar.gz
  - Add Revert-OvmfPkg-RiscVVirt-Add-SecureBootDefaultKeysIn.patch (bsc#1255113)
  - Remove the following patches because they have been merged to edk2-stable202511:
      - ovmf-OvmfPkg-Add-NETWORK_ISCSI_DEFAULT_ENABLE-build-flag.patch 
          502f0dfda4 OvmfPkg: Add NETWORK_ISCSI_DEFAULT_ENABLE build flag
      - ovmf-MdeModulePkg-Fix-malformed-terminal-control-sequence.patch
          aeea04341c MdeModulePkg: Fix malformed terminal control sequences
  - Remove the revert patch ovmf-Revert-SecurityPkg-Add-Additional-TPM-Logging-at-DEB.patch
    because the upstream has resolved this issue. (bsc#1249349) 
        21eff866e7 SecurityPkg/Tpm2DeviceLibDTpm: Remove global variable for command code
  - Remove the IA32 and AARCH32 OVMF image (jsc#PED-13070)
  - Refresh patche:
      - ovmf-Revert-Add-Stack-Cookie-Support-to-MSVC-and-GCC.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/ovmf?expand=0&rev=340
2025-12-24 09:15:54 +00:00

766 lines
24 KiB
Diff

From 96eb23c5556ed28d2242669bed9eb818285251b6 Mon Sep 17 00:00:00 2001
From: Richard Lyu <richard.lyu@suse.com>
Date: Wed, 17 Dec 2025 11:35:31 +0800
Subject: [PATCH] Revert "OvmfPkg/RiscVVirt: Add SecureBootDefaultKeysInit
module."
This reverts commit 35a3ceb882b57da0964c8b4a038e8808b3dc2b13.
---
.../SecureBootDefaultKeysInit.c | 643 ------------------
.../SecureBootDefaultKeysInit.inf | 49 --
OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc | 2 +-
OvmfPkg/RiscVVirt/RiscVVirtQemu.fdf | 18 -
4 files changed, 1 insertion(+), 711 deletions(-)
delete mode 100644 OvmfPkg/RiscVVirt/Feature/SecureBoot/SecureBootDefaultKeysInit/SecureBootDefaultKeysInit.c
delete mode 100644 OvmfPkg/RiscVVirt/Feature/SecureBoot/SecureBootDefaultKeysInit/SecureBootDefaultKeysInit.inf
diff --git a/OvmfPkg/RiscVVirt/Feature/SecureBoot/SecureBootDefaultKeysInit/SecureBootDefaultKeysInit.c b/OvmfPkg/RiscVVirt/Feature/SecureBoot/SecureBootDefaultKeysInit/SecureBootDefaultKeysInit.c
deleted file mode 100644
index 037174dc6a..0000000000
--- a/OvmfPkg/RiscVVirt/Feature/SecureBoot/SecureBootDefaultKeysInit/SecureBootDefaultKeysInit.c
+++ /dev/null
@@ -1,643 +0,0 @@
-/** @file
- This driver init default Secure Boot variables
-
- Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
- (C) Copyright 2018 Hewlett Packard Enterprise Development LP<BR>
- Copyright (c) 2021, ARM Ltd. All rights reserved.<BR>
- Copyright (c) 2021, Semihalf All rights reserved.<BR>
- Copyright (c) 2021, Ampere Computing LLC. All rights reserved.<BR>
- Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <Uefi.h>
-#include <UefiSecureBoot.h>
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/DxeServicesLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/UefiLib.h>
-#include <Guid/AuthenticatedVariableFormat.h>
-#include <Guid/ImageAuthentication.h>
-#include <Library/SecureBootVariableLib.h>
-#include <Library/SecureBootVariableProvisionLib.h>
-
-/**
- Set PKDefault Variable.
-
- @param[in] X509Data X509 Certificate data.
- @param[in] X509DataSize X509 Certificate data size.
-
- @retval EFI_SUCCESS PKDefault is set successfully.
-
-**/
-EFI_STATUS
-SetPkDefault (
- IN UINT8 *X509Data,
- IN UINTN X509DataSize
- )
-{
- EFI_STATUS Status;
- UINT32 Attr;
- UINTN DataSize;
- EFI_SIGNATURE_LIST *PkCert;
- EFI_SIGNATURE_DATA *PkCertData;
-
- PkCert = NULL;
-
- //
- // Allocate space for PK certificate list and initialize it.
- // Create PK database entry with SignatureHeaderSize equals 0.
- //
- PkCert = (EFI_SIGNATURE_LIST *)AllocateZeroPool (
- sizeof (EFI_SIGNATURE_LIST) + sizeof (EFI_SIGNATURE_DATA) - 1
- + X509DataSize
- );
- if (PkCert == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- DEBUG ((DEBUG_ERROR, "%a: Cannot initialize PKDefault: %r\n", __func__, Status));
- goto ON_EXIT;
- }
-
- PkCert->SignatureListSize = (UINT32)(sizeof (EFI_SIGNATURE_LIST)
- + sizeof (EFI_SIGNATURE_DATA) - 1
- + X509DataSize);
- PkCert->SignatureSize = (UINT32)(sizeof (EFI_SIGNATURE_DATA) - 1 + X509DataSize);
- PkCert->SignatureHeaderSize = 0;
- CopyGuid (&PkCert->SignatureType, &gEfiCertX509Guid);
- PkCertData = (EFI_SIGNATURE_DATA *)((UINTN)PkCert
- + sizeof (EFI_SIGNATURE_LIST)
- + PkCert->SignatureHeaderSize);
- CopyGuid (&PkCertData->SignatureOwner, &gEfiGlobalVariableGuid);
- //
- // Fill the PK database with PKpub data from X509 certificate file.
- //
- CopyMem (&(PkCertData->SignatureData[0]), X509Data, X509DataSize);
-
- Attr = EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS;
- DataSize = PkCert->SignatureListSize;
-
- Status = gRT->SetVariable (
- EFI_PK_DEFAULT_VARIABLE_NAME,
- &gEfiGlobalVariableGuid,
- Attr,
- DataSize,
- PkCert
- );
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: Cannot initialize PKDefault: %r\n", __func__, Status));
- goto ON_EXIT;
- }
-
-ON_EXIT:
-
- if (PkCert != NULL) {
- FreePool (PkCert);
- }
-
- return Status;
-}
-
-/**
- Set KDKDefault Variable.
-
- @param[in] X509Data X509 Certificate data.
- @param[in] X509DataSize X509 Certificate data size.
-
- @retval EFI_SUCCESS KEKDefault is set successfully.
-
-**/
-EFI_STATUS
-SetKekDefault (
- IN UINT8 *X509Data,
- IN UINTN X509DataSize
- )
-{
- EFI_STATUS Status;
- EFI_SIGNATURE_DATA *KEKSigData;
- EFI_SIGNATURE_LIST *KekSigList;
- UINTN DataSize;
- UINTN KekSigListSize;
- UINT32 Attr;
-
- KekSigList = NULL;
- KekSigListSize = 0;
- DataSize = 0;
- KEKSigData = NULL;
-
- KekSigListSize = sizeof (EFI_SIGNATURE_LIST) + sizeof (EFI_SIGNATURE_DATA) - 1 + X509DataSize;
- KekSigList = (EFI_SIGNATURE_LIST *)AllocateZeroPool (KekSigListSize);
- if (KekSigList == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- DEBUG ((DEBUG_ERROR, "%a: Cannot initialize KEKDefault: %r\n", __func__, Status));
- goto ON_EXIT;
- }
-
- //
- // Fill Certificate Database parameters.
- //
- KekSigList->SignatureListSize = (UINT32)KekSigListSize;
- KekSigList->SignatureHeaderSize = 0;
- KekSigList->SignatureSize = (UINT32)(sizeof (EFI_SIGNATURE_DATA) - 1 + X509DataSize);
- CopyGuid (&KekSigList->SignatureType, &gEfiCertX509Guid);
-
- KEKSigData = (EFI_SIGNATURE_DATA *)((UINT8 *)KekSigList + sizeof (EFI_SIGNATURE_LIST));
- CopyGuid (&KEKSigData->SignatureOwner, &gEfiGlobalVariableGuid);
- CopyMem (KEKSigData->SignatureData, X509Data, X509DataSize);
-
- //
- // Check if KEK been already existed.
- // If true, use EFI_VARIABLE_APPEND_WRITE attribute to append the
- // new kek to original variable
- //
- Attr = EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS;
-
- Status = gRT->GetVariable (
- EFI_KEK_DEFAULT_VARIABLE_NAME,
- &gEfiGlobalVariableGuid,
- NULL,
- &DataSize,
- NULL
- );
- if (Status == EFI_BUFFER_TOO_SMALL) {
- Attr |= EFI_VARIABLE_APPEND_WRITE;
- } else if (Status != EFI_NOT_FOUND) {
- DEBUG ((DEBUG_ERROR, "%a: Cannot get the value of KEK: %r\n", __func__, Status));
- goto ON_EXIT;
- }
-
- Status = gRT->SetVariable (
- EFI_KEK_DEFAULT_VARIABLE_NAME,
- &gEfiGlobalVariableGuid,
- Attr,
- KekSigListSize,
- KekSigList
- );
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: Cannot initialize KEKDefault: %r\n", __func__, Status));
- goto ON_EXIT;
- }
-
-ON_EXIT:
-
- if (KekSigList != NULL) {
- FreePool (KekSigList);
- }
-
- return Status;
-}
-
-/**
- Checks if the file content complies with EFI_VARIABLE_AUTHENTICATION_2 format
-
- @param[in] Data Data.
- @param[in] DataSize Data size.
-
- @retval TRUE The content is EFI_VARIABLE_AUTHENTICATION_2 format.
- @retval FALSE The content is NOT a EFI_VARIABLE_AUTHENTICATION_2 format.
-
-**/
-BOOLEAN
-IsAuthentication2Format (
- IN UINT8 *Data,
- IN UINTN DataSize
- )
-{
- EFI_VARIABLE_AUTHENTICATION_2 *Auth2;
- BOOLEAN IsAuth2Format;
-
- IsAuth2Format = FALSE;
-
- Auth2 = (EFI_VARIABLE_AUTHENTICATION_2 *)Data;
- if (Auth2->AuthInfo.Hdr.wCertificateType != WIN_CERT_TYPE_EFI_GUID) {
- goto ON_EXIT;
- }
-
- if (CompareGuid (&gEfiCertPkcs7Guid, &Auth2->AuthInfo.CertType)) {
- IsAuth2Format = TRUE;
- }
-
-ON_EXIT:
-
- return IsAuth2Format;
-}
-
-/**
- Set signature database with the data of EFI_VARIABLE_AUTHENTICATION_2 format.
-
- @param[in] AuthData AUTHENTICATION_2 data.
- @param[in] AuthDataSize AUTHENTICATION_2 data size.
- @param[in] VariableName Variable name of signature database, must be
- EFI_DB_DEFAULT_VARIABLE_NAME or EFI_DBX_DEFAULT_VARIABLE_NAME or EFI_DBT_DEFAULT_VARIABLE_NAME.
-
- @retval EFI_SUCCESS New signature is set successfully.
- @retval EFI_INVALID_PARAMETER The parameter is invalid.
- @retval EFI_UNSUPPORTED Unsupported command.
- @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources.
-
-**/
-EFI_STATUS
-SetAuthentication2ToSigDb (
- IN UINT8 *AuthData,
- IN UINTN AuthDataSize,
- IN CHAR16 *VariableName
- )
-{
- EFI_STATUS Status;
- UINTN DataSize;
- UINT32 Attr;
- UINT8 *Data;
-
- Attr = EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS;
-
- //
- // Check if SigDB variable has been already existed.
- // If true, use EFI_VARIABLE_APPEND_WRITE attribute to append the
- // new signature data to original variable
- //
- DataSize = 0;
- Status = gRT->GetVariable (
- VariableName,
- &gEfiGlobalVariableGuid,
- NULL,
- &DataSize,
- NULL
- );
- if (Status == EFI_BUFFER_TOO_SMALL) {
- Attr |= EFI_VARIABLE_APPEND_WRITE;
- } else if (Status != EFI_NOT_FOUND) {
- DEBUG ((DEBUG_ERROR, "%a: Cannot get the value of signature database: %r\n", __func__, Status));
- return Status;
- }
-
- //
- // Ignore AUTHENTICATION_2 region. Only the actual certificate is needed.
- //
- DataSize = AuthDataSize - ((EFI_VARIABLE_AUTHENTICATION_2 *)AuthData)->AuthInfo.Hdr.dwLength - sizeof (EFI_TIME);
- Data = AuthData + (AuthDataSize - DataSize);
-
- Status = gRT->SetVariable (
- VariableName,
- &gEfiGlobalVariableGuid,
- Attr,
- DataSize,
- Data
- );
-
- return Status;
-}
-
-/**
-
- Set signature database with the data of X509 format.
-
- @param[in] X509Data X509 Certificate data.
- @param[in] X509DataSize X509 Certificate data size.
- @param[in] VariableName Variable name of signature database, must be
- EFI_DB_DEFAULT_VARIABLE_NAME or EFI_DBX_DEFAULT_VARIABLE_NAME or EFI_DBT_DEFAULT_VARIABLE_NAME.
- @param[in] SignatureOwnerGuid Guid of the signature owner.
-
- @retval EFI_SUCCESS New X509 is enrolled successfully.
- @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources.
-
-**/
-EFI_STATUS
-SetX509ToSigDb (
- IN UINT8 *X509Data,
- IN UINTN X509DataSize,
- IN CHAR16 *VariableName,
- IN EFI_GUID *SignatureOwnerGuid
- )
-{
- EFI_STATUS Status;
- EFI_SIGNATURE_LIST *SigDBCert;
- EFI_SIGNATURE_DATA *SigDBCertData;
- VOID *Data;
- UINTN DataSize;
- UINTN SigDBSize;
- UINT32 Attr;
-
- SigDBSize = 0;
- DataSize = 0;
- SigDBCert = NULL;
- SigDBCertData = NULL;
- Data = NULL;
-
- SigDBSize = sizeof (EFI_SIGNATURE_LIST) + sizeof (EFI_SIGNATURE_DATA) - 1 + X509DataSize;
- Data = AllocateZeroPool (SigDBSize);
- if (Data == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- DEBUG ((DEBUG_ERROR, "%a: Cannot allocate memory: %r\n", __func__, Status));
- goto ON_EXIT;
- }
-
- //
- // Fill Certificate Database parameters.
- //
- SigDBCert = (EFI_SIGNATURE_LIST *)Data;
- SigDBCert->SignatureListSize = (UINT32)SigDBSize;
- SigDBCert->SignatureHeaderSize = 0;
- SigDBCert->SignatureSize = (UINT32)(sizeof (EFI_SIGNATURE_DATA) - 1 + X509DataSize);
- CopyGuid (&SigDBCert->SignatureType, &gEfiCertX509Guid);
-
- SigDBCertData = (EFI_SIGNATURE_DATA *)((UINT8 *)SigDBCert + sizeof (EFI_SIGNATURE_LIST));
- CopyGuid (&SigDBCertData->SignatureOwner, SignatureOwnerGuid);
- CopyMem ((UINT8 *)(SigDBCertData->SignatureData), X509Data, X509DataSize);
-
- //
- // Check if signature database entry has been already existed.
- // If true, use EFI_VARIABLE_APPEND_WRITE attribute to append the
- // new signature data to original variable
- //
- Attr = EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS;
-
- Status = gRT->GetVariable (
- VariableName,
- &gEfiGlobalVariableGuid,
- NULL,
- &DataSize,
- NULL
- );
- if (Status == EFI_BUFFER_TOO_SMALL) {
- Attr |= EFI_VARIABLE_APPEND_WRITE;
- } else if (Status != EFI_NOT_FOUND) {
- goto ON_EXIT;
- }
-
- Status = gRT->SetVariable (
- VariableName,
- &gEfiGlobalVariableGuid,
- Attr,
- SigDBSize,
- Data
- );
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: Cannot set signature database: %r\n", __func__, Status));
- goto ON_EXIT;
- }
-
-ON_EXIT:
-
- if (Data != NULL) {
- FreePool (Data);
- }
-
- return Status;
-}
-
-/**
-
- Set signature database.
-
- @param[in] Data Data.
- @param[in] DataSize Data size.
- @param[in] VariableName Variable name of signature database, must be
- EFI_DB_DEFAULT_VARIABLE_NAME or EFI_DBX_DEFAULT_VARIABLE_NAME or EFI_DBT_DEFAULT_VARIABLE_NAME.
- @param[in] SignatureOwnerGuid Guid of the signature owner.
-
- @retval EFI_SUCCESS Signature is set successfully.
- @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources.
-
-**/
-EFI_STATUS
-SetSignatureDatabase (
- IN UINT8 *Data,
- IN UINTN DataSize,
- IN CHAR16 *VariableName,
- IN EFI_GUID *SignatureOwnerGuid
- )
-{
- if (IsAuthentication2Format (Data, DataSize)) {
- return SetAuthentication2ToSigDb (Data, DataSize, VariableName);
- } else {
- return SetX509ToSigDb (Data, DataSize, VariableName, SignatureOwnerGuid);
- }
-}
-
-/** Initializes PKDefault variable with data from FFS section.
-
- @retval EFI_SUCCESS Variable was initialized successfully.
- @retval EFI_UNSUPPORTED Variable already exists.
-**/
-EFI_STATUS
-InitPkDefault (
- IN VOID
- )
-{
- EFI_STATUS Status;
- UINT8 *Data;
- UINTN DataSize;
-
- //
- // Check if variable exists, if so do not change it
- //
- Status = GetVariable2 (EFI_PK_DEFAULT_VARIABLE_NAME, &gEfiGlobalVariableGuid, (VOID **)&Data, &DataSize);
- if (Status == EFI_SUCCESS) {
- DEBUG ((DEBUG_INFO, "Variable %s exists. Old value is preserved\n", EFI_PK_DEFAULT_VARIABLE_NAME));
- FreePool (Data);
- return EFI_UNSUPPORTED;
- }
-
- //
- // Variable does not exist, can be initialized
- //
- DEBUG ((DEBUG_INFO, "Variable %s does not exist.\n", EFI_PK_DEFAULT_VARIABLE_NAME));
-
- //
- // Enroll default PK.
- //
- Status = GetSectionFromFv (
- &gDefaultPKFileGuid,
- EFI_SECTION_RAW,
- 0,
- (VOID **)&Data,
- &DataSize
- );
- if (!EFI_ERROR (Status)) {
- SetPkDefault (Data, DataSize);
- }
-
- return EFI_SUCCESS;
-}
-
-/** Initializes KEKDefault variable with data from FFS section.
-
- @retval EFI_SUCCESS Variable was initialized successfully.
- @retval EFI_UNSUPPORTED Variable already exists.
-**/
-EFI_STATUS
-InitKekDefault (
- IN VOID
- )
-{
- EFI_STATUS Status;
- UINTN Index;
- UINT8 *Data;
- UINTN DataSize;
-
- //
- // Check if variable exists, if so do not change it
- //
- Status = GetVariable2 (EFI_KEK_DEFAULT_VARIABLE_NAME, &gEfiGlobalVariableGuid, (VOID **)&Data, &DataSize);
- if (Status == EFI_SUCCESS) {
- DEBUG ((DEBUG_INFO, "Variable %s exists. Old value is preserved\n", EFI_KEK_DEFAULT_VARIABLE_NAME));
- FreePool (Data);
- return EFI_UNSUPPORTED;
- }
-
- Index = 0;
- do {
- Status = GetSectionFromFv (
- &gDefaultKEKFileGuid,
- EFI_SECTION_RAW,
- Index,
- (VOID **)&Data,
- &DataSize
- );
- if (!EFI_ERROR (Status)) {
- SetKekDefault (Data, DataSize);
- Index++;
- }
- } while (Status == EFI_SUCCESS);
-
- return EFI_SUCCESS;
-}
-
-/** Initializes dbDefault variable with data from FFS section.
-
- @retval EFI_SUCCESS Variable was initialized successfully.
- @retval EFI_UNSUPPORTED Variable already exists.
-**/
-EFI_STATUS
-InitDbDefault (
- IN VOID
- )
-{
- EFI_STATUS Status;
- UINTN Index;
- UINT8 *Data;
- UINTN DataSize;
-
- Status = GetVariable2 (EFI_DB_DEFAULT_VARIABLE_NAME, &gEfiGlobalVariableGuid, (VOID **)&Data, &DataSize);
- if (Status == EFI_SUCCESS) {
- DEBUG ((DEBUG_INFO, "Variable %s exists. Old value is preserved\n", EFI_DB_DEFAULT_VARIABLE_NAME));
- FreePool (Data);
- return EFI_UNSUPPORTED;
- }
-
- DEBUG ((DEBUG_INFO, "Variable %s does not exist.\n", EFI_DB_DEFAULT_VARIABLE_NAME));
-
- Index = 0;
- do {
- Status = GetSectionFromFv (
- &gDefaultdbFileGuid,
- EFI_SECTION_RAW,
- Index,
- (VOID **)&Data,
- &DataSize
- );
- if (!EFI_ERROR (Status)) {
- SetSignatureDatabase (Data, DataSize, EFI_DB_DEFAULT_VARIABLE_NAME, &gEfiGlobalVariableGuid);
- Index++;
- }
- } while (Status == EFI_SUCCESS);
-
- return EFI_SUCCESS;
-}
-
-/** Initializes dbxDefault variable with data from FFS section.
-
- @retval EFI_SUCCESS Variable was initialized successfully.
- @retval EFI_UNSUPPORTED Variable already exists.
-**/
-EFI_STATUS
-InitDbxDefault (
- IN VOID
- )
-{
- EFI_STATUS Status;
- UINTN Index;
- UINT8 *Data;
- UINTN DataSize;
-
- //
- // Check if variable exists, if so do not change it
- //
- Status = GetVariable2 (EFI_DBX_DEFAULT_VARIABLE_NAME, &gEfiGlobalVariableGuid, (VOID **)&Data, &DataSize);
- if (Status == EFI_SUCCESS) {
- DEBUG ((DEBUG_INFO, "Variable %s exists. Old value is preserved\n", EFI_DBX_DEFAULT_VARIABLE_NAME));
- FreePool (Data);
- return EFI_UNSUPPORTED;
- }
-
- //
- // Variable does not exist, can be initialized
- //
- DEBUG ((DEBUG_INFO, "Variable %s does not exist.\n", EFI_DBX_DEFAULT_VARIABLE_NAME));
-
- Index = 0;
- do {
- Status = GetSectionFromFv (
- &gDefaultdbxFileGuid,
- EFI_SECTION_RAW,
- Index,
- (VOID **)&Data,
- &DataSize
- );
- if (!EFI_ERROR (Status)) {
- SetSignatureDatabase (Data, DataSize, EFI_DBX_DEFAULT_VARIABLE_NAME, &gEfiGlobalVariableGuid);
- Index++;
- }
- } while (Status == EFI_SUCCESS);
-
- return EFI_SUCCESS;
-}
-
-/**
- Initializes default SecureBoot certificates with data from FFS section.
-
- @param[in] ImageHandle The firmware allocated handle for the EFI image.
- @param[in] SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS Variable was initialized successfully.
-**/
-EFI_STATUS
-EFIAPI
-SecureBootDefaultKeysInitEntry (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- Status = InitPkDefault ();
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: Cannot initialize PKDefault: %r\n", __func__, Status));
- return Status;
- }
-
- Status = InitKekDefault ();
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: Cannot initialize KEKDefault: %r\n", __func__, Status));
- return Status;
- }
-
- Status = InitDbDefault ();
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbDefault: %r\n", __func__, Status));
- return Status;
- }
-
- Status = InitDbxDefault ();
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: Cannot initialize dbxDefault: %r\n", __func__, Status));
- return Status;
- }
-
- return EFI_SUCCESS;
-}
diff --git a/OvmfPkg/RiscVVirt/Feature/SecureBoot/SecureBootDefaultKeysInit/SecureBootDefaultKeysInit.inf b/OvmfPkg/RiscVVirt/Feature/SecureBoot/SecureBootDefaultKeysInit/SecureBootDefaultKeysInit.inf
deleted file mode 100644
index 0127841733..0000000000
--- a/OvmfPkg/RiscVVirt/Feature/SecureBoot/SecureBootDefaultKeysInit/SecureBootDefaultKeysInit.inf
+++ /dev/null
@@ -1,49 +0,0 @@
-## @file
-# Initializes Secure Boot default keys
-#
-# Copyright (c) 2021, ARM Ltd. All rights reserved.<BR>
-# Copyright (c) 2021, Semihalf All rights reserved.<BR>
-# Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-##
-
-[Defines]
- INF_VERSION = 1.29
- BASE_NAME = SecureBootDefaultKeysInit
- FILE_GUID = 384D1860-7306-11F0-B8B4-F53A5CB787AC
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
- ENTRY_POINT = SecureBootDefaultKeysInitEntry
-
-[Sources]
- SecureBootDefaultKeysInit.c
-
-[Packages]
- MdeModulePkg/MdeModulePkg.dec
- MdePkg/MdePkg.dec
- SecurityPkg/SecurityPkg.dec
-
-[LibraryClasses]
- DebugLib
- DxeServicesLib
- SecureBootVariableLib
- SecureBootVariableProvisionLib
- UefiBootServicesTableLib
- UefiDriverEntryPoint
-
-[Guids]
- gDefaultdbFileGuid
- gDefaultdbxFileGuid
- gDefaultKEKFileGuid
- gDefaultPKFileGuid
- gEfiCertPkcs7Guid
- gEfiCertX509Guid
- gEfiCustomModeEnableGuid
- gEfiImageSecurityDatabaseGuid
- gEfiSecureBootEnableDisableGuid
-
-[Depex]
- gEfiVariableArchProtocolGuid AND
- gEfiVariableWriteArchProtocolGuid
diff --git a/OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc b/OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc
index a7c4f842bb..0c1162b845 100644
--- a/OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc
+++ b/OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc
@@ -392,7 +392,7 @@
!endif
}
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
- OvmfPkg/RiscVVirt/Feature/SecureBoot/SecureBootDefaultKeysInit/SecureBootDefaultKeysInit.inf
+ OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf
!else
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
!endif
diff --git a/OvmfPkg/RiscVVirt/RiscVVirtQemu.fdf b/OvmfPkg/RiscVVirt/RiscVVirtQemu.fdf
index 1f37eb6894..a71ce1ae0b 100644
--- a/OvmfPkg/RiscVVirt/RiscVVirtQemu.fdf
+++ b/OvmfPkg/RiscVVirt/RiscVVirtQemu.fdf
@@ -89,24 +89,6 @@ INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
!endif
!if $(SECURE_BOOT_ENABLE) == TRUE
INF SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
- INF OvmfPkg/RiscVVirt/Feature/SecureBoot/SecureBootDefaultKeysInit/SecureBootDefaultKeysInit.inf
-
- FILE FREEFORM = 85254ea7-4759-4fc4-82d4-5eed5fb0a4a0 {
- SECTION RAW = OvmfPkg/RiscVVirt/Feature/SecureBoot/SecureBootKeys/PK/PK.cer
- }
-
- FILE FREEFORM = 6f64916e-9f7a-4c35-b952-cd041efb05a3 {
- SECTION RAW = OvmfPkg/RiscVVirt/Feature/SecureBoot/SecureBootKeys/KEK/MicCorKEKCA2011_2011-06-24.crt
- }
-
- FILE FREEFORM = c491d352-7623-4843-accc-2791a7574421 {
- SECTION RAW = OvmfPkg/RiscVVirt/Feature/SecureBoot/SecureBootKeys/db/MicWinProPCA2011_2011-10-19.crt
- SECTION RAW = OvmfPkg/RiscVVirt/Feature/SecureBoot/SecureBootKeys/db/MicCorUEFCA2011_2011-06-27.crt
- }
-
- FILE FREEFORM = 5740766a-718e-4dc0-9935-c36f7d3f884f {
- SECTION RAW = OvmfPkg/RiscVVirt/Feature/SecureBoot/SecureBootKeys/dbx/dbxupdate_x64.bin
- }
!endif
INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
--
2.51.0