parisc: ensure broadcast tlb purge runs single threaded
The TLB flushing functions on hppa, which causes PxTLB broadcasts on the system bus, needs to be protected by irq-safe spinlocks to avoid irq handlers to deadlock the kernel. The deadlocks only happened during I/O intensive loads and triggered pretty seldom, which is why this bug went so long unnoticed. Signed-off-by: Helge Deller <deller@gmx.de> [edited to use spin_lock_irqsave on UP as well since we'd been locking there all this time anyway, --kyle] Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
This commit is contained in:
committed by
Kyle McMartin
parent
84be31be37
commit
e82a3b7512
@@ -397,12 +397,13 @@ EXPORT_SYMBOL(flush_kernel_icache_range_asm);
|
||||
|
||||
void clear_user_page_asm(void *page, unsigned long vaddr)
|
||||
{
|
||||
unsigned long flags;
|
||||
/* This function is implemented in assembly in pacache.S */
|
||||
extern void __clear_user_page_asm(void *page, unsigned long vaddr);
|
||||
|
||||
purge_tlb_start();
|
||||
purge_tlb_start(flags);
|
||||
__clear_user_page_asm(page, vaddr);
|
||||
purge_tlb_end();
|
||||
purge_tlb_end(flags);
|
||||
}
|
||||
|
||||
#define FLUSH_THRESHOLD 0x80000 /* 0.5MB */
|
||||
@@ -443,20 +444,24 @@ extern void clear_user_page_asm(void *page, unsigned long vaddr);
|
||||
|
||||
void clear_user_page(void *page, unsigned long vaddr, struct page *pg)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
purge_kernel_dcache_page((unsigned long)page);
|
||||
purge_tlb_start();
|
||||
purge_tlb_start(flags);
|
||||
pdtlb_kernel(page);
|
||||
purge_tlb_end();
|
||||
purge_tlb_end(flags);
|
||||
clear_user_page_asm(page, vaddr);
|
||||
}
|
||||
EXPORT_SYMBOL(clear_user_page);
|
||||
|
||||
void flush_kernel_dcache_page_addr(void *addr)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
flush_kernel_dcache_page_asm(addr);
|
||||
purge_tlb_start();
|
||||
purge_tlb_start(flags);
|
||||
pdtlb_kernel(addr);
|
||||
purge_tlb_end();
|
||||
purge_tlb_end(flags);
|
||||
}
|
||||
EXPORT_SYMBOL(flush_kernel_dcache_page_addr);
|
||||
|
||||
@@ -489,8 +494,10 @@ void __flush_tlb_range(unsigned long sid, unsigned long start,
|
||||
if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */
|
||||
flush_tlb_all();
|
||||
else {
|
||||
unsigned long flags;
|
||||
|
||||
mtsp(sid, 1);
|
||||
purge_tlb_start();
|
||||
purge_tlb_start(flags);
|
||||
if (split_tlb) {
|
||||
while (npages--) {
|
||||
pdtlb(start);
|
||||
@@ -503,7 +510,7 @@ void __flush_tlb_range(unsigned long sid, unsigned long start,
|
||||
start += PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
purge_tlb_end();
|
||||
purge_tlb_end(flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user