Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752085AbcCJSkE (ORCPT ); Thu, 10 Mar 2016 13:40:04 -0500 Received: from foss.arm.com ([217.140.101.70]:46946 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbcCJSj4 (ORCPT ); Thu, 10 Mar 2016 13:39:56 -0500 Date: Thu, 10 Mar 2016 18:39:51 +0000 From: Catalin Marinas To: Ganapatrao Kulkarni Cc: Dann Frazier , Ganapatrao Kulkarni , Will Deacon , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH] arm64: Fix the ptep_set_wrprotect() to set PTE_DIRTY if (PTE_DBM && !PTE_RDONLY) Message-ID: <20160310183951.GA2804@e104818-lin.cambridge.arm.com> References: <1457499768-31176-1-git-send-email-gkulkarni@caviumnetworks.com> <20160309100605.GJ6192@e104818-lin.cambridge.arm.com> <20160309160352.GM6192@e104818-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1061 Lines: 25 On Thu, Mar 10, 2016 at 08:34:46AM +0530, Ganapatrao Kulkarni wrote: > > On Wed, Mar 9, 2016 at 9:33 PM, Catalin Marinas 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 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