linux-stable/arch
Robert Richter f9f67e5adc x86/numa: Fix SRAT lookup of CFMWS ranges with numa_fill_memblks()
For configurations that have the kconfig option NUMA_KEEP_MEMINFO
disabled, numa_fill_memblks() only returns with NUMA_NO_MEMBLK (-1).
SRAT lookup fails then because an existing SRAT memory range cannot be
found for a CFMWS address range. This causes the addition of a
duplicate numa_memblk with a different node id and a subsequent page
fault and kernel crash during boot.

Fix this by making numa_fill_memblks() always available regardless of
NUMA_KEEP_MEMINFO.

As Dan suggested, the fix is implemented to remove numa_fill_memblks()
from sparsemem.h and alos using __weak for the function.

Note that the issue was initially introduced with [1]. But since
phys_to_target_node() was originally used that returned the valid node
0, an additional numa_memblk was not added. Though, the node id was
wrong too, a message is seen then in the logs:

 kernel/numa.c:  pr_info_once("Unknown target node for memory at 0x%llx, assuming node 0\n",

[1] commit fd49f99c18 ("ACPI: NUMA: Add a node and memblk for each
    CFMWS not in SRAT")

Suggested-by: Dan Williams <dan.j.williams@intel.com>
Link: https://lore.kernel.org/all/66271b0072317_69102944c@dwillia2-xfh.jf.intel.com.notmuch/
Fixes: 8f10046799 ("ACPI/NUMA: Apply SRAT proximity domain to entire CFMWS window")
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Robert Richter <rrichter@amd.com>
Acked-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2024-05-07 13:47:15 +02:00
..
alpha Kbuild updates for v6.9 2024-03-21 14:41:00 -07:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-04-16 10:45:57 -07:00
arm Including fixes from bpf. 2024-05-02 08:51:47 -07:00
arm64 Including fixes from bpf. 2024-05-02 08:51:47 -07:00
csky
hexagon hexagon: vmlinux.lds.S: handle attributes section 2024-03-26 11:07:23 -07:00
loongarch LoongArch: Lately init pmu after smp is online 2024-04-25 22:17:52 +08:00
m68k TTY/Serial driver update for 6.9-rc1 2024-03-21 12:44:10 -07:00
microblaze
mips Fix for syscall_get_nr() to make it work even if tracing is disabled 2024-04-12 08:46:58 -07:00
nios2 nios2: Only use built-in devicetree blob if configured to do so 2024-04-03 14:35:53 -05:00
openrisc
parisc prctl: generalize PR_SET_MDWE support check to be per-arch 2024-03-26 11:07:22 -07:00
powerpc powerpc fixes for 6.9 #4 2024-05-05 10:44:04 -07:00
riscv Including fixes from bpf. 2024-05-02 08:51:47 -07:00
s390 s390/paes: Reestablish retry loop in paes 2024-05-01 11:52:54 +02:00
sh sh updates for v6.9 2024-03-21 10:13:47 -07:00
sparc This includes the following changes related to sparc for v6.9: 2024-03-15 12:47:21 -07:00
um Devicetree updates for v6.9: 2024-03-15 12:37:59 -07:00
x86 x86/numa: Fix SRAT lookup of CFMWS ranges with numa_fill_memblks() 2024-05-07 13:47:15 +02:00
xtensa Xtensa fixes for v6.9: 2024-05-02 10:41:28 -07:00
.gitignore
Kconfig cpu: Re-enable CPU mitigations by default for !X86 architectures 2024-04-25 15:47:35 +02:00