diff options
author | Matt Fleming <matt@console-pimps.org> | 2009-12-11 17:58:17 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-12-13 21:24:35 -0500 |
commit | fcb4ebd678858850e8b029909064175cb627868d (patch) | |
tree | 6851519967cb24f8bdf12a9c8dbc711f99b1bdc8 | |
parent | c89fbd3987d058fad3ea072aab68adfbdd13e498 (diff) |
sh: Couple kernel and user write page perm bits for CONFIG_X2TLB
pte_write() should check whether the permissions include either the user
or kernel write permission bits. Likewise, pte_wrprotect() needs to
remove both the kernel and user write bits.
Without this patch handle_tlbmiss() doesn't handle faulting in pages
from the P3 area (our vmalloc space) because of a write. Mappings of the
P3 space have the _PAGE_EXT_KERN_WRITE bit but not _PAGE_EXT_USER_WRITE.
Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/include/asm/pgtable_32.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/sh/include/asm/pgtable_32.h b/arch/sh/include/asm/pgtable_32.h index b35435516203..5003ee86f67b 100644 --- a/arch/sh/include/asm/pgtable_32.h +++ b/arch/sh/include/asm/pgtable_32.h | |||
@@ -344,7 +344,8 @@ static inline void set_pte(pte_t *ptep, pte_t pte) | |||
344 | #define pte_special(pte) ((pte).pte_low & _PAGE_SPECIAL) | 344 | #define pte_special(pte) ((pte).pte_low & _PAGE_SPECIAL) |
345 | 345 | ||
346 | #ifdef CONFIG_X2TLB | 346 | #ifdef CONFIG_X2TLB |
347 | #define pte_write(pte) ((pte).pte_high & _PAGE_EXT_USER_WRITE) | 347 | #define pte_write(pte) \ |
348 | ((pte).pte_high & (_PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE)) | ||
348 | #else | 349 | #else |
349 | #define pte_write(pte) ((pte).pte_low & _PAGE_RW) | 350 | #define pte_write(pte) ((pte).pte_low & _PAGE_RW) |
350 | #endif | 351 | #endif |
@@ -358,7 +359,7 @@ static inline pte_t pte_##fn(pte_t pte) { pte.pte_##h op; return pte; } | |||
358 | * individually toggled (and user permissions are entirely decoupled from | 359 | * individually toggled (and user permissions are entirely decoupled from |
359 | * kernel permissions), we attempt to couple them a bit more sanely here. | 360 | * kernel permissions), we attempt to couple them a bit more sanely here. |
360 | */ | 361 | */ |
361 | PTE_BIT_FUNC(high, wrprotect, &= ~_PAGE_EXT_USER_WRITE); | 362 | PTE_BIT_FUNC(high, wrprotect, &= ~(_PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE)); |
362 | PTE_BIT_FUNC(high, mkwrite, |= _PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE); | 363 | PTE_BIT_FUNC(high, mkwrite, |= _PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE); |
363 | PTE_BIT_FUNC(high, mkhuge, |= _PAGE_SZHUGE); | 364 | PTE_BIT_FUNC(high, mkhuge, |= _PAGE_SZHUGE); |
364 | #else | 365 | #else |