All of lore.kernel.org
 help / color / mirror / Atom feed
* [stable] kvm: x86: Host feature SSBD doesn't imply guest feature  SPEC_CTRL_SSBD
@ 2020-04-19 20:34 Ben Hutchings
  2020-04-19 23:42 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Hutchings @ 2020-04-19 20:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Sasha Levin; +Cc: stable


[-- Attachment #1.1: Type: text/plain, Size: 249 bytes --]

Please apply the attached backport of commit
396d2e878f92ec108e4293f1c77ea3bc90b414ff to the 4.4, 4.9, 4.14, and
4.19 stable branches.

Ben.

-- 
Ben Hutchings
I say we take off; nuke the site from orbit.
It's the only way to be sure.



[-- Attachment #1.2: kvm-x86-host-feature-ssbd-doesn-t-imply-guest-feature.patch --]
[-- Type: text/x-patch, Size: 1808 bytes --]

From: Jim Mattson <jmattson@google.com>
Date: Fri, 13 Dec 2019 16:15:15 -0800
Subject: kvm: x86: Host feature SSBD doesn't imply guest feature
 SPEC_CTRL_SSBD

commit 396d2e878f92ec108e4293f1c77ea3bc90b414ff upstream.

The host reports support for the synthetic feature X86_FEATURE_SSBD
when any of the three following hardware features are set:
  CPUID.(EAX=7,ECX=0):EDX.SSBD[bit 31]
  CPUID.80000008H:EBX.AMD_SSBD[bit 24]
  CPUID.80000008H:EBX.VIRT_SSBD[bit 25]

Either of the first two hardware features implies the existence of the
IA32_SPEC_CTRL MSR, but CPUID.80000008H:EBX.VIRT_SSBD[bit 25] does
not. Therefore, CPUID.(EAX=7,ECX=0):EDX.SSBD[bit 31] should only be
set in the guest if CPUID.(EAX=7,ECX=0):EDX.SSBD[bit 31] or
CPUID.80000008H:EBX.AMD_SSBD[bit 24] is set on the host.

Fixes: 0c54914d0c52a ("KVM: x86: use Intel speculation bugs and features as derived in generic x86 code")
Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Jacob Xu <jacobhxu@google.com>
Reviewed-by: Peter Shier <pshier@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Reported-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[bwh: Backported to 4.x: adjust indentation]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/x86/kvm/cpuid.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -400,7 +400,8 @@ static inline int __do_cpuid_ent(struct
 				entry->edx |= F(SPEC_CTRL);
 			if (boot_cpu_has(X86_FEATURE_STIBP))
 				entry->edx |= F(INTEL_STIBP);
-			if (boot_cpu_has(X86_FEATURE_SSBD))
+			if (boot_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD) ||
+			    boot_cpu_has(X86_FEATURE_AMD_SSBD))
 				entry->edx |= F(SPEC_CTRL_SSBD);
 			/*
 			 * We emulate ARCH_CAPABILITIES in software even

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [stable] kvm: x86: Host feature SSBD doesn't imply guest feature SPEC_CTRL_SSBD
  2020-04-19 20:34 [stable] kvm: x86: Host feature SSBD doesn't imply guest feature SPEC_CTRL_SSBD Ben Hutchings
@ 2020-04-19 23:42 ` Sasha Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2020-04-19 23:42 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Greg Kroah-Hartman, stable

On Sun, Apr 19, 2020 at 09:34:18PM +0100, Ben Hutchings wrote:
>Please apply the attached backport of commit
>396d2e878f92ec108e4293f1c77ea3bc90b414ff to the 4.4, 4.9, 4.14, and
>4.19 stable branches.

Queued up, thanks!

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-19 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-19 20:34 [stable] kvm: x86: Host feature SSBD doesn't imply guest feature SPEC_CTRL_SSBD Ben Hutchings
2020-04-19 23:42 ` Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.