diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2024-04-24 14:00:29 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-04-25 00:55:20 +0000 |
commit | 66c24219ade92b85b24f3ce29b988d187a9f6517 (patch) | |
tree | ab1ef3cf34bd26f25192ac4f7bcf0d5f5a0ac183 /OvmfPkg/VirtHstiDxe/VirtHstiDxe.c | |
parent | 90b6725562c82ec630d9e0cb19078f4b507db10b (diff) | |
download | edk2-66c24219ade92b85b24f3ce29b988d187a9f6517.zip edk2-66c24219ade92b85b24f3ce29b988d187a9f6517.tar.gz edk2-66c24219ade92b85b24f3ce29b988d187a9f6517.tar.bz2 |
OvmfPkg/VirtHstiDxe: do not load driver in confidential guests
The VirtHstiDxe does not work in confidential guests. There also isn't
anything we can reasonably test, neither flash storage nor SMM mode will
be used in that case. So just skip driver load when running in a
confidential guest.
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Fixes: 506740982bba ("OvmfPkg/VirtHstiDxe: add code flash check")
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Srikanth Aithal <sraithal@amd.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'OvmfPkg/VirtHstiDxe/VirtHstiDxe.c')
-rw-r--r-- | OvmfPkg/VirtHstiDxe/VirtHstiDxe.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/OvmfPkg/VirtHstiDxe/VirtHstiDxe.c b/OvmfPkg/VirtHstiDxe/VirtHstiDxe.c index b6e53a1..efaff0d 100644 --- a/OvmfPkg/VirtHstiDxe/VirtHstiDxe.c +++ b/OvmfPkg/VirtHstiDxe/VirtHstiDxe.c @@ -17,6 +17,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
+#include <Library/PcdLib.h>
#include <Library/PlatformInitLib.h>
#include <IndustryStandard/Hsti.h>
@@ -140,6 +141,11 @@ VirtHstiDxeEntrypoint ( EFI_STATUS Status;
EFI_EVENT Event;
+ if (PcdGet64 (PcdConfidentialComputingGuestAttr)) {
+ DEBUG ((DEBUG_INFO, "%a: confidential guest\n", __func__));
+ return EFI_UNSUPPORTED;
+ }
+
DevId = VirtHstiGetHostBridgeDevId ();
switch (DevId) {
case INTEL_82441_DEVICE_ID:
|