mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-12 08:14:25 +02:00
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 ()) {
|
if (TdIsEnabled ()) {
|
||||||
PlatformInfoHob->PcdConfidentialComputingGuestAttr = CCAttrIntelTdx;
|
PlatformInfoHob->PcdConfidentialComputingGuestAttr = CCAttrIntelTdx;
|
||||||
PlatformInfoHob->PcdTdxSharedBitMask = TdSharedPageMask ();
|
PlatformInfoHob->PcdTdxSharedBitMask = TdSharedPageMask ();
|
||||||
PlatformInfoHob->PcdSetNxForStack = TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PlatformMiscInitialization (PlatformInfoHob);
|
PlatformMiscInitialization (PlatformInfoHob);
|
||||||
|
@ -261,6 +261,11 @@ PlatformNoexecDxeInitialization (
|
|||||||
IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob
|
IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
if (TdIsEnabled ()) {
|
||||||
|
PlatformInfoHob->PcdSetNxForStack = TRUE;
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
return QemuFwCfgParseBool ("opt/ovmf/PcdSetNxForStack", &PlatformInfoHob->PcdSetNxForStack);
|
return QemuFwCfgParseBool ("opt/ovmf/PcdSetNxForStack", &PlatformInfoHob->PcdSetNxForStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,5 @@ IntelTdxInitialize (
|
|||||||
PcdStatus = PcdSet64S (PcdTdxSharedBitMask, TdSharedPageMask ());
|
PcdStatus = PcdSet64S (PcdTdxSharedBitMask, TdSharedPageMask ());
|
||||||
ASSERT_RETURN_ERROR (PcdStatus);
|
ASSERT_RETURN_ERROR (PcdStatus);
|
||||||
|
|
||||||
PcdStatus = PcdSetBoolS (PcdSetNxForStack, TRUE);
|
|
||||||
ASSERT_RETURN_ERROR (PcdStatus);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user