lkml.org 
[lkml]   [2020]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 23/32] KVM: nVMX: Add helper to handle TLB flushes on nested VM-Enter/VM-Exit
From
Date
On 17/03/20 05:52, Sean Christopherson wrote:
> + nested_vmx_transition_tlb_flush(vcpu, vmcs12);
> +
> + /*
> + * There is no direct mapping between vpid02 and vpid12, vpid02 is
> + * per-vCPU and reused for all nested vCPUs. If vpid12 is changing
> + * then the new "virtual" VPID will reuse the same "real" VPID,
> + * vpid02, and so needs to be sync'd. Skip the sync if a TLB flush
> + * has already been requested, but always update the last used VPID.
> + */
> + if (nested_cpu_has_vpid(vmcs12) && nested_has_guest_tlb_tag(vcpu) &&
> + vmcs12->virtual_processor_id != vmx->nested.last_vpid) {
> + vmx->nested.last_vpid = vmcs12->virtual_processor_id;
> + if (!kvm_test_request(KVM_REQ_TLB_FLUSH, vcpu))
> + vpid_sync_context(nested_get_vpid02(vcpu));
> }

Would it make sense to move nested_vmx_transition_tlb_flush into an
"else" branch? And should this also test that KVM_REQ_TLB_FLUSH_CURRENT
is not set?

Paolo

\
 
 \ /
  Last update: 2020-03-17 18:19    [W:0.099 / U:0.944 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site