[PARISC] parisc specific kmap API implementation for pa8800
This patch fixes the pa8800 at a gross level (there are still other subtle incoherency issues which can still cause crashes and HPMCs). What it does is try to force eject inequivalent aliases before they become visible to the L2 cache (which is where we get the incoherence problems). A new function (parisc_requires_coherency) is introduced in asm/processor.h to identify the pa8x00 processors (8800 and 8900) which have the issue. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
This commit is contained in:

committed by
Matthew Wilcox

父節點
e45da35e18
當前提交
20f4d3cb9b
@@ -91,7 +91,8 @@ update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte)
|
||||
|
||||
flush_kernel_dcache_page(page);
|
||||
clear_bit(PG_dcache_dirty, &page->flags);
|
||||
}
|
||||
} else if (parisc_requires_coherency())
|
||||
flush_kernel_dcache_page(page);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -370,3 +371,45 @@ void parisc_setup_cache_timing(void)
|
||||
|
||||
printk(KERN_INFO "Setting cache flush threshold to %x (%d CPUs online)\n", parisc_cache_flush_threshold, num_online_cpus());
|
||||
}
|
||||
|
||||
extern void purge_kernel_dcache_page(unsigned long);
|
||||
extern void clear_user_page_asm(void *page, unsigned long vaddr);
|
||||
|
||||
void
|
||||
clear_user_page(void *page, unsigned long vaddr, struct page *pg)
|
||||
{
|
||||
purge_kernel_dcache_page((unsigned long)page);
|
||||
purge_tlb_start();
|
||||
pdtlb_kernel(page);
|
||||
purge_tlb_end();
|
||||
clear_user_page_asm(page, vaddr);
|
||||
}
|
||||
|
||||
void flush_kernel_dcache_page_addr(void *addr)
|
||||
{
|
||||
flush_kernel_dcache_page_asm(addr);
|
||||
purge_tlb_start();
|
||||
pdtlb_kernel(addr);
|
||||
purge_tlb_end();
|
||||
}
|
||||
EXPORT_SYMBOL(flush_kernel_dcache_page_addr);
|
||||
|
||||
void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
|
||||
struct page *pg)
|
||||
{
|
||||
/* no coherency needed (all in kmap/kunmap) */
|
||||
copy_user_page_asm(vto, vfrom);
|
||||
if (!parisc_requires_coherency())
|
||||
flush_kernel_dcache_page_asm(vto);
|
||||
}
|
||||
EXPORT_SYMBOL(copy_user_page);
|
||||
|
||||
#ifdef CONFIG_PA8X00
|
||||
|
||||
void kunmap_parisc(void *addr)
|
||||
{
|
||||
if (parisc_requires_coherency())
|
||||
flush_kernel_dcache_page_addr(addr);
|
||||
}
|
||||
EXPORT_SYMBOL(kunmap_parisc);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user