@Xu, Min M, can you check if Gerd's comment is valid?

Gerd,
This Bugzilla captures the same idea: 
https://bugzilla.tianocore.org/show_bug.cgi?id=3394
Originally from Laszlo. +@Liu, Zhiguang who will work on patch submission later.

Thanks,
Ray

> -----Original Message-----
> From: kra...@redhat.com <kra...@redhat.com>
> Sent: Thursday, March 30, 2023 5:03 PM
> To: Ni, Ray <ray...@intel.com>
> Cc: devel@edk2.groups.io; Tom Lendacky <thomas.lenda...@amd.com>
> Subject: Re: [edk2-devel] [PATCH 0/6] Substract TME-MK KEY_ID_BITS from CPU 
> max PA
> 
>   Hi,
> 
> > For tdx, the actual max physical address bits is decreased by the 
> > KEY_ID_BITS bits.
> > But the max physical address bits reported from CPUID instruction don't 
> > change.
> 
> I guess the physical address bits calculation for tdx needs adjustment
> then.  Right now we have:
> 
>   if (TdIsEnabled ()) {
>     if (TdSharedPageMask () == (1ULL << 47)) {
>       PhysMemAddressWidth = 48;
>     } else {
>       PhysMemAddressWidth = 52;
>     }
>   }
> 
> 
> See PlatformAddressWidthInitialization() in PlatformInitLib/MemDetect.c
> 
> Which would be the third place needing the same logic.  Maybe worth
> thinking about a helper function in a library somewhere, so we don't
> cut&paste the same code snippet again and again ...
> 
> take care,
>   Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102242): https://edk2.groups.io/g/devel/message/102242
Mute This Topic: https://groups.io/mt/97767965/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to