提交 9b4e27b5 编写于 作者: R Robert Richter 提交者: Ingo Molnar

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: NJan Beulich <jbeulich@novell.com>
Signed-off-by: NRobert Richter <robert.richter@amd.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 9754a5b8
...@@ -555,9 +555,11 @@ static int __init early_fill_mp_bus_info(void) ...@@ -555,9 +555,11 @@ static int __init early_fill_mp_bus_info(void)
return 0; 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 */ /* common 32/64 bit code */
...@@ -583,4 +585,15 @@ static int __init enable_pci_io_ecs(void) ...@@ -583,4 +585,15 @@ static int __init enable_pci_io_ecs(void)
return 0; 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);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册