1
linux/arch/x86/kernel
Borislav Petkov 0e152cd7c1 x86, k8 nb: Fix boot crash: enable k8_northbridges unconditionally on AMD systems
de957628ce changed setting of the
x86_init.iommu.iommu_init function ptr only when GART IOMMU is
found.

One side effect of it is that num_k8_northbridges
is not initialized anymore if not explicitly
called. This resulted in uninitialized pointers in
<arch/x86/kernel/cpu/intel_cacheinfo.c:amd_calc_l3_indices()>,
for example, which uses the num_k8_northbridges thing through
node_to_k8_nb_misc().

Fix that through an initcall that runs right after the PCI
subsystem and does all the scanning. Then, remove initialization
in gart_iommu_init() which is a rootfs_initcall and we're
running before that.

What is more, since num_k8_northbridges is being used in other
places beside GART IOMMU, include it whenever we add AMD CPU
support. The previous dependency chain in kconfig contained

K8_NB depends on AGP_AMD64|GART_IOMMU

which was clearly incorrect. The more natural way in terms of
hardware dependency should be

AGP_AMD64|GART_IOMMU depends on K8_NB depends on CPU_SUP_AMD &&
PCI. Make it so Number One!

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Joerg Roedel <joerg.roedel@amd.com>
LKML-Reference: <20100312144303.GA29262@aftab>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Tested-by: Joerg Roedel <joerg.roedel@amd.com>
2010-03-13 08:36:16 +01:00
..
acpi x86: Fix SCI on IOAPIC != 0 2010-02-10 13:47:39 -08:00
apic x86, UV: Fix target_cpus() in x2apic_uv_x.c 2010-03-12 10:19:29 +01:00
cpu x86: Reduce per cpu MCA boot up messages 2010-03-11 14:27:46 +01:00
.gitignore
alternative.c
amd_iommu_init.c x86/amd-iommu: Fix IOMMU-API initialization for iommu=pt 2010-01-22 17:44:35 +01:00
amd_iommu.c x86/amd-iommu: Fix deassignment of a device from the pt_domain 2010-01-22 17:56:49 +01:00
aperture_64.c x86/agp: Fix agp_amd64_init and agp_amd64_cleanup 2010-01-13 11:15:37 +01:00
apm_32.c
asm-offsets_32.c
asm-offsets_64.c
asm-offsets.c
audit_64.c
bios_uv.c x86: uv: update XPC to handle updated BIOS interface 2009-12-16 07:20:14 -08:00
bootflag.c
check.c
cpuid.c x86, msr/cpuid: Pass the number of minors when unregistering MSR and CPUID drivers. 2010-01-26 23:52:38 -08:00
crash_dump_32.c
crash_dump_64.c
crash.c
doublefault_32.c
ds_selftest.c
ds_selftest.h
ds.c
dumpstack_32.c perf events, x86/stacktrace: Make stack walking optional 2009-12-17 09:56:19 +01:00
dumpstack_64.c perf events, x86/stacktrace: Make stack walking optional 2009-12-17 09:56:19 +01:00
dumpstack.c perf: Stop stack frame walking off kernel addresses boundaries 2010-01-13 09:32:54 +01:00
dumpstack.h perf events, x86/stacktrace: Make stack walking optional 2009-12-17 09:56:19 +01:00
e820.c x86: Fix size for ex trampoline with 32bit 2010-01-04 13:20:11 -08:00
early_printk.c
early-quirks.c
efi_32.c
efi_64.c
efi_stub_32.S
efi_stub_64.S
efi.c
entry_32.S x86, 32-bit: Use same regs as 64-bit for kernel_thread_helper 2009-12-10 15:55:36 -08:00
entry_64.S Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-16 12:02:37 -08:00
ftrace.c Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-08 13:27:33 -08:00
head32.c x86: Use find_e820() instead of hard coded trampoline address 2009-12-11 09:28:22 +01:00
head64.c x86: Use find_e820() instead of hard coded trampoline address 2009-12-11 09:28:22 +01:00
head_32.S x86-32: Use symbolic constants, safer CPUID when enabling EFER.NX 2009-11-16 13:44:56 -08:00
head_64.S Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-08 13:27:33 -08:00
head.c
hpet.c x86: Disable HPET MSI on ATI SB700/SB800 2010-01-23 06:21:58 +01:00
hw_breakpoint.c hw-breakpoints: Use overflow handler instead of the event callback 2009-12-06 08:27:18 +01:00
i386_ksyms_32.c
i387.c
i8237.c
i8253.c
i8259.c
init_task.c
io_delay.c
ioport.c x86-64, paravirt: Call set_iopl_mask() on 64 bits 2009-12-09 16:54:08 -08:00
irq_32.c
irq_64.c
irq.c genirq: Convert irq_desc.lock to raw_spinlock 2009-12-14 23:55:33 +01:00
irqinit.c
k8.c x86, k8 nb: Fix boot crash: enable k8_northbridges unconditionally on AMD systems 2010-03-13 08:36:16 +01:00
kdebugfs.c
kgdb.c perf, hw_breakpoint, kgdb: Do not take mutex for kernel debugger 2010-01-30 08:42:21 +01:00
kprobes.c Merge branch 'for-next' into for-linus 2009-12-07 18:36:35 +01:00
kvm.c
kvmclock.c
ldt.c
machine_kexec_32.c Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-08 13:27:33 -08:00
machine_kexec_64.c
Makefile cs5535: drop the Geode-specific MFGPT/GPIO code 2009-12-15 08:53:28 -08:00
mca_32.c
microcode_amd.c Revert "x86: ucode-amd: Load ucode-patches once ..." 2010-01-23 06:21:59 +01:00
microcode_core.c Revert "x86: ucode-amd: Load ucode-patches once ..." 2010-01-23 06:21:59 +01:00
microcode_intel.c arch/x86/kernel/microcode*: Use pr_fmt() and remove duplicated KERN_ERR prefix 2009-12-09 08:25:57 +01:00
mmconf-fam10h_64.c
module.c
mpparse.c x86, apic: Don't use logical-flat mode when CPU hotplug may exceed 8 CPUs 2010-02-09 20:51:11 -08:00
mrst.c
msr.c x86, msr/cpuid: Pass the number of minors when unregistering MSR and CPUID drivers. 2010-01-26 23:52:38 -08:00
olpc.c cs5535: move VSA2 checks into linux/cs5535.h 2009-12-15 08:53:28 -08:00
paravirt_patch_32.c
paravirt_patch_64.c
paravirt-spinlocks.c locking: Convert __raw_spin* functions to arch_spin* 2009-12-14 23:55:32 +01:00
paravirt.c
pci-calgary_64.c iommu-helper: use bitmap library 2009-12-16 07:20:18 -08:00
pci-dma.c x86: Split swiotlb initialization into two stages 2009-12-15 13:01:57 +01:00
pci-gart_64.c x86, k8 nb: Fix boot crash: enable k8_northbridges unconditionally on AMD systems 2010-03-13 08:36:16 +01:00
pci-nommu.c x86: Kill bad_dma_address variable 2009-11-17 07:53:21 +01:00
pci-swiotlb.c x86: Split swiotlb initialization into two stages 2009-12-15 13:01:57 +01:00
pcspeaker.c
pmtimer_64.c
probe_roms_32.c
process_32.c x86: Use KERN_DEFAULT log-level in __show_regs() 2009-12-28 09:40:21 +01:00
process_64.c x86: get rid of the insane TIF_ABI_PENDING bit 2010-01-29 08:22:01 -08:00
process.c x86: Reduce per cpu warning boot up messages 2010-03-11 14:27:47 +01:00
ptrace.c x86/ptrace: make genregs[32]_get/set more robust 2009-12-17 07:04:56 -08:00
pvclock.c
quirks.c x86: Disable HPET MSI on ATI SB700/SB800 2010-01-23 06:21:58 +01:00
reboot_fixups_32.c cs5535: move the DIVIL MSR definition into linux/cs5535.h 2009-12-15 08:53:28 -08:00
reboot.c x86: Add iMac9,1 to pci_reboot_dmi_table 2010-02-17 08:08:21 +01:00
relocate_kernel_32.S
relocate_kernel_64.S
rtc.c
scx200_32.c
setup_percpu.c x86: setup_percpu.c: Use pr_<level> and add pr_fmt(fmt) 2009-12-10 08:57:50 +01:00
setup.c x86: Add quirk for Intel DG45FC board to avoid low memory corruption 2010-01-29 15:45:53 -08:00
sfi.c
signal.c x86: Merge sys_sigaltstack 2009-12-09 16:28:59 -08:00
smp.c
smpboot.c x86, apic: Don't use logical-flat mode when CPU hotplug may exceed 8 CPUs 2010-02-09 20:51:11 -08:00
stacktrace.c perf events, x86/stacktrace: Make stack walking optional 2009-12-17 09:56:19 +01:00
step.c
sys_i386_32.c Unify sys_mmap* 2009-12-11 06:44:29 -05:00
sys_x86_64.c Unify sys_mmap* 2009-12-11 06:44:29 -05:00
syscall_64.c
syscall_table_32.S Unify sys_mmap* 2009-12-11 06:44:29 -05:00
tboot.c
tce_64.c
test_nx.c
test_rodata.c
time.c
tlb_uv.c Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-08 13:27:33 -08:00
tls.c
tls.h
topology.c
trampoline_32.S
trampoline_64.S
trampoline.c x86: Use find_e820() instead of hard coded trampoline address 2009-12-11 09:28:22 +01:00
traps.c
tsc_sync.c locking: Convert __raw_spin* functions to arch_spin* 2009-12-14 23:55:32 +01:00
tsc.c x86: Reenable TSC sync check at boot, even with NONSTOP_TSC 2009-12-17 14:44:35 -08:00
uv_irq.c x86, irq: Allow 0xff for /proc/irq/[n]/smp_affinity on an 8-cpu system 2009-12-17 22:03:06 -08:00
uv_sysfs.c
uv_time.c x86, UV: Fix RTC latency bug by reading replicated cachelines 2010-01-27 11:33:53 +01:00
verify_cpu_64.S
visws_quirks.c Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-08 13:27:33 -08:00
vm86_32.c x86, 32-bit: Convert sys_vm86 & sys_vm86old 2009-12-09 16:29:23 -08:00
vmi_32.c
vmiclock_32.c x86: vmiclock: Fix printk format 2009-11-18 12:31:06 +01:00
vmlinux.lds.S x86: Regex support and known-movable symbols for relocs, fix _end 2009-12-14 13:55:20 -08:00
vsmp_64.c
vsyscall_64.c Merge branch 'timers-for-linus-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-08 19:28:09 -08:00
x86_init.c Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-08 13:27:33 -08:00
x8664_ksyms_64.c Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-16 12:02:37 -08:00
xsave.c