[edk2-devel] [PATCH 0/6] Substract TME-MK KEY_ID_BITS from CPU max PA

Gerd Hoffmann kraxel at redhat.com
Thu Mar 30 09:03:29 UTC 2023


  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 (#102165): https://edk2.groups.io/g/devel/message/102165
Mute This Topic: https://groups.io/mt/97767965/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