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

[PATCH 6/8] x86/shadow: drop CONFIG_HVM conditionals from sh_update_cr3()


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 26 Jul 2022 18:06: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=td/gCrrRCkDZYLC/FRwdlmkxYPkOjvQqTnNypaVN5WA=; b=mNcrB+BlOKWKXGLQlNCKFc7rp4A22OqLxuyW/smUFzj23y8OgDJy0iDSnqY72lSUIFsM0inSYIctHRZUEPlUraFQKqx3aTNFsoMpAfPhg94SJ1O/cR4+DmChCSFAF17SsDEKZpovtbGVAaWD16xj51auMHnib6UcrKT1U/vUtnh/AC+cRgqbEWgFk3VrlLSYcq/+kzK1IyfQZhSpSMfbuCc0aK+YlbqTyky6iTpscHWOTOpqnYDp6ZQsO/X+yVbdNQhp+g/Y1rFcJGt0vhdFKiqsT3ls0zT2G0BPWI2vLRtsnAeY/QaJfn+ti4uzHjX5jVGszY3KAzpDj9dnW2Aqug==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qz5cIIKurAc6jEq8H27vU6WZrLmn9Hs/L1M0bEHSRlUaEjDssZx8vFC7mRk7QA0e9WTbdcekJlua+ElCF6UJfElkfOWzNITFKHCkUgOy0fh3cQeW5CXgk8EQZRyHnphcqUvNsSw0hCHr2aywUVGYGNAr1SAEofQI02iCIIIfzVCiWo66km/maB1VO5jDHxzbqYWact2eGFcxk9S1x6w9pTLoz9dRg9CVRXr/8im5t4c5qlsby+odEv3aIAWX8lj82wSyEY5EcgAaFdztEW5oooLMQecBRYQhHYpkX9MAWnQB40lGbbsvwWIWQRdC1P+e6/IVWj4YFkR7bDdWiH++kg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>
  • Delivery-date: Tue, 26 Jul 2022 16:06:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Now that we're not building multi.c anymore for 2 and 3 guest levels
when !HVM, there's no point in having these conditionals anymore. (As
somewhat a special case, the last of the removed conditionals really
builds on shadow_mode_external() always returning false when !HVM.) This
way the code becomes a tiny bit more readable.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -3228,7 +3228,7 @@ static void cf_check sh_update_cr3(struc
 {
     struct domain *d = v->domain;
     mfn_t gmfn;
-#if GUEST_PAGING_LEVELS == 3 && defined(CONFIG_HVM)
+#if GUEST_PAGING_LEVELS == 3
     const guest_l3e_t *gl3e;
     unsigned int i, guest_idx;
 #endif
@@ -3279,7 +3279,7 @@ static void cf_check sh_update_cr3(struc
 #endif
         gmfn = pagetable_get_mfn(v->arch.guest_table);
 
-#if GUEST_PAGING_LEVELS == 3 && defined(CONFIG_HVM)
+#if GUEST_PAGING_LEVELS == 3
     /*
      * On PAE guests we don't use a mapping of the guest's own top-level
      * table.  We cache the current state of that table and shadow that,
@@ -3321,8 +3321,6 @@ static void cf_check sh_update_cr3(struc
                   !VM_ASSIST(d, m2p_strict) )
             fill_ro_mpt(smfn);
     }
-#elif !defined(CONFIG_HVM)
-    ASSERT_UNREACHABLE();
 #elif GUEST_PAGING_LEVELS == 3
     /* PAE guests have four shadow_table entries, based on the
      * current values of the guest's four l3es. */
@@ -3373,8 +3371,6 @@ static void cf_check sh_update_cr3(struc
 #error This should never happen
 #endif
 
-
-#ifdef CONFIG_HVM
     ///
     /// v->arch.paging.shadow.l3table
     ///
@@ -3400,7 +3396,6 @@ static void cf_check sh_update_cr3(struc
             }
         }
 #endif /* SHADOW_PAGING_LEVELS == 3 */
-#endif /* CONFIG_HVM */
 
     ///
     /// v->arch.cr3
@@ -3419,8 +3414,6 @@ static void cf_check sh_update_cr3(struc
     }
 #endif
 
-
-#ifdef CONFIG_HVM
     ///
     /// v->arch.hvm.hw_cr[3]
     ///
@@ -3437,7 +3430,6 @@ static void cf_check sh_update_cr3(struc
 #endif
         hvm_update_guest_cr3(v, noflush);
     }
-#endif /* CONFIG_HVM */
 
     /* Fix up the linear pagetable mappings */
     sh_update_linear_entries(v);




 


Rackspace

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