From: Bhavna Sarathy <bnagendr@redhat.com> Date: Wed, 21 Oct 2009 20:18:46 -0400 Subject: [x86] amd: fix hot plug cpu issue on 32-bit magny-cours Message-id: <20091021202107.22207.17474.sendpatchset@localhost.localdomain> Patchwork-id: 21151 O-Subject: [RHEL5.5 PATCH 1/2] Fix hot plug CPU issue on 32-bit AMD M-C Bugzilla: 526770 RH-Acked-by: Christopher Lalancette <clalance@redhat.com> Resolves BZ 526770 This patch fixes a hot plug issue on AMD processors on 32-bit RHEL. The init_amd() functions belong in the wrong code section. It's in __init and this section is removed during boot. Now if the kernel tries to call this function during CPU hotplug the function pointer is invalid. Testing: Tested on a few AMD Magny-cours systems, and it fixes the crash on the 5.4 experimental kernel. Upstream: This is a RHEL specific issue and does not exist upstream, upstream has unified 32-bit and 64-bit code. Please review and ACK diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c index 5564d53..58f5e41 100644 --- a/arch/i386/kernel/cpu/amd.c +++ b/arch/i386/kernel/cpu/amd.c @@ -23,7 +23,7 @@ extern void vide(void); __asm__(".align 4\nvide: ret"); -int force_mwait __initdata; +int force_mwait __cpuinitdata; /* * Fixup core topology information for AMD multi-node processors. @@ -83,7 +83,7 @@ static void __cpuinit amd_fixup_dcm(struct cpuinfo_x86 *c) } #endif -static void __init init_amd(struct cpuinfo_x86 *c) +static void __cpuinit init_amd(struct cpuinfo_x86 *c) { u32 l, h; int mbytes = num_physpages >> (20-PAGE_SHIFT); @@ -321,7 +321,7 @@ static void __init init_amd(struct cpuinfo_x86 *c) clear_bit(X86_FEATURE_MWAIT, &c->x86_capability); } -static unsigned int amd_size_cache(struct cpuinfo_x86 * c, unsigned int size) +static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 * c, unsigned int size) { /* AMD errata T13 (order #21922) */ if ((c->x86 == 6)) { @@ -334,7 +334,7 @@ static unsigned int amd_size_cache(struct cpuinfo_x86 * c, unsigned int size) return size; } -static struct cpu_dev amd_cpu_dev __initdata = { +static struct cpu_dev amd_cpu_dev __cpuinitdata = { .c_vendor = "AMD", .c_ident = { "AuthenticAMD" }, .c_models = { @@ -362,10 +362,3 @@ int __init amd_init_cpu(void) //early_arch_initcall(amd_init_cpu); -static int __init amd_exit_cpu(void) -{ - cpu_devs[X86_VENDOR_AMD] = NULL; - return 0; -} - -late_initcall(amd_exit_cpu);