On 12/13/22 18:02, Xu, Min M wrote:
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...@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?

If I add a check for mReservedSharedMemSupported at the start of the funciton and return early if FALSE, then I don't experience a crash.

Thanks,
Tom


Thanks
Min


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


Reply via email to