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

[XEN RFC PATCH 03/40] xen/x86: Initialize memnodemapsize while faking NUMA node

  • To: <wei.chen@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>, <jbeulich@xxxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Wed, 11 Aug 2021 18:23:46 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); 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-SenderADCheck; bh=QSDZcA/RWL9vV9pltePO7Er9bgZ7P1bFBHq5K5ZpEXI=; b=ZEHZ3toKix3CIpK2RPqM8uDzvifc2a5Xipl70B4bVPF2y59A238cjh9jRutNiTumRtBRq8xrTTe/S2Yae0O22K5lEl5WkGGTM41AyOtMKsznSHG0a3q9uE7pV6zdmdnWPGYTxP88/b2nZt/IKLwS7fOEbOR6QmBC44KJaMIPbWCobPBRQcz6f9SVX4hCtS3fAOnWB2J1cvYWEpYZMkBW0JyJiv4x1/hwCstJSJZ/z9r9fPGqdO0nXvZf0EKruZgPbgPl8aIKuC+aYW6YsZegI9V3S/UBzbT9tugpsSz7OSoWvp/+sxOY8QPtkO5Pap4AwUEe/tw3gtYsxqmqiFJtUw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m+SEo2BeALNU/DnHnteFsidG4HambSxoZzxEs0OHRg2sKqI1xHkJ5f5OypcV54cbcDUWngZC5onVM+oSLBA2l1fYMnGo6JHJR7edozVHF0ez4jfxtEYIzHMx/n5dxtdaflW5aOsE3E0KvRJ4UmloUP7+D+tr/TaPvZtxGij/qDyAQTxDdFkIehgYwtFHsxgbjJwoTP5Vregdrk2fHzWXNK8KGiKFW8ImeuD4R1Z7tNv73eSOad+hTCCGMiK6dogBaFXIkvY5d0Gp9LJRKP37J4aQmMy0qiwkXflzYjq6UuCHTeSgpkzK0NgLqkkAthYwY+HODK2qqWVHvTiDlYSffg==
  • Cc: <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Wed, 11 Aug 2021 10:25:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

When system turns NUMA off or system lacks of NUMA support,
Xen will fake a NUMA node to make system works as a single
node NUMA system.

In this case the memory node map doesn't need to be allocated
from boot pages. But we should set the memnodemapsize to the
array size of _memnodemap. Xen hadn't done it, and Xen should
assert in phys_to_nid. But because x86 was using an empty
macro "VIRTUAL_BUG_ON" to replace ASSERT, this bug will not
be triggered.

In this patch, we set memnodemapsize to ARRAY_SIZE(_memnodemap)
to fix it.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
 xen/arch/x86/numa.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
index f1066c59c7..d23f4f7919 100644
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -270,6 +270,8 @@ void __init numa_initmem_init(unsigned long start_pfn, 
unsigned long end_pfn)
     /* setup dummy node covering all memory */
     memnode_shift = BITS_PER_LONG - 1;
     memnodemap = _memnodemap;
+    memnodemapsize = ARRAY_SIZE(_memnodemap);
     for ( i = 0; i < nr_cpu_ids; i++ )



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