Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit adccf65c authored by Bharat Bhushan's avatar Bharat Bhushan Committed by Alexander Graf
Browse files

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: default avatarBharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent 660696d1
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -282,8 +282,15 @@ 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;
	/*
	 * We can only access pages that the kernel maps
	 * as memory. Bail out for unmapped ones.
	 */
	if (!pfn_valid(pfn))
		return;

	/* Clear i-cache for new pages */
	page = pfn_to_page(pfn);
	if (!test_bit(PG_arch_1, &page->flags)) {
		flush_dcache_icache_page(page);