2016-12-12 19:34:00

by Boris Ostrovsky

[permalink] [raw]
Subject: [PATCH] x86/acpi: Use proper macro for invalid node

Use NUMA_NO_NODE instead of -1.

Signed-off-by: Boris Ostrovsky <[email protected]>
---
arch/x86/kernel/acpi/boot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 931ced8..db5bcd1 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -713,7 +713,7 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
int nid;

nid = acpi_get_node(handle);
- if (nid != -1) {
+ if (nid != NUMA_NO_NODE) {
set_apicid_to_node(physid, nid);
numa_set_node(cpu, nid);
}
--
1.8.3.1


2016-12-12 19:34:01

by Boris Ostrovsky

[permalink] [raw]
Subject: [PATCH] ACPI/NUMA: Do not map pxm to node when NUMA is turned off

Otherwise we may unexpectedly reference a non-zero node via, for example,
acpi_get_node() while other parts of the kernel assume that only node 0
(which is what NUMA_NO_NODE is supposed to be converted to) is
available.

Signed-off-by: Boris Ostrovsky <[email protected]>
---
drivers/acpi/numa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index ce3a7a1..edb0c79 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -70,7 +70,7 @@ int acpi_map_pxm_to_node(int pxm)
{
int node;

- if (pxm < 0 || pxm >= MAX_PXM_DOMAINS)
+ if (pxm < 0 || pxm >= MAX_PXM_DOMAINS || numa_off)
return NUMA_NO_NODE;

node = pxm_to_node_map[pxm];
--
1.8.3.1

2016-12-13 00:11:52

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] ACPI/NUMA: Do not map pxm to node when NUMA is turned off

Hi Boris,

[auto build test WARNING on pm/linux-next]
[also build test WARNING on v4.9 next-20161212]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Boris-Ostrovsky/ACPI-NUMA-Do-not-map-pxm-to-node-when-NUMA-is-turned-off/20161213-045302
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: x86_64-allyesdebian (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

All warnings (new ones prefixed by >>):

>> WARNING: vmlinux.o(.text+0x8acd33): Section mismatch in reference from the function acpi_map_pxm_to_node() to the variable .init.data:numa_off
The function acpi_map_pxm_to_node() references
the variable __initdata numa_off.
This is often because acpi_map_pxm_to_node lacks a __initdata
annotation or the annotation of numa_off is wrong.

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (1.15 kB)
.config.gz (36.89 kB)
Download all attachments
Subject: [tip:x86/urgent] x86/acpi: Use proper macro for invalid node

Commit-ID: 4370a3ef39f3d07342a1ae9967701bd697c8d9df
Gitweb: http://git.kernel.org/tip/4370a3ef39f3d07342a1ae9967701bd697c8d9df
Author: Boris Ostrovsky <[email protected]>
AuthorDate: Mon, 12 Dec 2016 14:29:52 -0500
Committer: Thomas Gleixner <[email protected]>
CommitDate: Thu, 15 Dec 2016 11:32:32 +0100

x86/acpi: Use proper macro for invalid node

Use NUMA_NO_NODE instead of -1.

Signed-off-by: Boris Ostrovsky <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>

---
arch/x86/kernel/acpi/boot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 4764fa5..6f65b0e 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -715,7 +715,7 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
int nid;

nid = acpi_get_node(handle);
- if (nid != -1) {
+ if (nid != NUMA_NO_NODE) {
set_apicid_to_node(physid, nid);
numa_set_node(cpu, nid);
}