]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit - arch/x86/kvm/x86.c
KVM: vmx: implement MSR_IA32_TSX_CTRL disable RTM functionality
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 18 Nov 2019 17:23:00 +0000 (12:23 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 21 Nov 2019 09:00:59 +0000 (10:00 +0100)
commitc11f83e0626bdc2b6c550fc8b9b6eeefbd8cefaa
tree84bd75af412f3e213facb1be12a0cbb2c899d0c1
parentedef5c36b0c7f07ab4926f6c9e50731f3772c79d
KVM: vmx: implement MSR_IA32_TSX_CTRL disable RTM functionality

The current guest mitigation of TAA is both too heavy and not really
sufficient.  It is too heavy because it will cause some affected CPUs
(those that have MDS_NO but lack TAA_NO) to fall back to VERW and
get the corresponding slowdown.  It is not really sufficient because
it will cause the MDS_NO bit to disappear upon microcode update, so
that VMs started before the microcode update will not be runnable
anymore afterwards, even with tsx=on.

Instead, if tsx=on on the host, we can emulate MSR_IA32_TSX_CTRL for
the guest and let it run without the VERW mitigation.  Even though
MSR_IA32_TSX_CTRL is quite heavyweight, and we do not want to write
it on every vmentry, we can use the shared MSR functionality because
the host kernel need not protect itself from TSX-based side-channels.

Tested-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c