]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kvm/speculation: Allow KVM guests to use SSBD even if host does not
authorAlejandro Jimenez <alejandro.j.jimenez@oracle.com>
Wed, 20 Mar 2019 16:55:38 +0000 (12:55 -0400)
committerBrian Maly <brian.maly@oracle.com>
Tue, 21 May 2019 21:10:17 +0000 (17:10 -0400)
commitc3c2643d5c8cb4ef4f5121edbb0ba81bbc59ce09
tree0388768bc9fcd44908d6b9fa95c1a7949a5c2a4e
parent0d57530467243281b7decd099a017a0659653705
kvm/speculation: Allow KVM guests to use SSBD even if host does not

The bits set in x86_spec_ctrl_mask are used to determine the
allowed value that is written to SPEC_CTRL MSR before VMENTRY,
and controls which mitigations the guest can enable. In the
case of SSBD, unless the host has enabled SSBD always on
(which sets SSBD bit on x86_spec_ctrl_mask), the guest is
unable to use the SSBD mitigation. This was confirmed by
running the SSBD PoC and verifying that guests are always
vulnerable regardless of their own SSBD setting, unless
the host has booted with "spec_store_bypass_disable=on".

Set the SSBD bit in x86_spec_ctrl_mask when the host
CPU supports it, whether or not the host has chosen to
enable the mitigation in any of its modes.

Orabug: 29423804

Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
arch/x86/kernel/cpu/bugs_64.c