mirror of https://github.com/acidanthera/audk.git
OvmfPkg: Refactor PcdSetNxForStack usage in TDVF
In the current code, TDVF reads the PcdSetNxForStack value via fw_cfg , but overwrites it with a fixed value after the read is complete. In this patch, TDVF removes the redundant logic code. 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>
This commit is contained in:
parent
a1b0703e8e
commit
9d5a9940e4
|
@ -109,7 +109,6 @@ InitializePlatform (
|
|||
if (TdIsEnabled ()) {
|
||||
PlatformInfoHob->PcdConfidentialComputingGuestAttr = CCAttrIntelTdx;
|
||||
PlatformInfoHob->PcdTdxSharedBitMask = TdSharedPageMask ();
|
||||
PlatformInfoHob->PcdSetNxForStack = TRUE;
|
||||
}
|
||||
|
||||
PlatformMiscInitialization (PlatformInfoHob);
|
||||
|
|
|
@ -261,6 +261,11 @@ PlatformNoexecDxeInitialization (
|
|||
IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob
|
||||
)
|
||||
{
|
||||
if (TdIsEnabled ()) {
|
||||
PlatformInfoHob->PcdSetNxForStack = TRUE;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
return QemuFwCfgParseBool ("opt/ovmf/PcdSetNxForStack", &PlatformInfoHob->PcdSetNxForStack);
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,5 @@ IntelTdxInitialize (
|
|||
PcdStatus = PcdSet64S (PcdTdxSharedBitMask, TdSharedPageMask ());
|
||||
ASSERT_RETURN_ERROR (PcdStatus);
|
||||
|
||||
PcdStatus = PcdSetBoolS (PcdSetNxForStack, TRUE);
|
||||
ASSERT_RETURN_ERROR (PcdStatus);
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue