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

[PATCH 13/16] x86/shadow: vCPU-s never have "no mode"


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 22 Mar 2023 10:36:29 +0100
  • 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=49lynVsPvUKe3NRmbj2l3SPJzRr48ByaR2NLWqRe4tA=; b=AeoLxzGN8qDvBh7cHyW6B76s/aSaTnXXEFIurjH3hhZ6vVRBUe6Ft+s48Nc624LwfBCqjQBuQ561fsY7i/Tt0jBiNx7UMclCcYwRNC51aD67dETf7lEsLO6C/r7zsU2b1vSSFVrR+BDpQZvFETkE5x29X+nDmOqllKt2ZI09Ra4jJwadAHwQhmStiypGBfKsC/2LIx/Qp6UzRw4ZrHKwdko/Jletuufb5060ujZ3LEG90xLNZ2MpPMfxa7DOds7EfSwidB72McQX8nnpR+AltmrcRTFsoPn3TEVUYc6ytMwFoRMb9nkid7uSGzHfS3zM24rTBZOo3jWLHhwZ/s5TvA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bqWKzpJs2zGFEQpjTbCLJhH45ge/vnrvMXDsrMze0I7fT/E3u+fNB6iT6L+WAoHfjNmxZDZl5Pg5Z/Cqzk4H7k+KQr+yExP8OX8EiLelo4pYgoJ752gsjESCAhj93Ghr/sVcy2AQxnaAiDo3vcDjyeG2CiDvOOGJi65o5OMNEbD7Q3EqcobBSgphZQaE3sz79WUj4KADh+2ccAZDMNwpm5dPvWZKRfgE49Hu9nNXKJDUHyKPl4Uin7F0sjI6SD2rxGLiaya/jv4YnUEDQGJzDOjgJGRn00IakOoPsuMgEJUC/ZXlbxCrFvIKymPVfUhMEI+KYw0t8lOp17WzhdN2tQ==
  • 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: Wed, 22 Mar 2023 09:36:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

With an initial mode installed by shadow_vcpu_init(), there's no need
for sh_update_paging_modes() to deal with the "mode is still unset"
case. Leave an assertion, though.

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

--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1864,6 +1864,8 @@ static void sh_update_paging_modes(struc
             make_cr3(v, mmfn);
             hvm_update_host_cr3(v);
         }
+        else if ( !old_mode )
+            ASSERT_UNREACHABLE();
         else if ( v->arch.paging.mode != old_mode )
         {
             SHADOW_PRINTK("new paging mode: %pv pe=%d gl=%u "
@@ -1872,11 +1874,10 @@ static void sh_update_paging_modes(struc
                           hvm_paging_enabled(v),
                           v->arch.paging.mode->guest_levels,
                           v->arch.paging.mode->shadow.shadow_levels,
-                          old_mode ? old_mode->guest_levels : 0,
-                          old_mode ? old_mode->shadow.shadow_levels : 0);
-            if ( old_mode &&
-                 (v->arch.paging.mode->shadow.shadow_levels !=
-                  old_mode->shadow.shadow_levels) )
+                          old_mode->guest_levels,
+                          old_mode->shadow.shadow_levels);
+            if ( v->arch.paging.mode->shadow.shadow_levels !=
+                 old_mode->shadow.shadow_levels )
             {
                 /* Need to make a new monitor table for the new mode */
                 mfn_t new_mfn, old_mfn;




 


Rackspace

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