From: Tom Lendacky Date: Mon, 2 Jul 2018 21:35:53 +0000 (-0500) Subject: x86/bugs: Update when to check for the LS_CFG SSBD mitigation X-Git-Tag: Ubuntu-4.15.0-48.51~166 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=1e04c9cd4a0d83077b087883124ddc0544191fd4;p=mirror_ubuntu-bionic-kernel.git x86/bugs: Update when to check for the LS_CFG SSBD mitigation If either the X86_FEATURE_AMD_SSBD or X86_FEATURE_VIRT_SSBD features are present, then there is no need to perform the check for the LS_CFG SSBD mitigation support. Signed-off-by: Tom Lendacky Cc: Borislav Petkov Cc: David Woodhouse Cc: Konrad Rzeszutek Wilk Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20180702213553.29202.21089.stgit@tlendack-t1.amdoffice.net Signed-off-by: Ingo Molnar CVE-2018-3639 (cherry picked from commit 845d382bb15c6e7dc5026c0ff919c5b13fc7e11b) Signed-off-by: Tyler Hicks Acked-by: Juerg Haefliger Acked-by: Stefan Bader Signed-off-by: Khalid Elmously --- diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 2cc30f34d525..3d7fa07b69bb 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -549,7 +549,9 @@ static void bsp_init_amd(struct cpuinfo_x86 *c) nodes_per_socket = ((value >> 3) & 7) + 1; } - if (c->x86 >= 0x15 && c->x86 <= 0x17) { + if (!boot_cpu_has(X86_FEATURE_AMD_SSBD) && + !boot_cpu_has(X86_FEATURE_VIRT_SSBD) && + c->x86 >= 0x15 && c->x86 <= 0x17) { unsigned int bit; switch (c->x86) {