Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

parisc: Call pagefault_disable/pagefault_enable in kmap_atomic/kunmap_atomic

Based on the generic implementation of kmap_atomic and kunmap_atomic,
we should call pagefault_disable and pagefault_enable in our PA8000
implementation.

The define for kmap_atomic_prot was also missing, and I updated
kmap_atomic_pfn to use the generic implementation because of the
change to kmap_atomic.

I believe that this change is needed to fix the fork copy-on-write
bug.

Signed-off-by: John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>

authored by

John David Anglin and committed by
Kyle McMartin
210501aa 9b437bca

+13 -3
+13 -3
arch/parisc/include/asm/cacheflush.h
··· 2 2 #define _PARISC_CACHEFLUSH_H 3 3 4 4 #include <linux/mm.h> 5 + #include <linux/uaccess.h> 5 6 6 7 /* The usual comment is "Caches aren't brain-dead on the <architecture>". 7 8 * Unfortunately, that doesn't apply to PA-RISC. */ ··· 126 125 127 126 #define kunmap(page) kunmap_parisc(page_address(page)) 128 127 129 - #define kmap_atomic(page, idx) page_address(page) 128 + static inline void *kmap_atomic(struct page *page, enum km_type idx) 129 + { 130 + pagefault_disable(); 131 + return page_address(page); 132 + } 130 133 131 - #define kunmap_atomic(addr, idx) kunmap_parisc(addr) 134 + static inline void kunmap_atomic(void *addr, enum km_type idx) 135 + { 136 + kunmap_parisc(addr); 137 + pagefault_enable(); 138 + } 132 139 133 - #define kmap_atomic_pfn(pfn, idx) page_address(pfn_to_page(pfn)) 140 + #define kmap_atomic_prot(page, idx, prot) kmap_atomic(page, idx) 141 + #define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx)) 134 142 #define kmap_atomic_to_page(ptr) virt_to_page(ptr) 135 143 #endif 136 144