From: Ross Lagerwall Date: Mon, 15 Aug 2022 13:35:10 +0000 (+0200) Subject: x86/amd: only call setup_force_cpu_cap for boot CPU X-Git-Tag: archive/raspbian/4.16.2-1+rpi1^2~34^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9123e60c0b9de1c78e8b807c80f0ea60aba37979;p=xen.git x86/amd: only call setup_force_cpu_cap for boot CPU 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 Reviewed-by: Jan Beulich master commit: 31b41ce858c8bd5159212d40969f8e0b7124bbf0 master date: 2022-08-11 17:44:26 +0200 --- diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c index 37ac84ddd7..9635eee619 100644 --- a/xen/arch/x86/cpu/amd.c +++ b/xen/arch/x86/cpu/amd.c @@ -845,7 +845,7 @@ static void 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)