mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 22:51:42 +00:00
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>
This commit is contained in:
parent
660696d1d1
commit
adccf65ca4
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user