Skip to contentSkip to conversation

KVM: PPC: Book3s: PR: Add (dumb) MMU Notifier support

PATCH New Alexander Graf 1 participant 1 message Oct 4, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 21/56 KVM: PPC: Book3s: PR: Add (dumb) MMU Notifier support

Now that we have very simple MMU Notifier support for e500 in place, also add the same simple support to book3s. It gets us one step closer to actual fast support.

---
 arch/powerpc/include/asm/kvm_host.h   |    3 +-
 arch/powerpc/kvm/Kconfig              |    1 +
 arch/powerpc/kvm/book3s_32_mmu_host.c |    1 +
 arch/powerpc/kvm/book3s_64_mmu_host.c |    1 +
 arch/powerpc/kvm/book3s_mmu_hpte.c    |    5 ---
 arch/powerpc/kvm/book3s_pr.c          |   47 +++++++++++++++++++++++++++++++++
 6 files changed, 51 insertions(+), 7 deletions(-)
arch/powerpc/include/asm/kvm_host.h +1 -2
index cea9d3a..4a5ec8f 100644
@@ -46,8 +46,7 @@
 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
 #endif
 
-#if defined(CONFIG_KVM_BOOK3S_64_HV) || defined(CONFIG_KVM_E500V2) || \
-    defined(CONFIG_KVM_E500MC)
+#if !defined(CONFIG_KVM_440)
 #include <linux/mmu_notifier.h>
 
 #define KVM_ARCH_WANT_MMU_NOTIFIER
arch/powerpc/kvm/Kconfig +1 -0
index 40cad8c..71f0cd9 100644
@@ -36,6 +36,7 @@ config KVM_BOOK3S_64_HANDLER
 config KVM_BOOK3S_PR
 	bool
 	select KVM_MMIO
+	select MMU_NOTIFIER
 
 config KVM_BOOK3S_32
 	tristate "KVM support for PowerPC book3s_32 processors"
arch/powerpc/kvm/book3s_32_mmu_host.c +1 -0
index 837f13e..9fac010 100644
@@ -254,6 +254,7 @@ next_pteg:
 
 	kvmppc_mmu_hpte_cache_map(vcpu, pte);
 
+	kvm_release_pfn_clean(hpaddr >> PAGE_SHIFT);
 out:
 	return r;
 }
arch/powerpc/kvm/book3s_64_mmu_host.c +1 -0
index 0688b6b..6b2c80e 100644
@@ -168,6 +168,7 @@ map_again:
 
 		kvmppc_mmu_hpte_cache_map(vcpu, pte);
 	}
+	kvm_release_pfn_clean(hpaddr >> PAGE_SHIFT);
 
 out:
 	return r;
arch/powerpc/kvm/book3s_mmu_hpte.c +0 -5
index 41cb001..2c86b0d 100644
@@ -114,11 +114,6 @@ static void invalidate_pte(struct kvm_vcpu *vcpu, struct hpte_cache *pte)
 	hlist_del_init_rcu(&pte->list_vpte);
 	hlist_del_init_rcu(&pte->list_vpte_long);
 
-	if (pte->pte.may_write)
-		kvm_release_pfn_dirty(pte->pfn);
-	else
-		kvm_release_pfn_clean(pte->pfn);
-
 	spin_unlock(&vcpu3s->mmu_lock);
 
 	vcpu3s->hpte_cache_count--;
arch/powerpc/kvm/book3s_pr.c +47 -0

55 lines not on this page · raw message

Signature · 1 line
1.6.0.2