linux/arch/x86
Borislav Petkov a660bccb46 x86/amd_nb: Fix boot crash on non-AMD systems
commit 1ead852dd8 upstream.

Fix boot crash that triggers if this driver is built into a kernel and
run on non-AMD systems.

AMD northbridges users call amd_cache_northbridges() and it returns
a negative value to signal that we weren't able to cache/detect any
northbridges on the system.

At least, it should do so as all its callers expect it to do so. But it
does return a negative value only when kmalloc() fails.

Fix it to return -ENODEV if there are no NBs cached as otherwise, amd_nb
users like amd64_edac, for example, which relies on it to know whether
it should load or not, gets loaded on systems like Intel Xeons where it
shouldn't.

Reported-and-tested-by: Tony Battersby <tonyb@cybernetics.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1466097230-5333-2-git-send-email-bp@alien8.de
Link: https://lkml.kernel.org/r/5761BEB0.9000807@cybernetics.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2016-08-22 22:38:25 +01:00
..
boot x86, build: copy ldlinux.c32 to image.iso 2016-08-22 22:38:09 +01:00
configs USB: remove CONFIG_USB_DEBUG from defconfig files 2014-05-28 09:40:45 -07:00
crypto crypto: ghash-clmulni: specify context size for ghash async algorithm 2015-09-29 16:44:46 +01:00
ia32 x86/entry/compat: Add missing CLAC to entry_INT80_32 2016-03-08 12:15:09 +00:00
include x86/mm/xen: Suppress hugetlbfs in PV guests 2016-06-15 21:29:26 +01:00
kernel x86/amd_nb: Fix boot crash on non-AMD systems 2016-08-22 22:38:25 +01:00
kvm KVM: x86: fix OOPS after invalid KVM_SET_DEBUGREGS 2016-08-22 22:38:08 +01:00
lguest asmlinkage, x86: Add explicit __visible to arch/x86/* 2014-05-05 16:07:44 -07:00
lib perf/x86: Fix copy_from_user_nmi() return if range is not ok 2015-09-30 13:20:53 +01:00
math-emu x86/ldt: Further fix FPU emulation 2015-09-03 13:29:55 +01:00
mm x86/mm/32: Enable full randomization on i386 and X86_32 2016-05-01 00:06:10 +02:00
net x86: bpf_jit: fix compilation of large bpf programs 2015-06-03 14:30:07 +01:00
oprofile x86, oprofile, nmi: Fix CPU hotplug callback registration 2014-03-20 13:43:43 +01:00
pci x86/PCI: Mark Broadwell-EP Home Agent 1 as having non-compliant BARs 2016-08-22 22:38:00 +01:00
platform efi: Disable interrupts around EFI calls, not in the epilog/prolog calls 2016-01-25 10:43:30 +00:00
power x86/power/64: Fix kernel text mapping corruption during image restoration 2016-08-22 22:38:25 +01:00
realmode x86/build: Supress realmode.bin is up to date message 2014-04-16 15:17:24 +02:00
syscalls x86, x32: Use compat shims for io_{setup,submit} 2014-05-04 17:49:22 -07:00
tools x86, build: replace Perl script with Shell script 2015-02-04 10:58:18 +00:00
um um: Fix build error and kconfig for i386 2016-02-02 19:50:28 +00:00
vdso x86/vdso: Fix 'make bzImage' on older distros 2015-05-28 10:00:02 +01:00
video x86: Use vga_default_device() when determining whether an fb is primary 2012-04-24 09:50:17 +01:00
xen x86/iopl/64: Properly context-switch IOPL on Xen PV 2016-04-11 09:54:23 +01:00
.gitignore x86/kprobes: Add arch/x86/tools/insn_sanity to .gitignore 2012-01-16 08:21:59 +01:00
Kbuild x86, realmode: realmode.bin infrastructure 2012-05-08 11:41:48 -07:00
Kconfig x86/iosf: Add Kconfig prompt for IOSF_MBI selection 2015-07-15 10:01:31 +01:00
Kconfig.cpu Merge branch 'x86-nuke-platforms-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-04-02 13:15:58 -07:00
Kconfig.debug x86/efi: Dump the EFI page table 2014-03-04 16:17:17 +00:00
Makefile x86-64, build: Fix stack protector Makefile breakage with 32-bit userland 2014-05-07 14:14:44 -07:00
Makefile.um um: fix linker script generation 2012-04-09 13:59:00 -04:00
Makefile_32.cpu x86, 386 removal: Remove CONFIG_M386 from Kconfig 2012-11-29 13:23:01 -08:00