summaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/kvm_ppc.h
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2012-08-03 11:56:33 (GMT)
committerAlexander Graf <agraf@suse.de>2012-08-16 12:14:53 (GMT)
commit249ba1ee0f8fcb4e40caa5fbea11dafde201cc46 (patch)
treecbe2fcf2c4e0c966afb3a7cacc785b608304a40c /arch/powerpc/include/asm/kvm_ppc.h
parent04f995a544d1289ffb8108849cd71b1325c5af6a (diff)
downloadlinux-fsl-qoriq-249ba1ee0f8fcb4e40caa5fbea11dafde201cc46.tar.xz
KVM: PPC: Add cache flush on page map
When we map a page that wasn't icache cleared before, do so when first mapping it in KVM using the same information bits as the Linux mapping logic. That way we are 100% sure that any page we map does not have stale entries in the icache. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/include/asm/kvm_ppc.h')
-rw-r--r--arch/powerpc/include/asm/kvm_ppc.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
index 0124937..e006f0b 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -219,4 +219,16 @@ void kvmppc_claim_lpid(long lpid);
void kvmppc_free_lpid(long lpid);
void kvmppc_init_lpid(unsigned long nr_lpids);
+static inline void kvmppc_mmu_flush_icache(pfn_t pfn)
+{
+ /* Clear i-cache for new pages */
+ struct page *page;
+ page = pfn_to_page(pfn);
+ if (!test_bit(PG_arch_1, &page->flags)) {
+ flush_dcache_icache_page(page);
+ set_bit(PG_arch_1, &page->flags);
+ }
+}
+
+
#endif /* __POWERPC_KVM_PPC_H__ */