[edk2-devel] [PATCH V7 25/37] MdeModulePkg: EFER should not be changed in TDX
Min Xu
min.m.xu at intel.com
Fri Mar 4 00:18:56 UTC 2022
On March 3, 2022 11:12 AM, Wang Jian wrote:
>
> Hi Min,
>
> I think the PCD should not be dynamic. Dynamic PCD is used for those
> features which can be changed at boot time. But, for Intel processor, it
> should always stay as FALSE. So there's no need to make it dynamic.
> FixedAtBuild should be fine.
>
I realize this PCD is not necessary. According to [TDX] Sec 10.1.5, IA32_EFER.NXE is initialized to 1. So in the function EnableExecuteDisableBit @ MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c, we can check if BIT11 is set before calling AsmWriteMsr64. It looks like:
VOID EnableExecuteDisableBit ( VOID )
{
UINT64 MsrRegisters;
MsrRegisters = AsmReadMsr64 (0xC0000080);
if ((MsrRegisters & BIT11) == 0) {
MsrRegisters |= BIT11;
AsmWriteMsr64 (0xC0000080, MsrRegisters);
}
}
[TDX] https://www.intel.com/content/dam/develop/external/us/en/documents/tdx-module-1.0-public-spec-v0.931.pdf
Thanks
Min
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87270): https://edk2.groups.io/g/devel/message/87270
Mute This Topic: https://groups.io/mt/89446174/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list