x86/amd: only call setup_force_cpu_cap for boot CPU
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Thu, 11 Aug 2022 15:44:26 +0000 (17:44 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 11 Aug 2022 15:44:26 +0000 (17:44 +0200)
This should only be called for the boot CPU to avoid calling _init code
after it has been unloaded.

Fixes: 062868a5a8b4 ("x86/amd: Work around CLFLUSH ordering on older parts")
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpu/amd.c

index 29c59bcba4092ca94a3e3eb75a5930892c921652..d5f8e5e899cc8a2f432fd23e13e25f16f8878ca9 100644 (file)
@@ -845,7 +845,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
         * everything, including reads and writes to address, and
         * LFENCE/SFENCE instructions.
         */
-       if (!cpu_has_clflushopt)
+       if (c == &boot_cpu_data && !cpu_has_clflushopt)
                setup_force_cpu_cap(X86_BUG_CLFLUSH_MFENCE);
 
        switch(c->x86)