From patchwork Wed Mar 12 16:03:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 26138 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f71.google.com (mail-qg0-f71.google.com [209.85.192.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 59059203AB for ; Wed, 12 Mar 2014 16:09:50 +0000 (UTC) Received: by mail-qg0-f71.google.com with SMTP id j5sf10645571qga.2 for ; Wed, 12 Mar 2014 09:09:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:subject:message-id :references:mime-version:in-reply-to:user-agent:cc:precedence :list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-disposition :content-type:content-transfer-encoding; bh=S682M96fa8l11zwmy+VAocoBHkWpAr1t9Sh36YeOOq8=; b=f7DF0fL2mvkYk/mLRc0EqD+hJMXzo+Ua/zrDj/QG2VFxt4w9BgeB3rxIuL7TzdCTrl rA6tdnEkHFt4PRsVJ5T47cnE9SVQbSQWnAc0FHTMoH7sgKimdAUNIcvUHORxk/ZtWaPw QhKwUya727YK7enxMIXSIrFXzFg7vspo56LP5TJtavNqPG+au4iFGo4PnD0ya28T2HhO u0jzp9nRvmYN+JcwFuiOVfmZHwC2D/B6C4J6n6t26Gw/QrjmemlwrlIWlk5gzdYVRFpg uLEWr4i/+7If8s5MFQF984+Y9QoZd5DfBDJn/RdXLQGaFqvbp0X9zM02BHgVzBFflcLN JqTA== X-Gm-Message-State: ALoCoQnXwtYGqG2lJDto7io6jHHg2JeFp3XzDNEP2cUZUVQlYzf16UVfnxyqT34Zr3v15v8L6GLa X-Received: by 10.58.46.172 with SMTP id w12mr15603426vem.24.1394640590139; Wed, 12 Mar 2014 09:09:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.11 with SMTP id g11ls759235qgg.11.gmail; Wed, 12 Mar 2014 09:09:50 -0700 (PDT) X-Received: by 10.52.247.231 with SMTP id yh7mr1038808vdc.34.1394640590004; Wed, 12 Mar 2014 09:09:50 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id e10si6921712vcn.91.2014.03.12.09.09.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 09:09:49 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id ld13so5124165vcb.33 for ; Wed, 12 Mar 2014 09:09:49 -0700 (PDT) X-Received: by 10.52.18.70 with SMTP id u6mr31716972vdd.11.1394640589915; Wed, 12 Mar 2014 09:09:49 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp300499vck; Wed, 12 Mar 2014 09:09:49 -0700 (PDT) X-Received: by 10.194.243.68 with SMTP id ww4mr2095414wjc.58.1394640588581; Wed, 12 Mar 2014 09:09:48 -0700 (PDT) Received: from casper.infradead.org (casper.infradead.org. [2001:770:15f::2]) by mx.google.com with ESMTPS id kl5si24137139wjc.148.2014.03.12.09.09.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Mar 2014 09:09:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:770:15f::2 as permitted sender) client-ip=2001:770:15f::2; Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WNlif-0004Gn-G1; Wed, 12 Mar 2014 16:09:25 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WNldn-0000bJ-Ke; Wed, 12 Mar 2014 16:04:23 +0000 Received: from fw-tnat.austin.arm.com ([217.140.110.23] helo=collaborate-mta1.arm.com) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WNldk-0000aP-32 for linux-arm-kernel@lists.infradead.org; Wed, 12 Mar 2014 16:04:20 +0000 Received: from arm.com (e102109-lin.cambridge.arm.com [10.1.203.182]) by collaborate-mta1.arm.com (Postfix) with ESMTPS id BEBD213F61D; Wed, 12 Mar 2014 11:03:55 -0500 (CDT) Date: Wed, 12 Mar 2014 16:03:40 +0000 From: Catalin Marinas To: Will Deacon Subject: Re: [PATCH] ARM64: Kernel managed pages are only flushed Message-ID: <20140312160340.GI17083@arm.com> References: <1394018446-16738-1-git-send-email-Bharat.Bhushan@freescale.com> <20140306065339.GA2975@localhost> <20140312145653.GA9691@mudshark.cambridge.arm.com> MIME-Version: 1.0 In-Reply-To: <20140312145653.GA9691@mudshark.cambridge.arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140312_120420_188095_1B81860D X-CRM114-Status: GOOD ( 11.68 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: "Bharat.Bhushan@freescale.com" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: catalin.marinas@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Content-Disposition: inline On Wed, Mar 12, 2014 at 02:56:53PM +0000, Will Deacon wrote: > On Wed, Mar 12, 2014 at 02:41:31PM +0000, Bharat.Bhushan@freescale.com wrote: > > Did you get the chance to look into this? What is your take for this patch > > or you want to suggest some other solution? > > See my reply to Laura here: > > http://lists.infradead.org/pipermail/linux-arm-kernel/2014-March/238510.html > > We *really* don't want executable device mappings. /dev/mem mapping use pgprot_noncached() but I think we could generalise any of the writecombine and dmacoherent mappings to XN like in the patch below: diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index b524dcd17243..2d3cede62709 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -286,11 +286,11 @@ static inline int has_transparent_hugepage(void) * Mark the prot value as uncacheable and unbufferable. */ #define pgprot_noncached(prot) \ - __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE)) + __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE) | PTE_PXN | PTE_UXN) #define pgprot_writecombine(prot) \ - __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC)) + __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN) #define pgprot_dmacoherent(prot) \ - __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC)) + __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN) #define __HAVE_PHYS_MEM_ACCESS_PROT struct file; extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,