Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions MsvmPkg/AziHsmDxe/AziHsmDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "AziHsmAdmin.h"

#include <Library/DebugLib.h>
#include <Library/PcdLib.h>

#include <Protocol/DevicePath.h>
#include <Protocol/DriverSupportedEfiVersion.h>
Expand Down Expand Up @@ -1147,6 +1148,14 @@ AziHsmDriverEntry (
AZIHSM_BUFFER TpmDerivedSecretBlob;
AZIHSM_BUFFER SealedSecretBlob;

//
// Check if AziHsm is enabled via PCD
//
if (!PcdGetBool (PcdAziHsmEnabled)) {
DEBUG ((DEBUG_INFO, "AziHsm: Driver disabled via PcdAziHsmEnabled\n"));
return EFI_SUCCESS;
}

ZeroMem (&TpmDerivedSecret, sizeof (TpmDerivedSecret));
ZeroMem (&TpmDerivedSecretBlob, sizeof (TpmDerivedSecretBlob));
ZeroMem (&SealedSecretBlob, sizeof (SealedSecretBlob));
Expand Down
5 changes: 5 additions & 0 deletions MsvmPkg/AziHsmDxe/AziHsmDxe.inf
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
BaseLib
DebugLib
MemoryAllocationLib
PcdLib
TpmMeasurementLib
UefiDriverEntryPoint
UefiBootServicesTableLib
Expand All @@ -83,8 +84,12 @@
gMsvmUnableToBootEventGuid

[Pcd]
gMsvmPkgTokenSpaceGuid.PcdAziHsmEnabled
gMsvmPkgTokenSpaceGuid.PcdIsolationSharedGpaBoundary
gMsvmPkgTokenSpaceGuid.PcdIsolationSharedGpaCanonicalizationBitmask

[UserExtensions.TianoCore."ExtraFiles"]
AziHsmDxe.uni

[Depex]
gEfiTcg2ProtocolGuid
3 changes: 2 additions & 1 deletion MsvmPkg/Include/BiosInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,8 @@ typedef struct _UEFI_CONFIG_FLAGS
UINT64 CxlMemoryEnabled : 1;
UINT64 MtrrsInitializedAtLoad : 1;
UINT64 HvSintEnabled : 1;
UINT64 Reserved:34;
UINT64 AziHsmEnabled : 1;
UINT64 Reserved:33;
} Flags;
} UEFI_CONFIG_FLAGS;

Expand Down
1 change: 1 addition & 0 deletions MsvmPkg/MsvmPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
gMsvmPkgTokenSpaceGuid.PcdMtrrsInitializedAtLoad|FALSE|BOOLEAN|0x6067
gMsvmPkgTokenSpaceGuid.PcdNvmeNamespaceFilter|FALSE|BOOLEAN|0x6068
gMsvmPkgTokenSpaceGuid.PcdHvSintEnabled|FALSE|BOOLEAN|0x6069
gMsvmPkgTokenSpaceGuid.PcdAziHsmEnabled|FALSE|BOOLEAN|0x6072

# UEFI_CONFIG_PROCESSOR_INFORMATION
gMsvmPkgTokenSpaceGuid.PcdProcessorCount|0x0|UINT32|0x6032
Expand Down
1 change: 1 addition & 0 deletions MsvmPkg/MsvmPkgAARCH64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@
gMsvmPkgTokenSpaceGuid.PcdHostEmulatorsWhenHardwareIsolated|FALSE
gMsvmPkgTokenSpaceGuid.PcdTpmLocalityRegsEnabled|FALSE
gMsvmPkgTokenSpaceGuid.PcdHvSintEnabled|FALSE
gMsvmPkgTokenSpaceGuid.PcdAziHsmEnabled|FALSE

# UEFI_CONFIG_PROCESSOR_INFORMATION
gMsvmPkgTokenSpaceGuid.PcdProcessorCount|0x0
Expand Down
2 changes: 1 addition & 1 deletion MsvmPkg/MsvmPkgX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@
gMsvmPkgTokenSpaceGuid.PcdWatchdogEnabled|FALSE
gMsvmPkgTokenSpaceGuid.PcdHostEmulatorsWhenHardwareIsolated|FALSE
gMsvmPkgTokenSpaceGuid.PcdTpmLocalityRegsEnabled|FALSE

gMsvmPkgTokenSpaceGuid.PcdAziHsmEnabled|FALSE

# UEFI_CONFIG_PROCESSOR_INFORMATION
gMsvmPkgTokenSpaceGuid.PcdProcessorCount|0x0
Expand Down
2 changes: 2 additions & 0 deletions MsvmPkg/PlatformPei/Config.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ DebugDumpUefiConfigStruct(
DEBUG((DEBUG_VERBOSE, "\tTpmLocalityRegsEnabled: %u\n", flags->Flags.TpmLocalityRegsEnabled));
DEBUG((DEBUG_VERBOSE, "\tMtrrsInitializedAtLoad: %u\n", flags->Flags.MtrrsInitializedAtLoad));
DEBUG((DEBUG_VERBOSE, "\tHvSintEnabled: %u\n", flags->Flags.HvSintEnabled));
DEBUG((DEBUG_VERBOSE, "\tAziHsmEnabled: %u\n", flags->Flags.AziHsmEnabled));
break;

case UefiConfigProcessorInformation:
Expand Down Expand Up @@ -899,6 +900,7 @@ ConfigSetUefiConfigFlags(
PEI_FAIL_FAST_IF_FAILED(PcdSetBoolS(PcdTpmLocalityRegsEnabled, (UINT8) ConfigFlags->Flags.TpmLocalityRegsEnabled));
PEI_FAIL_FAST_IF_FAILED(PcdSetBoolS(PcdMtrrsInitializedAtLoad, (UINT8) ConfigFlags->Flags.MtrrsInitializedAtLoad));
PEI_FAIL_FAST_IF_FAILED(PcdSetBoolS(PcdHvSintEnabled, (UINT8) ConfigFlags->Flags.HvSintEnabled));
PEI_FAIL_FAST_IF_FAILED(PcdSetBoolS(PcdAziHsmEnabled, (UINT8) ConfigFlags->Flags.AziHsmEnabled));

//
// If memory protections are enabled, configure the value into the HOB.
Expand Down
1 change: 1 addition & 0 deletions MsvmPkg/PlatformPei/PlatformPei.inf
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@
gMsvmPkgTokenSpaceGuid.PcdMtrrsInitializedAtLoad
gMsvmPkgTokenSpaceGuid.PcdNvmeNamespaceFilter
gMsvmPkgTokenSpaceGuid.PcdHvSintEnabled
gMsvmPkgTokenSpaceGuid.PcdAziHsmEnabled

[Pcd.AArch64]
gMsvmPkgTokenSpaceGuid.PcdSystemMemoryBaseAddress
Expand Down