From: vijay.kilari@gmail.com
To: julien.grall@arm.com, sstabellini@kernel.org,
andre.przywara@arm.com, dario.faggioli@citrix.com
Cc: xen-devel@lists.xenproject.org, Vijaya Kumar K <Vijaya.Kumar@cavium.com>
Subject: [RFC PATCH v1 04/21] NUMA: Refactor generic and arch specific code of numa_setup
Date: Thu, 9 Feb 2017 21:26:56 +0530 [thread overview]
Message-ID: <1486655834-9708-5-git-send-email-vijay.kilari@gmail.com> (raw)
In-Reply-To: <1486655834-9708-1-git-send-email-vijay.kilari@gmail.com>
From: Vijaya Kumar K <Vijaya.Kumar@cavium.com>
numa_setup() contains generic and arch specific code.
Split numa_setup() and move architecture specific code
under arch_numa_setup().
Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@cavium.com>
---
xen/arch/arm/Makefile | 1 +
xen/arch/arm/numa.c | 28 ++++++++++++++++++++++++++++
xen/arch/x86/numa.c | 11 +----------
xen/common/numa.c | 14 ++++++++++++++
xen/include/asm-arm/numa.h | 9 ++++++++-
xen/include/asm-x86/numa.h | 2 +-
xen/include/xen/numa.h | 1 +
7 files changed, 54 insertions(+), 12 deletions(-)
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 7afb8a3..b5d7a19 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -49,6 +49,7 @@ obj-y += vm_event.o
obj-y += vtimer.o
obj-y += vpsci.o
obj-y += vuart.o
+obj-$(CONFIG_NUMA) += numa.o
#obj-bin-y += ....o
diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c
new file mode 100644
index 0000000..59d09c7
--- /dev/null
+++ b/xen/arch/arm/numa.c
@@ -0,0 +1,28 @@
+/*
+ * ARM NUMA Implementation
+ *
+ * Copyright (C) 2016 - Cavium Inc.
+ * Vijaya Kumar K <vijaya.kumar@cavium.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <xen/init.h>
+#include <xen/ctype.h>
+#include <xen/mm.h>
+#include <xen/nodemask.h>
+#include <asm/mm.h>
+#include <xen/numa.h>
+
+int __init arch_numa_setup(char *opt)
+{
+ return 1;
+}
diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
index bc787e0..28d1891 100644
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -18,9 +18,6 @@
#include <xen/sched.h>
#include <xen/softirq.h>
-static int numa_setup(char *s);
-custom_param("numa", numa_setup);
-
#ifndef Dprintk
#define Dprintk(x...)
#endif
@@ -34,7 +31,6 @@ nodeid_t apicid_to_node[MAX_LOCAL_APIC] = {
nodemask_t __read_mostly node_online_map = { { [0] = 1UL } };
-bool_t numa_off = 0;
s8 acpi_numa = 0;
int srat_disabled(void)
@@ -145,13 +141,8 @@ void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn)
(u64)end_pfn << PAGE_SHIFT);
}
-/* [numa=off] */
-static __init int numa_setup(char *opt)
+int __init arch_numa_setup(char *opt)
{
- if ( !strncmp(opt,"off",3) )
- numa_off = 1;
- if ( !strncmp(opt,"on",2) )
- numa_off = 0;
#ifdef CONFIG_NUMA_EMU
if ( !strncmp(opt, "fake=", 5) )
{
diff --git a/xen/common/numa.c b/xen/common/numa.c
index 13f147c..9b9cf9c 100644
--- a/xen/common/numa.c
+++ b/xen/common/numa.c
@@ -32,6 +32,10 @@
#include <xen/softirq.h>
#include <asm/setup.h>
+static int numa_setup(char *s);
+custom_param("numa", numa_setup);
+
+bool_t numa_off = 0;
struct node_data node_data[MAX_NUMNODES];
/* Mapping from pdx to node id */
@@ -250,6 +254,16 @@ EXPORT_SYMBOL(memnode_shift);
EXPORT_SYMBOL(memnodemap);
EXPORT_SYMBOL(node_data);
+static __init int numa_setup(char *opt)
+{
+ if ( !strncmp(opt,"off",3) )
+ numa_off = 1;
+ if ( !strncmp(opt,"on",2) )
+ numa_off = 0;
+
+ return arch_numa_setup(opt);
+}
+
static void dump_numa(unsigned char key)
{
s_time_t now = NOW();
diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
index a60c7eb..c1e8a7d 100644
--- a/xen/include/asm-arm/numa.h
+++ b/xen/include/asm-arm/numa.h
@@ -5,7 +5,14 @@ typedef u8 nodeid_t;
#define NODES_SHIFT 2
-#ifndef CONFIG_NUMA
+#ifdef CONFIG_NUMA
+int arch_numa_setup(char *opt);
+#else
+static inline int arch_numa_setup(char *opt)
+{
+ return 1;
+}
+
/* Fake one node for now. See also node_online_map. */
#define cpu_to_node(cpu) 0
#define node_to_cpumask(node) (cpu_online_map)
diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h
index df1f7d5..659ff6a 100644
--- a/xen/include/asm-x86/numa.h
+++ b/xen/include/asm-x86/numa.h
@@ -22,7 +22,6 @@ extern nodeid_t pxm_to_node(unsigned int pxm);
#define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT))
extern void numa_init_array(void);
-extern bool_t numa_off;
extern int srat_disabled(void);
extern void srat_detect_node(int cpu);
@@ -32,5 +31,6 @@ extern nodeid_t apicid_to_node[];
void srat_parse_regions(u64 addr);
extern u8 __node_distance(nodeid_t a, nodeid_t b);
unsigned int arch_get_dma_bitsize(void);
+int arch_numa_setup(char *opt);
#endif
diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h
index 810f742..77c5cfd 100644
--- a/xen/include/xen/numa.h
+++ b/xen/include/xen/numa.h
@@ -18,6 +18,7 @@
(((d)->vcpu != NULL && (d)->vcpu[0] != NULL) \
? vcpu_to_node((d)->vcpu[0]) : NUMA_NO_NODE)
+extern bool_t numa_off;
struct node {
u64 start,end;
};
--
2.7.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-02-09 15:59 UTC|newest]
Thread overview: 91+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-09 15:56 [RFC PATCH v1 00/21] ARM: Add Xen NUMA support vijay.kilari
2017-02-09 15:56 ` [RFC PATCH v1 01/21] ARM: NUMA: Add existing ARM numa code under CONFIG_NUMA vijay.kilari
2017-02-20 11:39 ` Julien Grall
2017-02-22 9:18 ` Vijay Kilari
2017-02-22 10:49 ` Julien Grall
2017-02-09 15:56 ` [RFC PATCH v1 02/21] x86: NUMA: Refactor NUMA code vijay.kilari
2017-02-09 16:11 ` Jan Beulich
2017-02-20 11:41 ` Julien Grall
2017-02-27 11:43 ` Vijay Kilari
2017-02-27 14:58 ` Jan Beulich
2017-02-20 12:37 ` Julien Grall
2017-02-22 10:04 ` Vijay Kilari
2017-02-22 10:55 ` Julien Grall
2017-02-09 15:56 ` [RFC PATCH v1 03/21] NUMA: Move arch specific NUMA code as common vijay.kilari
2017-02-09 16:15 ` Jan Beulich
2017-02-20 12:47 ` Julien Grall
2017-02-22 10:08 ` Vijay Kilari
2017-02-22 11:07 ` Julien Grall
2017-02-09 15:56 ` vijay.kilari [this message]
2017-02-20 13:39 ` [RFC PATCH v1 04/21] NUMA: Refactor generic and arch specific code of numa_setup Julien Grall
2017-02-22 10:27 ` Vijay Kilari
2017-02-22 11:09 ` Julien Grall
2017-02-09 15:56 ` [RFC PATCH v1 05/21] ARM: efi: Do not delete memory node from fdt vijay.kilari
2017-02-20 13:42 ` Julien Grall
2017-02-09 15:56 ` [RFC PATCH v1 06/21] ARM: NUMA: Parse CPU NUMA information vijay.kilari
2017-02-20 17:32 ` Julien Grall
2017-02-22 10:46 ` Vijay Kilari
2017-02-22 11:10 ` Julien Grall
2017-02-20 17:36 ` Julien Grall
2017-02-09 15:56 ` [RFC PATCH v1 07/21] ARM: NUMA: Parse memory " vijay.kilari
2017-02-20 18:05 ` Julien Grall
2017-03-02 12:25 ` Vijay Kilari
2017-03-02 14:48 ` Julien Grall
2017-03-02 15:08 ` Vijay Kilari
2017-03-02 15:19 ` Julien Grall
2017-02-09 15:57 ` [RFC PATCH v1 08/21] ARM: NUMA: Parse NUMA distance information vijay.kilari
2017-02-20 18:28 ` Julien Grall
2017-02-22 11:38 ` Vijay Kilari
2017-02-22 11:44 ` Julien Grall
2017-03-02 12:10 ` Vijay Kilari
2017-03-02 12:17 ` Julien Grall
2017-02-09 15:57 ` [RFC PATCH v1 09/21] ARM: NUMA: Add CPU NUMA support vijay.kilari
2017-02-20 18:32 ` Julien Grall
2017-02-09 15:57 ` [RFC PATCH v1 10/21] ARM: NUMA: Add memory " vijay.kilari
2017-03-02 16:05 ` Julien Grall
2017-03-02 16:23 ` Vijay Kilari
2017-02-09 15:57 ` [RFC PATCH v1 11/21] ARM: NUMA: Add fallback on NUMA failure vijay.kilari
2017-03-02 16:09 ` Julien Grall
2017-03-02 16:25 ` Vijay Kilari
2017-02-09 15:57 ` [RFC PATCH v1 12/21] ARM: NUMA: Do not expose numa info to DOM0 vijay.kilari
2017-02-20 18:36 ` Julien Grall
2017-03-02 12:30 ` Vijay Kilari
2017-02-09 15:57 ` [RFC PATCH v1 13/21] ACPI: Refactor acpi SRAT and SLIT table handling code vijay.kilari
2017-03-02 15:30 ` Julien Grall
2017-03-02 16:31 ` Vijay Kilari
2017-03-02 16:32 ` Julien Grall
2017-02-09 15:57 ` [RFC PATCH v1 14/21] ACPI: Move srat_disabled to common code vijay.kilari
2017-02-09 15:57 ` [RFC PATCH v1 15/21] ARM: NUMA: Extract MPIDR from MADT table vijay.kilari
2017-03-02 16:28 ` Julien Grall
2017-03-02 16:41 ` Vijay Kilari
2017-03-02 16:49 ` Julien Grall
2017-02-09 15:57 ` [RFC PATCH v1 16/21] ARM: NUMA: Extract proximity from SRAT table vijay.kilari
2017-03-02 17:21 ` Julien Grall
2017-03-03 12:39 ` Vijay Kilari
2017-03-03 13:44 ` Julien Grall
2017-03-03 13:50 ` Vijay Kilari
2017-03-03 13:52 ` Julien Grall
2017-03-03 14:45 ` Vijay Kilari
2017-03-03 14:52 ` Julien Grall
2017-03-03 15:16 ` Vijay Kilari
2017-03-03 15:22 ` Jan Beulich
2017-03-10 10:53 ` Vijay Kilari
2017-02-09 15:57 ` [RFC PATCH v1 17/21] ARM: NUMA: Extract memory " vijay.kilari
2017-02-10 17:33 ` Konrad Rzeszutek Wilk
2017-02-10 17:35 ` Konrad Rzeszutek Wilk
2017-03-02 14:41 ` Vijay Kilari
2017-02-09 15:57 ` [RFC PATCH v1 18/21] ARM: NUMA: update node_distance with ACPI support vijay.kilari
2017-03-02 17:24 ` Julien Grall
2017-03-03 12:43 ` Vijay Kilari
2017-03-03 13:46 ` Julien Grall
2017-02-09 15:57 ` [RFC PATCH v1 19/21] ARM: NUMA: Initialize ACPI NUMA vijay.kilari
2017-03-02 17:25 ` Julien Grall
2017-03-03 12:44 ` Vijay Kilari
2017-02-09 15:57 ` [RFC PATCH v1 20/21] ARM: NUMA: Enable CONFIG_NUMA config vijay.kilari
2017-03-02 17:27 ` Julien Grall
2017-02-09 15:57 ` [RFC PATCH v1 21/21] ARM: NUMA: Enable CONFIG_ACPI_NUMA config vijay.kilari
2017-03-02 17:31 ` Julien Grall
2017-02-09 16:31 ` [RFC PATCH v1 00/21] ARM: Add Xen NUMA support Julien Grall
2017-02-09 16:59 ` Vijay Kilari
2017-02-10 17:30 ` Konrad Rzeszutek Wilk
2017-03-02 14:49 ` Vijay Kilari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1486655834-9708-5-git-send-email-vijay.kilari@gmail.com \
--to=vijay.kilari@gmail.com \
--cc=Vijaya.Kumar@cavium.com \
--cc=andre.przywara@arm.com \
--cc=dario.faggioli@citrix.com \
--cc=julien.grall@arm.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).