aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2008-08-22 14:23:37 -0400
committerIngo Molnar <mingo@elte.hu>2008-08-23 11:39:30 -0400
commit9b4e27b52853c5da77e61a4e36fbc40688b7a829 (patch)
tree83cae2da59bf5fe1b3f5cb5dc0f08a0cdb8fe63c
parent9754a5b840a209bc1f192d59f63e81b698a55ac8 (diff)
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>
-rw-r--r--arch/x86/pci/amd_bus.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c
index dbf532369711..4a6f1a6a3aa9 100644
--- a/arch/x86/pci/amd_bus.c
+++ b/arch/x86/pci/amd_bus.c
@@ -555,9 +555,11 @@ static int __init early_fill_mp_bus_info(void)
555 return 0; 555 return 0;
556} 556}
557 557
558postcore_initcall(early_fill_mp_bus_info); 558#else /* !CONFIG_X86_64 */
559 559
560#endif 560static int __init early_fill_mp_bus_info(void) { return 0; }
561
562#endif /* !CONFIG_X86_64 */
561 563
562/* common 32/64 bit code */ 564/* common 32/64 bit code */
563 565
@@ -583,4 +585,15 @@ static int __init enable_pci_io_ecs(void)
583 return 0; 585 return 0;
584} 586}
585 587
586postcore_initcall(enable_pci_io_ecs); 588static int __init amd_postcore_init(void)
589{
590 if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
591 return 0;
592
593 early_fill_mp_bus_info();
594 enable_pci_io_ecs();
595
596 return 0;
597}
598
599postcore_initcall(amd_postcore_init);