Skip to content

Commit

Permalink
x86: fix: do not run code in amd_bus.c on non-AMD CPUs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Robert Richter authored and Ingo Molnar committed Aug 23, 2008
1 parent 9754a5b commit 9b4e27b
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions arch/x86/pci/amd_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,11 @@ static int __init early_fill_mp_bus_info(void)
return 0;
}

postcore_initcall(early_fill_mp_bus_info);
#else /* !CONFIG_X86_64 */

#endif
static int __init early_fill_mp_bus_info(void) { return 0; }

#endif /* !CONFIG_X86_64 */

/* common 32/64 bit code */

Expand All @@ -583,4 +585,15 @@ static int __init enable_pci_io_ecs(void)
return 0;
}

postcore_initcall(enable_pci_io_ecs);
static int __init amd_postcore_init(void)
{
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
return 0;

early_fill_mp_bus_info();
enable_pci_io_ecs();

return 0;
}

postcore_initcall(amd_postcore_init);

0 comments on commit 9b4e27b

Please sign in to comment.