summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-06-13 19:09:29 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2024-06-13 19:09:29 +0200
commit3572597ca844f625a3c9ba629ed0872b64c16179 (patch)
treebed719dc9309aa9734faf1c7776513f007518133 /mm
parentMerge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rmk/linux (diff)
parentx86/mm/numa: Use NUMA_NO_NODE when calling memblock_set_node() (diff)
downloadlinux-3572597ca844f625a3c9ba629ed0872b64c16179.tar.xz
linux-3572597ca844f625a3c9ba629ed0872b64c16179.zip
Merge tag 'fixes-2024-06-13' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock
Pull memblock fixes from Mike Rapoport: "Fix validation of NUMA coverage. memblock_validate_numa_coverage() was checking for a unset node ID using NUMA_NO_NODE, but x86 used MAX_NUMNODES when no node ID was specified by buggy firmware. Update memblock to substitute MAX_NUMNODES with NUMA_NO_NODE in memblock_set_node() and use NUMA_NO_NODE in x86::numa_init()" * tag 'fixes-2024-06-13' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock: x86/mm/numa: Use NUMA_NO_NODE when calling memblock_set_node() memblock: make memblock_set_node() also warn about use of MAX_NUMNODES
Diffstat (limited to 'mm')
-rw-r--r--mm/memblock.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index d09136e040d3..08e9806b1cf9 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1339,6 +1339,10 @@ int __init_memblock memblock_set_node(phys_addr_t base, phys_addr_t size,
int start_rgn, end_rgn;
int i, ret;
+ if (WARN_ONCE(nid == MAX_NUMNODES,
+ "Usage of MAX_NUMNODES is deprecated. Use NUMA_NO_NODE instead\n"))
+ nid = NUMA_NO_NODE;
+
ret = memblock_isolate_range(type, base, size, &start_rgn, &end_rgn);
if (ret)
return ret;