public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "sunceping" <cepingx.sun@intel.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Aktas, Erdem" <erdemaktas@google.com>,
	James Bottomley <jejb@linux.ibm.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>,
	"Xu, Min M" <min.m.xu@intel.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Michael Roth <michael.roth@amd.com>
Subject: Re: [edk2-devel] [PATCH V1 2/2] OvmfPkg/BaseMemEncryptTdxLib: Handle retry result of MapGPA
Date: Mon, 30 Oct 2023 02:26:02 +0000	[thread overview]
Message-ID: <SN6PR11MB2783224437DD2DFF3DC6AF6EE7A1A@SN6PR11MB2783.namprd11.prod.outlook.com> (raw)
In-Reply-To: <wy4g4fcfirm2uk7dj5fao4pdfhb5wxqx6qrxkd3s3pdht45mmv@5azzhai65imv>

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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2023-10-30  2:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-27  0:57 [edk2-devel] [PATCH V1 0/2] OvmfPkg/BaseMemEncryptTdxLib: Handle retry result of MapGPA sunceping
2023-10-27  0:57 ` [edk2-devel] [PATCH V1 1/2] OvmfPkg/BaseMemEncryptTdxLib: Add TdVmCallMapGPA sunceping
2023-10-27  0:57 ` [edk2-devel] [PATCH V1 2/2] OvmfPkg/BaseMemEncryptTdxLib: Handle retry result of MapGPA sunceping
2023-10-27 11:04   ` Gerd Hoffmann
2023-10-30  2:26     ` sunceping [this message]
2023-10-27 16:44   ` Erdem Aktas via groups.io
2023-10-30  6:41     ` sunceping
2023-10-31  0:45       ` Erdem Aktas via groups.io
2023-10-31  7:46         ` sunceping
2023-11-02  9:25         ` sunceping

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SN6PR11MB2783224437DD2DFF3DC6AF6EE7A1A@SN6PR11MB2783.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox