lkml.org 
[lkml]   [2018]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 4/8] kvm: vmx: Set IBPB when running a different VCPU
The point behind the IPBP in vmx_vcpu_load is to prevent one VCPU from
steering the speculative execution of the next. If the VMCS address is
recycled, vmx_vcpu_load doesn't realize that the VCPUs are different,
and so it won't issue the IPBP.

On Thu, Jan 11, 2018 at 5:49 PM, Wanpeng Li <kernellwp@gmail.com> wrote:
> 2018-01-09 20:03 GMT+08:00 Paolo Bonzini <pbonzini@redhat.com>:
>>
>> if (!already_loaded) {
>> @@ -4029,6 +4031,13 @@ static void free_loaded_vmcs(struct loaded_vmcs *loaded_vmcs)
>> free_vmcs(loaded_vmcs->vmcs);
>> loaded_vmcs->vmcs = NULL;
>> WARN_ON(loaded_vmcs->shadow_vmcs != NULL);
>> +
>> + /*
>> + * The VMCS could be recycled, causing a false negative in
>> + * vmx_vcpu_load; block speculative execution.
>> + */
>> + if (have_spec_ctrl)
>> + wrmsrl(MSR_IA32_PRED_CMD, PRED_CMD_IBPB);
>> }
>
> Intel guys told us the recycle is about the address of vmcs, not the
> content. Could you explain more why it matters?
>
> Regards,
> Wanpeng Li

\
 
 \ /
  Last update: 2018-01-14 23:25    [W:0.061 / U:7.116 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site