aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorBharat Bhushan <Bharat.Bhushan@freescale.com>2013-04-25 02:33:57 -0400
committerAlexander Graf <agraf@suse.de>2013-04-26 14:27:01 -0400
commitadccf65ca431b41733483f476e8de9e3cf171c44 (patch)
tree3421b1773f8c911357e12171966adb1ecaba1da7 /arch/powerpc
parent660696d1d16a71e15549ce1bf74953be1592bcd3 (diff)
KVM: PPC: cache flush for kernel managed pages
Kernel can only access pages which maps as memory. So flush only the valid kernel pages. Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/include/asm/kvm_ppc.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
index f58930779ae8..4794de6ea379 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -282,8 +282,15 @@ void kvmppc_init_lpid(unsigned long nr_lpids);
282 282
283static inline void kvmppc_mmu_flush_icache(pfn_t pfn) 283static inline void kvmppc_mmu_flush_icache(pfn_t pfn)
284{ 284{
285 /* Clear i-cache for new pages */
286 struct page *page; 285 struct page *page;
286 /*
287 * We can only access pages that the kernel maps
288 * as memory. Bail out for unmapped ones.
289 */
290 if (!pfn_valid(pfn))
291 return;
292
293 /* Clear i-cache for new pages */
287 page = pfn_to_page(pfn); 294 page = pfn_to_page(pfn);
288 if (!test_bit(PG_arch_1, &page->flags)) { 295 if (!test_bit(PG_arch_1, &page->flags)) {
289 flush_dcache_icache_page(page); 296 flush_dcache_icache_page(page);