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

[PATCH 5/8] x86/PV: drop dead paging_update_paging_modes() call during Dom0 construction


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 21 Dec 2022 14:27:04 +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=jPAPBzI9r0Pqf/DLCl5qsysEb208XfAwkfak1FQmFWM=; b=QmRsU/yCwgLfZ/bfqg6j/gaG/B7VZzRjk9a+2oAl+5jOaTSIf7Qc0lJU7dbVROUQJ3J2Nh90cRuD5D7Rx4kanXDETUsVDlPwPfv01K/b3nTYboxd1iyOgSsH2vHg9sn9yLh48/bSiNaDTVOgVmVVyJgMVFZTMmYxCEkQ3GD5s3dYguADDn7rpoeLdimngg1Igo3+VWKZ8a2gEsmzjevZXisupiNophqFBonD2InGeecON2olpXiA12ZdDKDHlvqWVONEZIgOaaXrviDR5/VpOm+SnTC+s9zUYS/H0n9ePZ4kYiSdlmCxKSwOrhBuGVqO60XQg9h2qAtXL7RYWC3GDA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JVBYdeP0b0vu5GDPEmIxp52blEfH7yDoGx/+aaj+prhwyYdRO8Yjqnys1vmnGC/KZAB/rCABgEegYcByHDNE3/cdcxa/CqOba3Jn2xOfG5btznojXHlpz/UECpJcZzbuv1Y5GGlUAZ8Y+zcFspjL9wYioh6JitsMvjfOkoa618Ou7UnEbm4ciXAk2oLE3HJh3qAdELgLFLnOvWJjJSUz6xLq2ra3Jl1dqDFqaS2zLe6YJso5G+mBiSzumAXgG2IErXmg9KT+1b1JcQa0LfHvAIKwEarlWRSIsyoaEY4KoUgSbMNHR4DXQSD33dkT28wHbxshy1LsSiNbQ2ffbap7YA==
  • 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, 21 Dec 2022 13:35:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The function won't ever be invoked, as paging_mode_enabled() always
returns false here due to the immediately preceding clearing of
d->arch.paging.mode. While compilers recognize this and eliminate the
call, make this explicit in the source (which likely 9a28170f2da2 ["pvh
dom0: construct_dom0 changes"] should have done right away, albeit even
before that the call looks to have been pointless - shadow mode enabling
has occurred later virtually forever).

While there also update an adjacent partly stale comment.

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

--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -10,7 +10,6 @@
 #include <xen/init.h>
 #include <xen/libelf.h>
 #include <xen/multiboot.h>
-#include <xen/paging.h>
 #include <xen/pfn.h>
 #include <xen/sched.h>
 #include <xen/softirq.h>
@@ -804,11 +803,8 @@ int __init dom0_construct_pv(struct doma
 
     d->arch.paging.mode = 0;
 
-    /* Set up CR3 value for write_ptbase */
-    if ( paging_mode_enabled(d) )
-        paging_update_paging_modes(v);
-    else
-        update_cr3(v);
+    /* Set up CR3 value for switch_cr3_cr4(). */
+    update_cr3(v);
 
     /* We run on dom0's page tables for the final part of the build process. */
     switch_cr3_cr4(cr3_pa(v->arch.cr3), read_cr4());




 


Rackspace

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