public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Min Xu" <min.m.xu@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"thomas.lendacky@amd.com" <thomas.lendacky@amd.com>
Cc: "Aktas, Erdem" <erdemaktas@google.com>,
	James Bottomley <jejb@linux.ibm.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [edk2-devel] [PATCH V2 1/4] OvmfPkg/IoMmuDxe: Reserve shared memory region for DMA operation
Date: Wed, 14 Dec 2022 00:02:28 +0000	[thread overview]
Message-ID: <SJ0PR11MB5069F8306E71FBE854ACA1B3C5E09@SJ0PR11MB5069.namprd11.prod.outlook.com> (raw)
In-Reply-To: <f5640efe-8d00-0574-090c-46112f96c652@amd.com>

On December 14, 2022 12:04 AM, Lendacky, Thomas wrote:
> 
> On 12/12/22 23:48, Min Xu wrote:
> > From: Min M Xu <min.m.xu@intel.com>
> > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4171
> >
> 
> This patch causes crashes for SEV guests and breaks bisect-ability of the
> EDK2 tree. See below...
> 
> >   /**
> > @@ -878,6 +860,11 @@ IoMmuUnmapAllMappings (
> >         TRUE      // MemoryMapLocked
> >         );
> >     }
> > +
> > +  //
> > +  // Release the reserved shared memory as well.
> > +  //
> > +  IoMmuReleaseReservedSharedMem (TRUE);
> 
> This call is the reason for the crash. You'll need to check for whether there
> has been any shared memory reserved before attempting to free it (in the
> case of SEV that doesn't happen until patch #3 of the series). I think adding
> the check in IoMmuReleaseReservedSharedMem() itself might be best, since
> you can also experience this crash should the below allocation fail, too.
> 
Ah, yes. In IoMmuReleaseReservedSharedMem we should first check mReservedSharedMemSupported to see if there is any reserved memory. I test it in my side and there is no crash. 
Tom, if this check is added, do you experience any crash?

Thanks
Min

  reply	other threads:[~2022-12-14  0:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-13  5:48 [PATCH V2 0/4] Reserve shared memory for DMA operation Min Xu
2022-12-13  5:48 ` [PATCH V2 1/4] OvmfPkg/IoMmuDxe: Reserve shared memory region " Min Xu
2022-12-13 16:04   ` Lendacky, Thomas
2022-12-14  0:02     ` Min Xu [this message]
2022-12-14 14:24       ` [edk2-devel] " Lendacky, Thomas
2022-12-13  5:48 ` [PATCH V2 2/4] OvmfPkg/IoMmuDxe: Rename AmdSevIoMmu to CcIoMmu Min Xu
2022-12-13  5:48 ` [PATCH V2 3/4] OvmfPkg/IoMmuDxe: Add SEV support for reserved shared memory Min Xu
2022-12-13 16:05   ` Lendacky, Thomas
2022-12-13 23:55     ` [edk2-devel] " Min Xu
2022-12-13  5:48 ` [PATCH V2 4/4] Maintainers: Update OvmfPkg/IoMmuDxe Min Xu
     [not found] ` <1730444AD2D72EE9.23954@groups.io>
2022-12-13  5:52   ` [edk2-devel] [PATCH V2 3/4] OvmfPkg/IoMmuDxe: Add SEV support for reserved shared memory Min Xu
2022-12-13 15:35     ` Lendacky, Thomas

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=SJ0PR11MB5069F8306E71FBE854ACA1B3C5E09@SJ0PR11MB5069.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