x86: fix: do not run code in amd_bus.c on non-AMD CPUs

Jan Beulich wrote:

> Even worse - this would even try to access the MSR on non-AMD CPUs
> (currently probably prevented just by the fact that only AMD ones use
> family values of 0x10 or higher).

This patch adds cpu vendor check to the postcore_initcalls.

Reported-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by Robert Richter and committed by Ingo Molnar 9b4e27b5 9754a5b8

+16 -3
+16 -3
arch/x86/pci/amd_bus.c
··· 555 555 return 0; 556 556 } 557 557 558 - postcore_initcall(early_fill_mp_bus_info); 558 + #else /* !CONFIG_X86_64 */ 559 559 560 - #endif 560 + static int __init early_fill_mp_bus_info(void) { return 0; } 561 + 562 + #endif /* !CONFIG_X86_64 */ 561 563 562 564 /* common 32/64 bit code */ 563 565 ··· 585 583 return 0; 586 584 } 587 585 588 - postcore_initcall(enable_pci_io_ecs); 586 + static int __init amd_postcore_init(void) 587 + { 588 + if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) 589 + return 0; 590 + 591 + early_fill_mp_bus_info(); 592 + enable_pci_io_ecs(); 593 + 594 + return 0; 595 + } 596 + 597 + postcore_initcall(amd_postcore_init);