[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v3 1/4] x86/shadow: slightly consolidate sh_unshadow_for_p2m_change() (part I)


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 12 Aug 2022 09:44:03 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=paHBxFxNPQQaCR96HVsNx65Tk5J0VvsjBSY4OoT4Sio=; b=Tp+H6IiCm/RMBQHmEMAZ64bSPuUBOHzBzAAkADHCYjNuwxDcBGkwCBFj35PO6eMoDg1quRd9Cmuu/y+46y6SkwLwzsr5g8TQzaElXFnIZSUx75qDOzFNPE2tQ3/yDpIkH3rbEanXgwfHpUlYWdMEtcH4nSMMbzy+8waAZFmC/ii4P8QydEjkMCswufCCQNWsSTKm3wseA29EpsX/33tHli8V+SvCzVEStE5f7g5NnXbELRf+S5j5xcCkDaRm99Qtc99cD/uysuiHA4WydfyjDSN/7rRSsI7qr7Z0Me3XyGkAFZyJkSSayKNm+1UTaInb0GnVCUoTIJa/5qjzAm76Rw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ve0QKPbzJcgIbaYkhss5zZTtK7/e52sm3KcxdnJjJOJQLRO1fuwBTUkrbMtXwn+zqPau4Ed3pOP4P+IDprhl7y036IiAt2PXvVdYBCPs+6oxlZUiDnq06aSWgRCBNhKpQq7h5kE4Qymit2VPDSbfcOnJyvTs30GesaDfAY/k4E/D0yaL5o30ego+tlu8QxGDA8yPmpqHKdjmDL3+S+LMYOdRNFoQezOIu9U0EHuYo0LEedSZekpEz3+lhtTM7x1xCwyI2g/uSjFb/0GjWexN7XWPjSwvbya6W4zO0gklKKNhKxpN/WU/3loNRS0IcBAj0/KQavZ3SHg0OOPckLek8Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>
  • Delivery-date: Fri, 12 Aug 2022 07:44:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Replace a p2m_is_ram() check in the 2M case by an explicit _PAGE_PRESENT
one, to make more obvious that the subsequent l1e_get_mfn() actually
retrieves something that really is an MFN. It doesn't really matter
whether it's RAM, as the subsequent comparison with the original MFN is
going to lead to zapping of everything except the "same MFN again" case.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
v2: Split from previous bigger patch.

--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -856,7 +856,7 @@ static void cf_check sh_unshadow_for_p2m
             for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
             {
                 if ( !npte ||
-                     !p2m_is_ram(p2m_flags_to_type(l1e_get_flags(npte[i]))) ||
+                     !(l1e_get_flags(npte[i]) & _PAGE_PRESENT) ||
                      !mfn_eq(l1e_get_mfn(npte[i]), omfn) )
                 {
                     /* This GFN->MFN mapping has gone away */




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.