提交 adccf65c 编写于 作者: B Bharat Bhushan 提交者: Alexander Graf

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: NBharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 660696d1
...@@ -282,8 +282,15 @@ void kvmppc_init_lpid(unsigned long nr_lpids); ...@@ -282,8 +282,15 @@ void kvmppc_init_lpid(unsigned long nr_lpids);
static inline void kvmppc_mmu_flush_icache(pfn_t pfn) static inline void kvmppc_mmu_flush_icache(pfn_t pfn)
{ {
/* Clear i-cache for new pages */
struct page *page; 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); page = pfn_to_page(pfn);
if (!test_bit(PG_arch_1, &page->flags)) { if (!test_bit(PG_arch_1, &page->flags)) {
flush_dcache_icache_page(page); flush_dcache_icache_page(page);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册