[edk2-devel] [PATCH V1 2/2] OvmfPkg/BaseMemEncryptTdxLib: Handle retry result of MapGPA

sunceping cepingx.sun at intel.com
Mon Oct 30 02:26:02 UTC 2023


On Friday, October 27, 2023 7:05 PM, Gerd Hoffmann wrote:
> > +  while (RetryCount < MAX_RETRIES_PER_PAGE) {
> > +    TdStatus = TdVmCallMapGPA (PhysicalAddress, Length,
> &MapGpaRetryaddr);
> > +    if (TdStatus != TDVMCALL_STATUS_RETRY) {
> > +      break;
> > +    }
> > +
> > +    DEBUG ((DEBUG_VERBOSE, "%a: TdVmcall(MAPGPA) Retry
> > + PhysicalAddress is %llx, MapGpaRetryaddr is %llx\n", __func__,
> > + PhysicalAddress, MapGpaRetryaddr));
> > +
> > +    EndAddress = PhysicalAddress + Length;
> 
> The end address doesn't change, you can move that out of the loop.
It would be updated in next version.

> 
> > +    if ((MapGpaRetryaddr < PhysicalAddress) || (MapGpaRetryaddr >
> EndAddress)) {
> > +      DEBUG ((DEBUG_ERROR, "%a: TdVmcall(MAPGPA) failed Retry
> PhysicalAddress is %llx, MapGpaRetryaddr is %llx\n", __func__,
> PhysicalAddress, MapGpaRetryaddr));
> > +      break;
> > +    }
> 
> The error message is misleading.  The actual problem is that the
> 'PhysicalAddress <= MapGpaRetryaddr <= EndAddress' sanity check failed.
The error message would be updated in next version.

> 

Thanks 
Ceping


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110283): https://edk2.groups.io/g/devel/message/110283
Mute This Topic: https://groups.io/mt/102212640/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