diff options
author | Helge Deller <deller@gmx.de> | 2013-02-20 16:35:36 -0500 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2013-02-20 16:35:36 -0500 |
commit | 26ad19d8ebdb73869341b1b4159d32c0f0755946 (patch) | |
tree | 7861bb4df8b452ad5f71c8818d5f814f483f2150 /arch/parisc | |
parent | 19f949f52599ba7c3f67a5897ac6be14bfcb1200 (diff) | |
parent | 6c700d71f7faecb540b3fa4303edb5323a2768c1 (diff) |
Merge tag 'parisc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6 into stable-3.8
PARISC fixes on 20130213
This is a couple of patches, one to fix a broken build with HPUX compatibility
and the other to solve a coherency problem we've been seeing in our TLB where
setting a page read only occasionally fails to trigger a COW because of a
stale writeable TLB entry.
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'arch/parisc')
-rw-r--r-- | arch/parisc/hpux/fs.c | 3 | ||||
-rw-r--r-- | arch/parisc/include/asm/pgtable.h | 13 | ||||
-rw-r--r-- | arch/parisc/kernel/cache.c | 18 |
3 files changed, 29 insertions, 5 deletions
diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c index a0760b87fd4e..838b479a42c4 100644 --- a/arch/parisc/hpux/fs.c +++ b/arch/parisc/hpux/fs.c | |||
@@ -43,8 +43,7 @@ int hpux_execve(struct pt_regs *regs) | |||
43 | 43 | ||
44 | error = do_execve(filename->name, | 44 | error = do_execve(filename->name, |
45 | (const char __user *const __user *) regs->gr[25], | 45 | (const char __user *const __user *) regs->gr[25], |
46 | (const char __user *const __user *) regs->gr[24], | 46 | (const char __user *const __user *) regs->gr[24]); |
47 | regs); | ||
48 | 47 | ||
49 | putname(filename); | 48 | putname(filename); |
50 | 49 | ||
diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h index ee99f2339356..7df49fad29f9 100644 --- a/arch/parisc/include/asm/pgtable.h +++ b/arch/parisc/include/asm/pgtable.h | |||
@@ -12,11 +12,10 @@ | |||
12 | 12 | ||
13 | #include <linux/bitops.h> | 13 | #include <linux/bitops.h> |
14 | #include <linux/spinlock.h> | 14 | #include <linux/spinlock.h> |
15 | #include <linux/mm_types.h> | ||
15 | #include <asm/processor.h> | 16 | #include <asm/processor.h> |
16 | #include <asm/cache.h> | 17 | #include <asm/cache.h> |
17 | 18 | ||
18 | struct vm_area_struct; | ||
19 | |||
20 | /* | 19 | /* |
21 | * kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel | 20 | * kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel |
22 | * memory. For the return value to be meaningful, ADDR must be >= | 21 | * memory. For the return value to be meaningful, ADDR must be >= |
@@ -40,7 +39,14 @@ struct vm_area_struct; | |||
40 | do{ \ | 39 | do{ \ |
41 | *(pteptr) = (pteval); \ | 40 | *(pteptr) = (pteval); \ |
42 | } while(0) | 41 | } while(0) |
43 | #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) | 42 | |
43 | extern void purge_tlb_entries(struct mm_struct *, unsigned long); | ||
44 | |||
45 | #define set_pte_at(mm, addr, ptep, pteval) \ | ||
46 | do { \ | ||
47 | set_pte(ptep, pteval); \ | ||
48 | purge_tlb_entries(mm, addr); \ | ||
49 | } while (0) | ||
44 | 50 | ||
45 | #endif /* !__ASSEMBLY__ */ | 51 | #endif /* !__ASSEMBLY__ */ |
46 | 52 | ||
@@ -466,6 +472,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
466 | old = pte_val(*ptep); | 472 | old = pte_val(*ptep); |
467 | new = pte_val(pte_wrprotect(__pte (old))); | 473 | new = pte_val(pte_wrprotect(__pte (old))); |
468 | } while (cmpxchg((unsigned long *) ptep, old, new) != old); | 474 | } while (cmpxchg((unsigned long *) ptep, old, new) != old); |
475 | purge_tlb_entries(mm, addr); | ||
469 | #else | 476 | #else |
470 | pte_t old_pte = *ptep; | 477 | pte_t old_pte = *ptep; |
471 | set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte)); | 478 | set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte)); |
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index 48e16dc20102..b89a85ab945e 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c | |||
@@ -419,6 +419,24 @@ void kunmap_parisc(void *addr) | |||
419 | EXPORT_SYMBOL(kunmap_parisc); | 419 | EXPORT_SYMBOL(kunmap_parisc); |
420 | #endif | 420 | #endif |
421 | 421 | ||
422 | void purge_tlb_entries(struct mm_struct *mm, unsigned long addr) | ||
423 | { | ||
424 | unsigned long flags; | ||
425 | |||
426 | /* Note: purge_tlb_entries can be called at startup with | ||
427 | no context. */ | ||
428 | |||
429 | /* Disable preemption while we play with %sr1. */ | ||
430 | preempt_disable(); | ||
431 | mtsp(mm->context, 1); | ||
432 | purge_tlb_start(flags); | ||
433 | pdtlb(addr); | ||
434 | pitlb(addr); | ||
435 | purge_tlb_end(flags); | ||
436 | preempt_enable(); | ||
437 | } | ||
438 | EXPORT_SYMBOL(purge_tlb_entries); | ||
439 | |||
422 | void __flush_tlb_range(unsigned long sid, unsigned long start, | 440 | void __flush_tlb_range(unsigned long sid, unsigned long start, |
423 | unsigned long end) | 441 | unsigned long end) |
424 | { | 442 | { |