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

[PATCH v2 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: Tue, 19 Jul 2022 08:51:25 +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=Hoh3lq6XiDGPbxbdRPnX4ZUDdj9Bw3XDgWqBsQsBiLHGOXvMMRm+1hRGxU+fXVE11h9gMqFLTXEJdHcXvO+GJ8D/t1nL2Zf3swuS8/yl1NA43RxfDZBDYC6hb98rihtD1dGCLN38rB26jqwp1p6iT9IB2eqL/e/7T+L5ODoIf+YCTxVljja1hgTsSFMv4mr2VI8FA+on2Qs/EfLwq0HzYgdNOuH77j/I65SM3j9+xpgAW/mmPvcSyUmiifS3MaTIpRPO9T6WqRqzCI3v3Cz931Dox/KHvXiGE4+Vie/mDy1CLOj0BtgRFwlUvwpHlC+03/R9m/BpuEeYxyCr6WlUag==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KbiE3zWVC5WVler8SD89pel9wCvicZ9R1afzRi8659kChHWxmLiiaYpi3rsRei5wW/QBNodj8k6PXqKHMdHYbSBDW7H+GLBpO2XcoGFb26Zv934WYXq8yOpdK8vMLi0qjfmxiJXYwVenQD8S2KFjv5HIDmfUEgb5UBOM6m2Z39m2ZySD152/aGRdnlHTQ/+Uqc4FWiP3bAyxuheuHt+cRdH/HJrEysdMdZCCBXwoGKyH5JyCglrFaKb/b6Yuy1DSBuVxUtA7v8VuE2Xd07Ado6B4gz+/oF/8P3ZDII5NmpHWoSIvq8H7CNumRGL5JK3yfgXVa5/SNia8K2YPGPx9Qg==
  • 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: Tue, 19 Jul 2022 06:51:31 +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®.