]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
kvm: Add arch specific mmu notifier for page invalidation
authorTang Chen <tangchen@cn.fujitsu.com>
Wed, 24 Sep 2014 07:57:57 +0000 (15:57 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 24 Sep 2014 12:07:59 +0000 (14:07 +0200)
This will be used to let the guest run while the APIC access page is
not pinned.  Because subsequent patches will fill in the function
for x86, place the (still empty) x86 implementation in the x86.c file
instead of adding an inline function in kvm_host.h.

Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/arm/include/asm/kvm_host.h
arch/arm64/include/asm/kvm_host.h
arch/powerpc/include/asm/kvm_host.h
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/x86.c
virt/kvm/kvm_main.c

index 8c3f7eb62b54eaa54b39c4acc512f43d5bb2fd77..155497c2b4da5e5e7c976a149262e8a726a63ac6 100644 (file)
@@ -181,6 +181,11 @@ static inline int kvm_test_age_hva(struct kvm *kvm, unsigned long hva)
        return 0;
 }
 
+static inline void kvm_arch_mmu_notifier_invalidate_page(struct kvm *kvm,
+                                                        unsigned long address)
+{
+}
+
 struct kvm_vcpu *kvm_arm_get_running_vcpu(void);
 struct kvm_vcpu __percpu **kvm_get_running_vcpus(void);
 
index a3c671b3acc96773465d44bb0a0564106b58cfa2..992d9da88119c62a273f45d379d3950c65997b11 100644 (file)
@@ -191,6 +191,11 @@ static inline int kvm_test_age_hva(struct kvm *kvm, unsigned long hva)
        return 0;
 }
 
+static inline void kvm_arch_mmu_notifier_invalidate_page(struct kvm *kvm,
+                                                        unsigned long address)
+{
+}
+
 struct kvm_vcpu *kvm_arm_get_running_vcpu(void);
 struct kvm_vcpu __percpu **kvm_get_running_vcpus(void);
 
index d329bc5543a2d2f36a370539e2ce56f6d38dcfc1..2cf6c1587d432fef5253360eaa750af97bc3a6df 100644 (file)
@@ -60,6 +60,11 @@ extern int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end);
 extern int kvm_test_age_hva(struct kvm *kvm, unsigned long hva);
 extern void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte);
 
+static inline void kvm_arch_mmu_notifier_invalidate_page(struct kvm *kvm,
+                                                        unsigned long address)
+{
+}
+
 #define HPTEG_CACHE_NUM                        (1 << 15)
 #define HPTEG_HASH_BITS_PTE            13
 #define HPTEG_HASH_BITS_PTE_LONG       12
index 763d273cab1d862de9d6915c40ea77aaa66d3d93..022c356e0fed872d732f75bf00b78c900a266615 100644 (file)
@@ -1044,6 +1044,8 @@ int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu);
 int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu);
 int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
 void kvm_vcpu_reset(struct kvm_vcpu *vcpu);
+void kvm_arch_mmu_notifier_invalidate_page(struct kvm *kvm,
+                                          unsigned long address);
 
 void kvm_define_shared_msr(unsigned index, u32 msr);
 void kvm_set_shared_msr(unsigned index, u64 val, u64 mask);
index 6152aa0da7dd8726358d84f81fc436719c34b9ac..142569e6f8f94522528b888830f42b8aff7cb612 100644 (file)
@@ -6026,6 +6026,11 @@ static void kvm_vcpu_flush_tlb(struct kvm_vcpu *vcpu)
        kvm_x86_ops->tlb_flush(vcpu);
 }
 
+void kvm_arch_mmu_notifier_invalidate_page(struct kvm *kvm,
+                                          unsigned long address)
+{
+}
+
 /*
  * Returns 1 to let __vcpu_run() continue the guest execution loop without
  * exiting to the userspace.  Otherwise, the value will be returned to the
index 5b8ca365932ad08490725d1287587e5d1cc9d078..3f16f569169eaf388ed4c7cf992f256d93665245 100644 (file)
@@ -296,6 +296,9 @@ static void kvm_mmu_notifier_invalidate_page(struct mmu_notifier *mn,
                kvm_flush_remote_tlbs(kvm);
 
        spin_unlock(&kvm->mmu_lock);
+
+       kvm_arch_mmu_notifier_invalidate_page(kvm, address);
+
        srcu_read_unlock(&kvm->srcu, idx);
 }