linux_dsm_epyc7002/drivers
Yinghai Lu d3bd058826 x86, acpi: Parse all SRAT cpu entries even above the cpu number limitation
Recent Intel new system have different order in MADT, aka will list all thread0
at first, then all thread1.
But SRAT table still old order, it will list cpus in one socket all together.

If the user have compiled limited NR_CPUS or boot with nr_cpus=, could have missed
to put some cpus apic id to node mapping into apicid_to_node[].

for example for 4 sockets system with 64 cpus with nr_cpus=32 will get crash...

[    9.106288] Total of 32 processors activated (136190.88 BogoMIPS).
[    9.235021] divide error: 0000 [#1] SMP
[    9.235315] last sysfs file:
[    9.235481] CPU 1
[    9.235592] Modules linked in:
[    9.245398]
[    9.245478] Pid: 2, comm: kthreadd Not tainted 2.6.37-rc1-tip-yh-01782-ge92ef79-dirty #274      /Sun Fire x4800
[    9.265415] RIP: 0010:[<ffffffff81075a8f>]  [<ffffffff81075a8f>] select_task_rq_fair+0x4f0/0x623
...
[    9.645938] RIP  [<ffffffff81075a8f>] select_task_rq_fair+0x4f0/0x623
[    9.665356]  RSP <ffff88103f8d1c40>
[    9.665568] ---[ end trace 2296156d35fdfc87 ]---

So let just parse all cpu entries in SRAT.

Also add apicid checking with MAX_LOCAL_APIC, in case We could out of boundaries of
apicid_to_node[].

it fixes following bug too.
https://bugzilla.kernel.org/show_bug.cgi?id=22662

-v2: expand to 32bit according to hpa
   need to add MAX_LOCAL_APIC for 32bit

Reported-and-Tested-by: Wu Fengguang <fengguang.wu@intel.com>
Reported-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Tested-by: Myron Stowe <myron.stowe@hp.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <4D0AD486.9020704@kernel.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2010-12-23 13:16:18 -08:00
..
accessibility
acpi x86, acpi: Parse all SRAT cpu entries even above the cpu number limitation 2010-12-23 13:16:18 -08:00
amba ARM: 6368/1: move the PrimeCell IDs to use macros 2010-10-08 10:02:27 +01:00
ata Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev 2010-10-21 19:03:38 -07:00
atm ATM: iphase, remove sleep-inside-atomic 2010-10-11 11:05:42 -07:00
auxdisplay
base Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6 2010-10-21 14:53:17 -07:00
block Merge branch 'virtio' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus 2010-10-21 12:40:33 -07:00
bluetooth pcmcia: move driver name to struct pcmcia_driver 2010-09-29 17:20:24 +02:00
cdrom
char Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2010-10-21 14:25:16 -07:00
clocksource
connector
cpufreq
cpuidle cpuidle: Fix typos 2010-09-28 23:30:38 -04:00
crypto
dca dca: disable dca on IOAT ver.3.0 multiple-IOH platforms 2010-09-17 20:08:21 -07:00
dio
dma ioat2: fix performance regression 2010-10-13 15:43:10 -07:00
edac Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp 2010-10-21 14:04:58 -07:00
eisa
firewire firewire: ohci: fix TI TSB82AA2 regression since 2.6.35 2010-10-17 14:09:12 +02:00
firmware ibft: fix kconfig dependencies 2010-10-14 11:16:40 -04:00
gpio Merge branches 'at91', 'dcache', 'ftrace', 'hwbpt', 'misc', 'mmci', 's3c', 'st-ux' and 'unwind' into devel 2010-10-18 22:34:25 +01:00
gpu drm/radeon/kms: avivo cursor workaround applies to evergreen as well 2010-10-18 09:14:35 +10:00
hid HID: Add Cando touch screen 15.6-inch product id 2010-10-13 10:47:32 +02:00
hwmon hwmon: f71882fg: use a muxed resource lock for the Super I/O port 2010-10-03 05:57:04 -07:00
i2c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2010-10-21 21:19:54 -07:00
ide pcmcia: remove obsolete and wrong comments 2010-09-29 17:20:25 +02:00
idle Merge branch 'x86-idle-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-10-21 13:45:38 -07:00
ieee1394
ieee802154
infiniband RDMA/cxgb3: Turn off RX coalescing for iWARP connections 2010-09-27 09:28:55 -07:00
input Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-10-21 16:42:32 -07:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2010-10-21 14:25:16 -07:00
leds leds: add LED driver for Big Network series LEDs 2010-10-07 14:02:12 -04:00
lguest
macintosh Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2010-10-21 21:19:54 -07:00
mca
md md: check return code of read_sb_page 2010-10-07 12:02:50 +11:00
media v4l1: fix 32-bit compat microcode loading translation 2010-10-15 11:12:38 -07:00
memstick
message
mfd Merge branch 'next-spi' of git://git.secretlab.ca/git/linux-2.6 2010-10-21 14:37:00 -07:00
misc i2c: Remove obsolete cleanup for clientdata 2010-09-30 14:14:22 +02:00
mmc Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-10-21 16:42:32 -07:00
mtd Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2010-10-21 14:25:16 -07:00
net Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-10-21 16:42:32 -07:00
nubus
of
oprofile oprofile: make !CONFIG_PM function stubs static inline 2010-10-15 12:47:18 +02:00
parisc
parport Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2010-10-21 14:25:16 -07:00
pci Merge branch 'x86-iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-10-21 14:23:48 -07:00
pcmcia pcmcia: don't call flush_scheduled_work() spuriously 2010-10-16 11:07:37 +02:00
platform IPS driver: Fix limit clamping when reducing CPU power 2010-10-05 14:59:35 -04:00
pnp
power apm_power: Add missing break statement 2010-09-08 14:35:10 +04:00
pps
ps3
rapidio
regulator Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging 2010-10-07 13:44:30 -07:00
rtc i2c: Remove obsolete cleanup for clientdata 2010-09-30 14:14:22 +02:00
s390 Fix IRQ flag handling naming 2010-10-07 14:08:55 +01:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2010-10-21 14:25:16 -07:00
serial Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-10-21 16:42:32 -07:00
sfi
sh
sn
spi Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-10-21 16:42:32 -07:00
ssb pcmcia: convert pcmcia_request_configuration to pcmcia_enable_device 2010-09-29 17:20:23 +02:00
staging Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2010-10-21 14:25:16 -07:00
tc
telephony pcmcia: move driver name to struct pcmcia_driver 2010-09-29 17:20:24 +02:00
thermal
uio
usb Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-10-21 16:42:32 -07:00
uwb
vhost Merge commit 'v2.6.36-rc7' into core/rcu 2010-10-07 09:43:45 +02:00
video Merge branch 'core-memblock-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-10-21 18:52:11 -07:00
virtio
vlynq MIPS: Add missing #inclusions of <linux/irq.h> 2010-10-07 14:08:54 +01:00
w1
watchdog Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2010-10-21 21:19:54 -07:00
xen Merge branch 'linus' into irq/core 2010-10-20 04:38:59 +02:00
zorro
Kconfig
Makefile Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2010-09-17 10:23:08 -07:00