Commit Graph

2686 Commits

Author SHA1 Message Date
Tom Lendacky 8b87eb9dfb OvmfPkg: Use the OvmfPkg version of CcProbeLib
Currently, multiple dsc files within the OvmfPkg directory use the NULL
version of the CcProbeLib library. However, these packages have support
for confidential guests (usage of CcExitLib, MemEncrypt{Sev,Tdx}Lib, etc.)
and should be using the OvmfPkg version of the CcProbeLib.

The use of the NULL library causes the PCI option ROM to be enabled, which
can't be trusted as it originates from the hypervisor. The use of the NULL
library also causes a KVM hypervisor error when attempting to map/back the
option ROM region when running an SEV-SNP guest.

Update the various dsc files to reference the OvmfPkg version of the
CcProbeLib library and prevent usage of PCI option ROMs.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
2025-01-13 16:27:23 +00:00
Ceping Sun d51baa02a6 OvmfPkg: Update with TdxMeasurementLib
Since the tdx measurement APIs are implemented by
TdxMeasurementLib, the duplicate code are removed.

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2025-01-13 09:38:39 +00:00
Ceping Sun 6f73428d06 OvmfPkg: Implement TdxMeasurementLib
Add below APIs implementation that copied from TdxHelperLib.
- TdxMeasurementMapPcrToMrIndex
- TdxMeasurementHashAndExtendToRtmr
- TdxMeasurementBuildGuidHob

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2025-01-13 09:38:39 +00:00
Khor Swee Aun c0533b7e22 OvmfPkg/SmmCpuPlatformHookLibQemu: Define IsCpuSyncAlwaysNeeded
This patch is to implement default IsCpuSyncAlwaysNeeded definition
for SmmCpuPlatformHookLibQemu. This interface will determine whether the first
CPU Synchronization should be executed unconditionally when a SMI occurs.

If the function returns true, it indicates that there is no need to check the system
configuration and status, and the first CPU Synchronization should be executed
unconditionally.

If the function returns false, it indicates that the first CPU Synchronization is
not executed unconditionally, and the decision to synchronize should be based on
the system configuration and status.

Signed-off-by: Khor Swee Aun <swee.aun.khor@intel.com>
2025-01-10 07:45:26 +00:00
Pedro Tôrres f6e19abd97 OvmfPkg/VirtioSerialDxe: respond CONSOLE_PORT with PORT_OPEN
The VirtIO spec states that "Upon receipt of a
VIRTIO_CONSOLE_CONSOLE_PORT message, the driver SHOULD treat the port in
a manner suitable for text console access and MUST respond with a
VIRTIO_CONSOLE_PORT_OPEN message, which MUST have value set to 1". See
https://docs.oasis-open.org/virtio/virtio/v1.3/virtio-v1.3.html#x1-3330002.

The current driver implementation, however, does not comply with that
and only sends PORT_OPEN messages upon receipt of PORT_OPEN messages.
This causes a problem in platforms like Apple's Virtualization
Framework, where PORT_OPEN messages are not sent back to the driver
after CONSOLE_PORT messages are received by the device, a behaviour that
is compliant with the VirtIO specification.

This patch addresses this issue by always responding CONSOLE_PORT
messages with PORT_OPEN messages.

Signed-off-by: Pedro Tôrres <t0rr3sp3dr0@gmail.com>
2025-01-04 15:55:02 +00:00
Paweł Poławski fc140c5eae OvmfPkg: Enable virtio keyboard driver for Ia32x64 OVMF platform
Signed-off-by: Paweł Poławski <ppolawsk@redhat.com>
2024-12-29 19:19:59 +01:00
Paweł Poławski ce4317b4c8 OvmfPkg: Enable virtio keyboard driver for X64 OVMF platform
Signed-off-by: Paweł Poławski <ppolawsk@redhat.com>
2024-12-29 19:19:59 +01:00
Paweł Poławski 8bc9f5a2bc OvmfPkg: Virtio based keyboard driver implementation
This is virtio based keyboard driver designed to be used on ARM platform.
The driver implements basic and extended text input interface.

UEFI shell requires only basic text input interface, but Grub needs
extended text input to work on.

Signed-off-by: Paweł Poławski <ppolawsk@redhat.com>
2024-12-29 19:19:59 +01:00
Paweł Poławski 0eea7b9c02 OvmfPkg: Add virtio keyboard device hooks
This commit adds:
- missing virtio subsystem ID for input device
- PrepareVirtioKeyboardDevicePath() handler to boot manager library

Signed-off-by: Paweł Poławski <ppolawsk@redhat.com>
2024-12-29 19:19:59 +01:00
Luigi Leonardi 4971459ab2 OvmfPkg: add new shell runtime config option to documentation.
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2024-12-23 10:36:19 +00:00
Luigi Leonardi 597342b212 OvmfPkg/PlatformBootManagerLib: Optimize PlatformRegisterFvBootOption
Add a FileIsInFv check to PlatformRegisterFvBootOption, this is to
to avoid adding and then removing a boot option shortly after,
because the file is no longer in the firmware volume.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2024-12-23 10:36:19 +00:00
Luigi Leonardi abbd05992d OvmfPkg/PlatformBootManagerLib: Introduce FileIsInFv function.
Move out file presence check from RemoveStaleFvFileOptions
to a new helper function for reusability. No functional changes
intended.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2024-12-23 10:36:19 +00:00
Luigi Leonardi 103aed83a7 OvmfPkg/PlatformBootManagerLib: Introduce support for fw_cfg for UEFI Shell
usage: qemu -fw_cfg name=opt/org.tianocore/EFIShellSupport,string=no

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2024-12-23 10:36:19 +00:00
Luigi Leonardi 07bb226542 OvmfPkg: Add a runtime switch for PlatformRegisterFvBootOption
Add a new parameter to selectively enable or disable the BootOption.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2024-12-23 10:36:19 +00:00
Chao Li b8f3199595 OvmfPkg/LoongArch: Enabling some base libraries
BaseCryptLib, RngLib, IntrinsicLib and OpensslLib are enabled by default
on LoongArch VM, since some APPs or OS require them.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Chao Li <lichao@loongson.cn>
2024-12-23 03:18:13 +00:00
Gerd Hoffmann 9ef348350a OvmfPkg: document runtime config options
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-17 12:44:11 +01:00
Michael Kubacki c7354e9c84 OvmfPkg: Add minimum Python version for CI badge
The Python version used for build and CI should always be at least
the minimum version supported by edk2-pytool-extensions. A badge
is added that keeps this information dynamically up-to-date based
on the minimum version specified in edk2-pytool-extensions
pyproject.toml file.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2024-12-13 22:05:02 +00:00
Ceping Sun c1eb477e06 OvmfPkg/TdxDxe: Clear GPR Mask for RBX
Refer to intel-tdx-module-api spec section 5.5.21, GPR mask
(TDVMCALL_EXPOSE_REGS_MASK) is a bitmap that controls which
part of the guest TD GPR and XMM state is passed as-is to
the VMM and back.
- A bit value of 0 indicates that the corresponding register
   is saved by the Intel TDX module and not passed as-is to
   Host VMM.
- A bit value of 1 indicates that the corresponding register
   is passed as-is to the host VMM.

Currently, RBX is used as the mailbox address in ApRunLoop.nasm,
the corresponding bit value of RBX in MASK(Bit 3) is set as 1 which
means the value is passed to Host VMM as-is and it can be changed by
Host VMM.

So the bitmask shall be set as 0 to avoid this situation.

Reference:
[TDX-API]: intel-tdx-module-abi-spec
https://cdrdv2.intel.com/v1/dl/getContent/733579

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Hunter Adrian <adrian.hunter@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2024-12-13 13:29:27 +00:00
Chao Li 3022bab164 OvmfPkg: Remove macro MAX_LOONGARCH_EXCEPTION
Since the UEFI 2.11 has been released, the macro
MAX_LOONGARCH_EXCEPTION has been added in MdePkg, so it is deleted in
LoongArchVirt/Sec/LoongArch64/Start.S

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Chao Li <lichao@loongson.cn>
2024-12-12 04:57:03 +00:00
Oliver Smith-Denny 1c5c951ec3 Update CI to VS2022
This PR updates the CI pipelines to use VS2022 instead of VS2019
as that is the latest supported VS toolchain on edk2.

Continuous-integration-options: PatchCheck.ignore-multi-package

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2024-12-10 23:42:09 +00:00
Ceping Sun d55d4e22f4 OvmfPkg: Update PlatformPei.inf with TdxHelperLib
Since TdxHelperLib was defined in LibraryClasses for OvmfPkgX64.dsc,
the extra definitions is removed.

And for other dsc, add the Null-TdxHelperLib to remove the extra
definitions.

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2024-12-10 02:09:29 +00:00
Ceping Sun 1f55e175f4 OvmfPkg: Update OvmfPkgX64.dsc to support TdTcg2Pei
Add TdTcg2Pei in OvmfPkgX64.dsc in early PEI phase to
support CC measurement.

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2024-12-10 02:09:29 +00:00
Ceping Sun 9f9657e7da OvmfPkg: Update OvmfTpmLibs.dsc.inc to add PeiTpmMeasurementLib.inf
Because PeiTpmMeasurementLib supports both TCG measurement and CC
measurement, it shall be controled by TPM2_ENABLE and
CC_MEASUREMENT_EANBLE.

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2024-12-10 02:09:29 +00:00
Ceping Sun 7689c0d9fa OvmfPkg/TdTcg2Pei: Add TdTcg2Pei to install gEdkiiCcPpi
TdTcg2Pei is added to install the gEdkiiCcPpi for a TD-Guest.

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2024-12-10 02:09:29 +00:00
Ceping Sun bdf3c917e3 OvmfPkg/TdTcg2Dxe: Update with TdxHelperLib
Since TdxHelperLib has the API(TdxHelperMapPcrToMrIndex)
to map PCR to MR index, the duplicate codes are removed.

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2024-12-10 02:09:29 +00:00
Ceping Sun b6b1fdb073 OvmfPkg/TdxHelperLib: Refactor for new APIs
Add below APIs to support the implementation for CC measurement.
- TdxHelperMapPcrToMrIndex
- TdxHelperHashAndExtendToRtmr
- TdxHelperBuildTdxMeasurementGuidHob

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2024-12-10 02:09:29 +00:00
Ceping Sun cc0ec8ebae OvmfPkgX64: Add BaseCryptLib definition in PEIM
Since the TdxHelperLib is used for measurement
in PEI phase, it required TDVF to add the library.

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2024-12-10 02:09:29 +00:00
Gerd Hoffmann f0424ec80e OvmfPkg: disable iscsi by default
While IScsiDxe certainly is a useful feature it is rarely used, and it
slows down firmware boot quite a bit.  So disable it by default and only
load it in case this is explicitly requested via fw_cfg.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 20:45:29 +00:00
Gerd Hoffmann 645988d9b3 OvmfPkg: add PcdEntryPointOverrideDefaultValue
UefiDriverEntryPointFwCfgOverrideLib will use
PcdEntryPointOverrideDefaultValue to decide what to do in case the
fw_cfg file specified via PcdEntryPointOverrideFwCfgVarName is not
present.  Default is "yes".

This allows to disable drivers by default and only enable them when
requested via fw_cfg.

Also log a message with the config option applied and whenever the
default value or a fw_cfg option was used.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 20:45:29 +00:00
Gerd Hoffmann 9ca29831f6 OvmfPkg: add fw_cfg option for usb storage
Use UefiDriverEntryPointFwCfgOverrideLib for UsbMassStorageDxe so
the driver can be enabled/disabled via fw_cfg option.

usage: qemu -fw_cfg name=opt/org.tianocore/UsbStorageSupport,string={yes,no}

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 20:45:29 +00:00
Gerd Hoffmann f9335bcb7c OvmfPkg: add fw_cfg option for iscsi support
Use UefiDriverEntryPointFwCfgOverrideLib for IScsiDxe so the driver
can be enabled/disabled via fw_cfg option.

usage: qemu -fw_cfg name=opt/org.tianocore/ISCSISupport,string={yes,no}

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 20:45:29 +00:00
Gerd Hoffmann b9cb18206a OvmfPkg: add fw_cfg option for virtio-net support
Use UefiDriverEntryPointFwCfgOverrideLib for VirtioNetDxe so the driver
can be enabled/disabled via fw_cfg option.

usage: qemu -fw_cfg name=opt/org.tianocore/VirtioNetSupport,string={yes,no}

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 20:45:29 +00:00
Gerd Hoffmann 5be587067a OvmfPkg: move USB drivers to new UsbComponents.dsc.inc
Allows to update USB driver configuration without
touching all *.dsc files.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 20:45:29 +00:00
Gerd Hoffmann b3b3cfab7e OvmfPkg: move VirtioNet to NetworkComponents.dsc.inc
Allows to update VirtioNet driver configuration without
touching all *.dsc files.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 20:45:29 +00:00
Alexander Gryanko 087a47688c OvmfPkg: PXE boot option build flag
The second step is to add an option to the OvmfPkg module to disable
PXE booting using the NETWORK_PXE_BOOT_ENABLE flag. The patch is divided
into 3 parts. At the current stage the flag is not functional.

Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
2024-12-06 18:26:01 +00:00
Gerd Hoffmann 775d6cd7ed OvmfPkg/QemuFwCfgDxeLib: use PcdConfidentialComputingGuestAttr
Check PcdConfidentialComputingGuestAttr instead of calling
MemEncryptSevIsEnabled() and MemEncryptTdxIsEnabled() to figure
whenever SEV or TDX is enabled.

This allows to remove the MemEncryptSevLib + MemEncryptTdxLib
dependencies.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-04 12:40:35 +00:00
Rebecca Cran bff50932c1 OvmfPkg: Update links to Intel & MS ACPI compilers in README
Intel's ACPICA download is no longer on acpica.org, but that site
redirects to pages on intel.com. Update the link to acpica.org to
the new ACPICA download page.

Microsoft's acpi.info no longer exists, so update the link to point to
Microsoft's ACPI compiler information page.

While here, update the nasm link from http to https.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-12-03 08:21:51 +00:00
Alexander Gryanko 24d835a131 OvmfPkg/Library/HardwareInfoLib: Fix memory allocation for a root bridge
Currently, PciHostBridgeUtilityGetRootBridgesHostProvided allocates memory
for aperture structures without clearing memory. This causes garbage in
the Translation field, but the Base and Limit fields have the correct
values because they are copied from the HOST_BRIDGE_INFO fields in the
HardwareInfoPciHostBridgeHostBridgeHostBridgeGetApertures function.

RootBridge: PciRoot(0x0)
  Support/Attr: 70069 / 70069
    DmaAbove4G: No
NoExtConfSpace: No
     AllocAttr: 3 (CombineMemPMem Mem64Decode)
           Bus: 0 - 80 Translation=0
            Io: 6000 - FFFF Translation=5E9EB018
           Mem: 80000000 - DFFFFFFF Translation=0
    MemAbove4G: 600000000000 - 7FFFFFFFFFFF Translation=0
          PMem: FFFFFFFFFFFFFFFF - 0 Translation=0
   PMemAbove4G: FFFFFFFFFFFFFFFF - 0 Translation=0

Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
2024-11-27 22:06:12 +00:00
Marc Chen 3781ad107d OvmfPkg/QemuVideoDxe: Clean up Non-Used PCDs
Clean up PcdOvmfHostBridgePciDevId and PcdNullPointerDetectionPropertyMask
from QemuVideoDxe.inf

Signed-off-by: Marc Chen <marc.chen@microsoft.com>
2024-11-27 19:43:58 +00:00
Oliver Steffen 9c4542a064 OvmfPkg: Rerun dispatcher after initializing virtio-rng
Since the pixiefail CVE fix the network stack requires a hardware
random number generator. This can currently be a modern CPU supporting
the RDRAND instruction or a virtio-rng device.
The latter is initialized during the BDS phase.
To ensure all depending (network) modules are also started, we need to
run the dispatcher once more after the device was initialized.
Without this, network boot is not available under certain hardware
configurations.

Fixes: 4c4ceb2ceb ("NetworkPkg: SECURITY PATCH CVE-2023-45237")

Analysed-by: Stefano Garzarella <sgarzare@redhat.com>
Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Oliver Steffen <osteffen@redhat.com>
2024-11-27 18:07:10 +00:00
Gerd Hoffmann 8c8e05db24 OvmfPkg/PlatformInitLib: enable x2apic mode if needed
Enable x2apic mode in case the number of possible CPUs (including
hotplug-able CPus which are not (yet) online) is larger than 255.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-11-25 12:22:38 +00:00
Tom Lendacky 6142f0a8a5 OvmfPkg/EmuVariableFvbRuntimeDxe: Issue NV vars initializitation message
Add a debug message that indicates when the NV variables are being
initialized through the template structure.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
2024-11-23 18:02:30 +00:00
Tom Lendacky d502cc7702 OvmfPkg/PlatformInitLib: Retry NV vars FV check as shared
When OVMF is built with SECURE_BOOT_ENABLE, the variable store will be
populated and validated in PlatformValidateNvVarStore(). When an SEV
or an SEV-ES guest is running, this may be encrypted or unencrypted
depending on how the guest was started. If the guest was started with the
combined code and variable contents (OVMF.fd), then the variable store
will be encrypted. If the guest was started with the separate code and
variables contents (OVMF_CODE.fd and OVMF_VARS.fd), then the variable
store will be unencrypted.

When PlatformValidateNvVarStore() is first invoked, the variable store
area is initially mapped encrypted, which may or may not pass the variable
validation step depending how the guest was launched. To accomodate this,
retry the validation step on failure after remapping the variable store
area as unencrypted.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
2024-11-23 18:02:30 +00:00
Tom Lendacky 52fa7e78d2 OvmfPkg/PlatformPei: Move NV vars init to after SEV-SNP memory acceptance
When OVMF is built with the SECURE_BOOT_ENABLE set to true, reserving and
initializing the emulated variable store happens before memory has been
accepted under SEV-SNP. This results in a #VC exception for accessing
memory that hasn't been validated (error code 0x404). The #VC handler
treats this error code as a fatal error, causing the OVMF boot to fail.

Move the call to ReserveEmuVariableNvStore() to after memory has been
accepted by AmdSevInitialize().

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
2024-11-23 18:02:30 +00:00
Tom Lendacky f0d2bc3ab2 OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Do not use flash with SEV-SNP
SEV-SNP does not support the use of the Qemu flash device as SEV-SNP
guests are started using the Qemu -bios option instead of the Qemu -drive
if=pflash option. Perform runtime detection of SEV-SNP and exit early from
the Qemu flash device initialization, indicating the Qemu flash device is
not present. SEV-SNP guests will use the emulated variable support.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
2024-11-23 18:02:30 +00:00
Oliver Smith-Denny ef4f3aa3f7 MdePkg: MdeLibs.dsc.inc: Apply StackCheckLibNull to All Module Types
Now that the ResetVectors are USER_DEFINED modules, they will not
be linked against StackCheckLibNull, which were the only modules
causing issues. So, we can now remove the kludge we had before
and the requirement for every DSC to include StackCheckLibNull
for SEC modules and just apply StackCheckLibNull globally.

This also changes every DSC to drop the SEC definition of
StackCheckLibNull.

Continuous-integration-options: PatchCheck.ignore-multi-package

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-11-13 21:01:46 +00:00
Oliver Smith-Denny fd9e9848ac OvmfPkg: Make ResetVector USER_DEFINED
Following the change in UefiCpuPkg, this moves OvmfPkg's
ResetVectors to USER_DEFINED modules to prevent any
NULL libraries from being linked against them, allowing
for expected behavior from the ResetVector and for
simpler implementation of NULL libraries applied globally.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-11-13 21:01:46 +00:00
Aleksandr Goncharov 2ffd6d2e82 OvmfPkg: mark fixed network PCDs
Rename `NetworkPcds` to `NetworkFixedPcds` to avoid confusion with
dynamic PCDs

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jianyong Wu <jianyong.wu@arm.com>
Cc: Anatol Belski <anbelski@linux.microsoft.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Andrei Warkentin <andrei.warkentin@intel.com>
Cc: Chao Li <lichao@loongson.cn>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Xianglai Li <lixianglai@loongson.cn>
Signed-off-by: Aleksandr Goncharov <chat@joursoir.net>
2024-11-11 13:38:51 +00:00
Aleksandr Goncharov 7ccda1a0b3 OvmfPkg: use NetworkDynamicPcds include file
Start using the include file in the OvmfPkg package to manage dynamic
network-related PCDs. This change removes the manual addition of
`PcdIPv4PXESupport` and `PcdIPv6PXESupport` from the DSC file,
relying instead on the centralized include file introduced in
NetworkPkg.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jianyong Wu <jianyong.wu@arm.com>
Cc: Anatol Belski <anbelski@linux.microsoft.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Andrei Warkentin <andrei.warkentin@intel.com>
Cc: Chao Li <lichao@loongson.cn>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Xianglai Li <lixianglai@loongson.cn>
Signed-off-by: Aleksandr Goncharov <chat@joursoir.net>
2024-11-11 13:38:51 +00:00
Jiaxin Wu e34460c8b2 OvmfPkg/Library: Impl SmmCpuPlatformHookBeforeMmiHandler func
This patch is to add SmmCpuPlatformHookBeforeMmiHandler func
for OVMF.

Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
2024-10-12 08:56:05 +00:00