Skip to content

Commit 57737c4

Browse files
committed
parisc: fix cache-flushing
This commit: f8dae00: parisc: Ensure full cache coherency for kmap/kunmap caused negative caching side-effects, e.g. hanging processes with expect and too many inequivalent alias messages from flush_dcache_page() on Debian 5 systems. This patch now partly reverts it and has been in production use on our debian buildd makeservers since a week without any major problems. Signed-off-by: Helge Deller <[email protected]> Signed-off-by: John David Anglin <[email protected]> Cc: [email protected] # v3.9+ Signed-off-by: Helge Deller <[email protected]>
1 parent 8a10bc9 commit 57737c4

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

arch/parisc/include/asm/cacheflush.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ void mark_rodata_ro(void);
132132
static inline void *kmap(struct page *page)
133133
{
134134
might_sleep();
135-
flush_dcache_page(page);
136135
return page_address(page);
137136
}
138137

@@ -144,7 +143,6 @@ static inline void kunmap(struct page *page)
144143
static inline void *kmap_atomic(struct page *page)
145144
{
146145
pagefault_disable();
147-
flush_dcache_page(page);
148146
return page_address(page);
149147
}
150148

arch/parisc/include/asm/page.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ struct page;
2929
void clear_page_asm(void *page);
3030
void copy_page_asm(void *to, void *from);
3131
#define clear_user_page(vto, vaddr, page) clear_page_asm(vto)
32-
#define copy_user_page(vto, vfrom, vaddr, page) copy_page_asm(vto, vfrom)
32+
void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
33+
struct page *pg);
3334

3435
/* #define CONFIG_PARISC_TMPALIAS */
3536

arch/parisc/kernel/cache.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,20 @@ void flush_kernel_dcache_page_addr(void *addr)
388388
}
389389
EXPORT_SYMBOL(flush_kernel_dcache_page_addr);
390390

391+
void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
392+
struct page *pg)
393+
{
394+
/* Copy using kernel mapping. No coherency is needed (all in
395+
kunmap) for the `to' page. However, the `from' page needs to
396+
be flushed through a mapping equivalent to the user mapping
397+
before it can be accessed through the kernel mapping. */
398+
preempt_disable();
399+
flush_dcache_page_asm(__pa(vfrom), vaddr);
400+
preempt_enable();
401+
copy_page_asm(vto, vfrom);
402+
}
403+
EXPORT_SYMBOL(copy_user_page);
404+
391405
void purge_tlb_entries(struct mm_struct *mm, unsigned long addr)
392406
{
393407
unsigned long flags;

0 commit comments

Comments
 (0)