[PATCH] arm64: Fix the ptep_set_wrprotect() to set PTE_DIRTY if (PTE_DBM && !PTE_RDONLY)

Catalin Marinas catalin.marinas at arm.com
Thu Mar 10 10:39:51 PST 2016


On Thu, Mar 10, 2016 at 08:34:46AM +0530, Ganapatrao Kulkarni wrote:
> > On Wed, Mar 9, 2016 at 9:33 PM, Catalin Marinas <catalin.marinas at arm.com> wrote:
> >> diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
> >> index 7c73b365fcfa..b409a983f870 100644
> >> --- a/arch/arm64/include/asm/pgtable.h
> >> +++ b/arch/arm64/include/asm/pgtable.h
> >> @@ -201,7 +201,7 @@ extern void __sync_icache_dcache(pte_t pteval, unsigned long addr);
> >>  static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
> >>                               pte_t *ptep, pte_t pte)
> >>  {
> >> -       if (pte_valid(pte)) {
> >> +       if (pte_present(pte)) {
> >>                 if (pte_sw_dirty(pte) && pte_write(pte))
> >>                         pte_val(pte) &= ~PTE_RDONLY;
> >>                 else
>
> this diff works for me.
> 
> Tested-by: Ganapatrao Kulkarni <gkulkarni at cavium.com>

Thanks. I'll push it out during the merging window and cc stable (though
it needs a slightly different workaround for 4.4 anyway).

-- 
Catalin



More information about the linux-arm-kernel mailing list