static void vmx_flush_tlb_gva(struct kvm_vcpu *vcpu, gva_t addr)
{
- int vpid = to_vmx(vcpu)->vpid;
-
- vpid_sync_vcpu_addr(vpid, addr);
-
/*
- * If VPIDs are not supported or enabled, then the above is a no-op.
- * But we don't really need a TLB flush in that case anyway, because
- * each VM entry/exit includes an implicit flush when VPID is 0.
+ * vpid_sync_vcpu_addr() is a nop if vmx->vpid==0, see the comment in
+ * vmx_flush_tlb_guest() for an explanation of why this is ok.
*/
+ vpid_sync_vcpu_addr(to_vmx(vcpu)->vpid, addr);
}
static void vmx_flush_tlb_guest(struct kvm_vcpu *vcpu)