Skip to content

Commit

Permalink
OvmfPkg/VirtHstiDxe: do not load driver in confidential guests
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Jiewen Yao <[email protected]>
Fixes: 5067409 ("OvmfPkg/VirtHstiDxe: add code flash check")
Signed-off-by: Gerd Hoffmann <[email protected]>
Tested-by: Srikanth Aithal <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
  • Loading branch information
kraxel authored and mergify[bot] committed Apr 25, 2024
1 parent 90b6725 commit 66c2421
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions OvmfPkg/VirtHstiDxe/VirtHstiDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions OvmfPkg/VirtHstiDxe/VirtHstiDxe.inf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire

[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr
gUefiOvmfPkgTokenSpaceGuid.PcdBfvBase
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase

Expand Down

0 comments on commit 66c2421

Please sign in to comment.