Re: [PATCH 2/2] x86/speculation: Support "Enhanced IBRS" on future CPUs
From: David Woodhouse
Date: Tue Feb 13 2018 - 03:15:17 EST
On Tue, 2018-02-13 at 09:02 +0100, Paolo Bonzini wrote:
> > --- a/arch/x86/kvm/vmx.c
> > +++ b/arch/x86/kvm/vmx.c
> > @@ -3419,13 +3419,14 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
> > Â
> > Â vmx->spec_ctrl = data;
> > Â
> > - if (!data)
> > + if (!data && !spectre_v2_ibrs_all())
> > Â break;
> This should check the value of IBRS_ALL in the VM, not in the host.
No, it's host we want. If IBRS_ALL is set in the host, we set the
actual hardware MSR once at boot time and never touch it again. The
SPEC_CTRL MSR we expose to guests is purely a no-op fiction.
If spectre_v2_ibrs_all() is true then KVM should *never* actually pass
through or touch the real MSR.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature