Skip to content

Commit b015dcd

Browse files
committed
Merge tag 'for-5.18/parisc-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc architecture fixes from Helge Deller: "We had two big outstanding issues after v5.18-rc6: a) 32-bit kernels on 64-bit machines (e.g. on a C3700 which is able to run 32- and 64-bit kernels) failed early in userspace. b) 64-bit kernels on PA8800/PA8900 CPUs (e.g. in a C8000) showed random userspace segfaults. We assumed that those problems were caused by the tmpalias flushes. Dave did a lot of testing and reorganization of the current flush code and fixed the 32-bit cache flushing. For PA8800/PA8900 CPUs he switched the code to flush using the virtual address of user and kernel pages instead of using tmpalias flushes. The tmpalias flushes don't seem to work reliable on such CPUs. We tested the patches on a wide range machines (715/64, B160L, C3000, C3700, C8000, rp3440) and they have been in for-next without any conflicts. Summary: - Rewrite the cache flush code for PA8800/PA8900 CPUs to flush using the virtual address of user and kernel pages instead of using tmpalias flushes. Testing showed, that tmpalias flushes don't work reliably on PA8800/PA8900 CPUs - Fix flush code to allow 32-bit kernels to run on 64-bit capable machines, e.g. a 32-bit kernel on C3700 machines" * tag 'for-5.18/parisc-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Fix patch code locking and flushing parisc: Rewrite cache flush code for PA8800/PA8900 parisc: Disable debug code regarding cache flushes in handle_nadtlb_fault()
2 parents 99b0564 + 798082b commit b015dcd

File tree

5 files changed

+251
-143
lines changed

5 files changed

+251
-143
lines changed

arch/parisc/include/asm/cacheflush.h

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,37 +59,20 @@ void flush_dcache_page(struct page *page);
5959
flush_kernel_icache_range_asm(s,e); \
6060
} while (0)
6161

62-
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
63-
do { \
64-
flush_cache_page(vma, vaddr, page_to_pfn(page)); \
65-
memcpy(dst, src, len); \
66-
flush_kernel_dcache_range_asm((unsigned long)dst, (unsigned long)dst + len); \
67-
} while (0)
68-
69-
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
70-
do { \
71-
flush_cache_page(vma, vaddr, page_to_pfn(page)); \
72-
memcpy(dst, src, len); \
73-
} while (0)
74-
75-
void flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long pfn);
62+
void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
63+
unsigned long user_vaddr, void *dst, void *src, int len);
64+
void copy_from_user_page(struct vm_area_struct *vma, struct page *page,
65+
unsigned long user_vaddr, void *dst, void *src, int len);
66+
void flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr,
67+
unsigned long pfn);
7668
void flush_cache_range(struct vm_area_struct *vma,
7769
unsigned long start, unsigned long end);
7870

7971
/* defined in pacache.S exported in cache.c used by flush_anon_page */
8072
void flush_dcache_page_asm(unsigned long phys_addr, unsigned long vaddr);
8173

8274
#define ARCH_HAS_FLUSH_ANON_PAGE
83-
static inline void
84-
flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr)
85-
{
86-
if (PageAnon(page)) {
87-
flush_tlb_page(vma, vmaddr);
88-
preempt_disable();
89-
flush_dcache_page_asm(page_to_phys(page), vmaddr);
90-
preempt_enable();
91-
}
92-
}
75+
void flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr);
9376

9477
#define ARCH_HAS_FLUSH_ON_KUNMAP
9578
static inline void kunmap_flush_on_unmap(void *addr)

arch/parisc/include/asm/page.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@
2626
#define copy_page(to, from) copy_page_asm((void *)(to), (void *)(from))
2727

2828
struct page;
29+
struct vm_area_struct;
2930

3031
void clear_page_asm(void *page);
3132
void copy_page_asm(void *to, void *from);
3233
#define clear_user_page(vto, vaddr, page) clear_page_asm(vto)
33-
void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
34-
struct page *pg);
34+
void copy_user_highpage(struct page *to, struct page *from, unsigned long vaddr,
35+
struct vm_area_struct *vma);
36+
#define __HAVE_ARCH_COPY_USER_HIGHPAGE
3537

3638
/*
3739
* These are used to make use of C type-checking..

0 commit comments

Comments
 (0)