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

[PATCH 15/16] x86/shadow: adjust monitor table prealloc amount


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 22 Mar 2023 10:37:31 +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=X1l2fkRqRJiGKZyq0x1zbIscrbjHpZaIQjMcBMuPrbQ=; b=JMKjwBrSJO65IKZH/NCdMBPxQcrN4VQVMy6Y5CmzvWuuMmOPyfIPDOJS+h2kMhC/R0KDr0mJgPxDl51gmwLUfZ3tjOIz4VB8GYSpl1Mg6lckPDuMdLE0Hu8g50zat38MFFQoS1z/lNx+vnHPxB4uW2L+pRILjXwDudUEMhTUoyeRFcX0hVyCByjOYsoqn5fr7mbVslbMFHo1gytIQggUxk0pwf2zmFQDe/24nwbcVPOOKpf1FoibEvJxpwp0JxPpGevmFt0/SaSXZj0qIZp3k0fxkLEs36ieIish/bNAYXS/AAddO5MDdYP1Kplxu1HQxxTaghMKEJzLhds9zAvbWQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cI7S7CPhKoPrfD9dU5uug1veAm9R4yfrbNNiUyRUFA5MU0pq2NieJzVjiykeETrjtVvnpYubxfof6vum3lJZpUzQMuPLVh67yG48lNs+92P5sfOxBUWG9LS1LzjgOwgnvJPZyzbtu8mSpC9QtWNcF0V1CoSO6ROHFBLDX+qLvQjD4sKTcfCjtcgnHRl0eVc6wjqNWdF9EpbnbzZRw6txJUeqA8WdW0hq9zOFz5xJiljPJyPiuOB2coOuL7RMFk6mtjtFAm1QWNkcOPgo1cXPQC6vX3yDJjYOdH+ouFuA754XTEW1zLwQX41Euu6DpYjrYh8U36va8Yh5tdsIayQobw==
  • 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:37:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

While 670d6b908ff2 ('x86 shadow: Move the shadow linear mapping for
n-on-3-on-4 shadows so') bumped the amount by one too little for the
32-on-64 case (which luckily was dead code, and hence a bump wasn't
necessary in the first place), 0b841314dace ('x86/shadow:
sh_{make,destroy}_monitor_table() are "even more" HVM-only'), dropping
the dead code, then didn't adjust the amount back. Yet even the original
amount was too high in certain cases. Switch to pre-allocating just as
much as is going to be needed.

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

--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -738,7 +738,7 @@ mfn_t sh_make_monitor_table(const struct
     ASSERT(!pagetable_get_pfn(v->arch.hvm.monitor_table));
 
     /* Guarantee we can get the memory we need */
-    if ( !shadow_prealloc(d, SH_type_monitor_table, CONFIG_PAGING_LEVELS) )
+    if ( !shadow_prealloc(d, SH_type_monitor_table, shadow_levels < 4 ? 3 : 1) 
)
         return INVALID_MFN;
 
     m4mfn = shadow_alloc(d, SH_type_monitor_table, 0);




 


Rackspace

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