From: Sergei Shtylyov Date: Wed, 3 May 2006 18:56:43 +0000 (+0400) Subject: [MIPS] Fix mprotect() syscall for MIPS32 w/36-bit physical address support X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=79e0bc37255a4b934291b4d3ea5a4561fbd78da4;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [MIPS] Fix mprotect() syscall for MIPS32 w/36-bit physical address support Fix mprotect() syscall for MIPS32 CPUs with 36-bit physical address support: pte_modify() macro didn't clear the hardware page protection bits before modifying... Signed-off-by: Sergei Shtylyov Signed-off-by: Ralf Baechle --- diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index f80fe75c7800..d0af2a3b0152 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h @@ -353,8 +353,9 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot) #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) { - pte.pte_low &= _PAGE_CHG_MASK; - pte.pte_low |= pgprot_val(newprot); + pte.pte_low &= _PAGE_CHG_MASK; + pte.pte_high &= ~0x3f; + pte.pte_low |= pgprot_val(newprot); pte.pte_high |= pgprot_val(newprot) & 0x3f; return pte; }