From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:60720 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751189AbcDRBXc (ORCPT ); Sun, 17 Apr 2016 21:23:32 -0400 Date: Mon, 18 Apr 2016 10:23:28 +0900 From: "gregkh@linuxfoundation.org" To: Catalin Marinas Cc: "gkulkarni@cavium.com" , "gkulkarni@caviumnetworks.com" , "stable@vger.kernel.org" Subject: Re: FAILED: patch "[PATCH] arm64: Update PTE_RDONLY in set_pte_at() for PROT_NONE" failed to apply to 4.4-stable tree Message-ID: <20160418012328.GA8223@kroah.com> References: <1460249615199147@kroah.com> <20160411144838.GA7908@MBP.local> <20160411174607.GB18650@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160411174607.GB18650@kroah.com> Sender: stable-owner@vger.kernel.org List-ID: On Mon, Apr 11, 2016 at 10:46:07AM -0700, gregkh@linuxfoundation.org wrote: > On Mon, Apr 11, 2016 at 03:48:40PM +0100, Catalin Marinas wrote: > > Hi Greg, > > > > On Sun, Apr 10, 2016 at 01:53:35AM +0100, gregkh@linuxfoundation.org wrote: > > > The patch below does not apply to the 4.4-stable tree. > > > If someone wants it applied there, or to any other stable or longterm > > > tree, then please email the backport, including the original git commit > > > id to . > > > > > > thanks, > > > > > > greg k-h > > > > > > ------------------ original commit in Linus's tree ------------------ > > > > > > From fdc69e7df3cb24f18a93192641786e5b7ecd1dfe Mon Sep 17 00:00:00 2001 > > > From: Catalin Marinas > > > Date: Wed, 9 Mar 2016 16:31:29 +0000 > > > Subject: [PATCH] arm64: Update PTE_RDONLY in set_pte_at() for PROT_NONE > > > permission > > > > > > The set_pte_at() function must update the hardware PTE_RDONLY bit > > > depending on the state of the PTE_WRITE and PTE_DIRTY bits of the given > > > entry value. However, it currently only performs this for pte_valid() > > > entries, ignoring PTE_PROT_NONE. The side-effect is that PROT_NONE > > > mappings would not have the PTE_RDONLY bit set. Without > > > CONFIG_ARM64_HW_AFDBM, this is not an issue since such PROT_NONE pages > > > are not accessible anyway. > > > > > > With commit 2f4b829c625e ("arm64: Add support for hardware updates of > > > the access and dirty pte bits"), the ptep_set_wrprotect() function was > > > re-written to cope with automatic hardware updates of the dirty state. > > > As an optimisation, only PTE_RDONLY is checked to assess the "dirty" > > > status. Since set_pte_at() does not set this bit for PROT_NONE mappings, > > > such pages may be considered "dirty" as a result of > > > ptep_set_wrprotect(). > > > > > > This patch updates the pte_valid() check to pte_present() in > > > set_pte_at(). It also adds PTE_PROT_NONE to the swap entry bits comment. > > > > > > Fixes: 2f4b829c625e ("arm64: Add support for hardware updates of the access and dirty pte bits") > > > Signed-off-by: Catalin Marinas > > > Reported-by: Ganapatrao Kulkarni > > > Tested-by: Ganapatrao Kulkarni > > > Cc: > > > > This patch requires another commit that was merged in 4.5. The actual > > "Cc: stable" line above should have been: > > > > Cc: # 4.4.x: ac15bd63bbb2: arm64: Honour !PTE_WRITE in set_pte_at() for kernel mappings > > > > Shall I re-send commit fdc69e7df3cb ("arm64: Update PTE_RDONLY in > > set_pte_at() for PROT_NONE permission") with the amended "Cc: stable" > > line or you're OK to cherry-pick the dependency? > > I can cherry-pick, thanks. Ok, I take it back, I need a backported version of fdc69e7df3cb for 4.4-stable as it didn't apply cleanly and I don't know the code at all to be able to do it myself by hand. Can you provide that backport? thanks, greg k-h