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

[PATCH v2 04/17] xen/arm: use arch_get_ram_range to memory ranges from bootinfo


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Tue, 10 Jan 2023 16:49:17 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ukOHSyYJNGo1PvmsWwUlZnhKUtTLLuyk3pl7Z1kqbYk=; b=K7UlsP3WRXewE0HeGJh5m024Fc5+fKKtRzVbukGfy7iG4POxJJhgmuuA6tgkq5mY+odNsSXRoDc7/eORIwWftKFT3PlzNp2eUsD3j7IBLoy7QDkDKvurZSw/ftNi66BziT1NU0Hzx21yRXXllUrsSHAHrfJPzfoEKNm6Lj/Djvr3ohwAxoiTEWhWyWR0ivRvFLsfwS8f+noK23b4X11BXyFjSjTb9BEkAiJ4fpWejf+DamYUCOIX2j4Wk+SK93e/MEnDYpoeQUo/EFhBkVJOy1H+apMnbEqx5vuh2NcTpWu2iVTQrwtmc31bVBjlAu5WEPnRcuXJVZ5Cts6xaR5zDQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k49p0Ga7YSHbcTaLM2Yf/9a9ZP59cMtgjQBkE/WVtAwtE6NDu9XURdL5qrg5bD8UW78p6fcIbG59CItouubUY0kmPxs0YzEnCmYGas70O16RrdilfYOjNVLWCiqkMm8J0lzMZkN8JXc4GYCHgA6mVZucgnigC2pArN4eqQpEJNnhFkU5jgHeJxZDLwaXm77S9y8L4kX5YMaLntwieu/WBLnTKxSPcUJMzlkpqivGZOIUFkPvowpcIXk3PjpVJMUB8gseDMtMC30Yngbb3B1++NpgF+iMd9TYzd3cjZCQuX1Z13m0w5JbiVNZgEHALyKPKoeqTt8hAgdzYL0KNtFJmg==
  • Cc: <nd@xxxxxxx>, Wei Chen <wei.chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 10 Jan 2023 08:54:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

Implement the same helper "arch_get_ram_range" as x86 for NUMA
code to get memory bank from Arm bootinfo.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
---
v2 -> v3:
1. Use arch_get_ram_range instead of arch_get_memory_map.
v1 -> v2:
1. Use arch_get_memory_map to replace arch_get_memory_bank_range
   and arch_get_memory_bank_number.
---
 xen/arch/arm/numa.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c
index 34851ceacf..dcfcd85fcf 100644
--- a/xen/arch/arm/numa.c
+++ b/xen/arch/arm/numa.c
@@ -92,3 +92,14 @@ unsigned char __node_distance(nodeid_t from, nodeid_t to)
 }
 
 EXPORT_SYMBOL(__node_distance);
+
+int __init arch_get_ram_range(unsigned int idx, paddr_t *start, paddr_t *end)
+{
+    if ( idx >= bootinfo.mem.nr_banks )
+        return -ENOENT;
+
+    *start = bootinfo.mem.bank[idx].start;
+    *end = *start + bootinfo.mem.bank[idx].size;
+
+    return 0;
+}
-- 
2.25.1




 


Rackspace

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