[PATCH] KVM : PPC : cache flush for kernel managed pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kernel should only try flushing pages which are managed by kernel.
pfn_to_page will returns junk struct page for pages not managed by kernel,
so if kernel will try to flush direct mapped memory or direct assigned device
mapping then it will work on junk struct page.

Signed-off-by: Bharat Bhushan <bharat.bhushan@xxxxxxxxxxxxx>
---
 arch/powerpc/kvm/e500_mmu_host.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c
index 1c6a9d7..e07da21 100644
--- a/arch/powerpc/kvm/e500_mmu_host.c
+++ b/arch/powerpc/kvm/e500_mmu_host.c
@@ -455,7 +455,8 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
 				ref, gvaddr, stlbe);
 
 	/* Clear i-cache for new pages */
-	kvmppc_mmu_flush_icache(pfn);
+	if (pfn_valid(pfn))
+		kvmppc_mmu_flush_icache(pfn);
 
 	/* Drop refcount on page, so that mmu notifiers can clear it */
 	kvm_release_pfn_clean(pfn);
-- 
1.7.0.4


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux