KVM: x86: Drop @invalidate_gpa param from kvm_x86_ops' tlb_flush()
[linux-2.6-microblaze.git] / arch / x86 / kvm / vmx / vmx.h
index 1560296..4597855 100644 (file)
@@ -500,46 +500,28 @@ static inline struct vmcs *alloc_vmcs(bool shadow)
 
 u64 construct_eptp(struct kvm_vcpu *vcpu, unsigned long root_hpa);
 
-static inline void __vmx_flush_tlb(struct kvm_vcpu *vcpu, int vpid,
-                               bool invalidate_gpa)
-{
-       if (enable_ept && (invalidate_gpa || !enable_vpid)) {
-               if (!VALID_PAGE(vcpu->arch.mmu->root_hpa))
-                       return;
-               ept_sync_context(construct_eptp(vcpu,
-                                               vcpu->arch.mmu->root_hpa));
-       } else {
-               vpid_sync_context(vpid);
-       }
-}
-
-static inline void vmx_flush_tlb(struct kvm_vcpu *vcpu, bool invalidate_gpa)
+static inline void vmx_flush_tlb(struct kvm_vcpu *vcpu)
 {
        struct vcpu_vmx *vmx = to_vmx(vcpu);
 
        /*
-        * Flush all EPTP/VPID contexts if the TLB flush _may_ have been
-        * invoked via kvm_flush_remote_tlbs(), which always passes %true for
-        * @invalidate_gpa.  Flushing remote TLBs requires all contexts to be
-        * flushed, not just the active context.
+        * Flush all EPTP/VPID contexts, as the TLB flush _may_ have been
+        * invoked via kvm_flush_remote_tlbs().  Flushing remote TLBs requires
+        * all contexts to be flushed, not just the active context.
         *
         * Note, this also ensures a deferred TLB flush with VPID enabled and
         * EPT disabled invalidates the "correct" VPID, by nuking both L1 and
         * L2's VPIDs.
         */
-       if (invalidate_gpa) {
-               if (enable_ept) {
-                       ept_sync_global();
-               } else if (enable_vpid) {
-                       if (cpu_has_vmx_invvpid_global()) {
-                               vpid_sync_vcpu_global();
-                       } else {
-                               vpid_sync_vcpu_single(vmx->vpid);
-                               vpid_sync_vcpu_single(vmx->nested.vpid02);
-                       }
+       if (enable_ept) {
+               ept_sync_global();
+       } else if (enable_vpid) {
+               if (cpu_has_vmx_invvpid_global()) {
+                       vpid_sync_vcpu_global();
+               } else {
+                       vpid_sync_vcpu_single(vmx->vpid);
+                       vpid_sync_vcpu_single(vmx->nested.vpid02);
                }
-       } else {
-               __vmx_flush_tlb(vcpu, vmx->vpid, false);
        }
 }