Skip to content

Commit ec1bc8e

Browse files
committed
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fix from Ingo Molnar: "Leftover from 4.0 Fix a local stack variable corruption with certain kdump usage patterns (Dave Young)" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm/numa: Fix kernel stack corruption in numa_init()->numa_clear_kernel_node_hotplug()
2 parents 07f2d8c + 22ef882 commit ec1bc8e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

arch/x86/mm/numa.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,16 @@ static void __init numa_clear_kernel_node_hotplug(void)
482482
&memblock.reserved, mb->nid);
483483
}
484484

485-
/* Mark all kernel nodes. */
485+
/*
486+
* Mark all kernel nodes.
487+
*
488+
* When booting with mem=nn[kMG] or in a kdump kernel, numa_meminfo
489+
* may not include all the memblock.reserved memory ranges because
490+
* trim_snb_memory() reserves specific pages for Sandy Bridge graphics.
491+
*/
486492
for_each_memblock(reserved, r)
487-
node_set(r->nid, numa_kernel_nodes);
493+
if (r->nid != MAX_NUMNODES)
494+
node_set(r->nid, numa_kernel_nodes);
488495

489496
/* Clear MEMBLOCK_HOTPLUG flag for memory in kernel nodes. */
490497
for (i = 0; i < numa_meminfo.nr_blks; i++) {

0 commit comments

Comments
 (0)