From patchwork Tue Aug 12 16:25:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 35296 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6B8C3203C5 for ; Tue, 12 Aug 2014 16:28:39 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id nu7sf45602100obb.11 for ; Tue, 12 Aug 2014 09:28:39 -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:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=7SOSXqK3iG5EHwtXXa1znlMKAt7PrHU3iLt0LaOnEgU=; b=DgPX5c35bnVPNoh7hKSfCREQSbKDlpwe4Ue5JHRk6YFYV/VzpSxCo/lCExumLytMtH RFeXiosuV53gV/kIeyk98gJvPz5AQhzoTvZlk6GNw05Yc/472JZzx+Ztp0h1DSf9prGV JjoDDMRz3QQmeJxKlZKjozVug8Uo/r6iOpsNHNYwQ4bR636uTrtqjRGwaK6rgnV/mXty sicD8qhePw+CDFWmhCn8Kf1+Lmx27FSE+6Omt/GxR+oksWUNbqReRbiEkzOKKZQoh6kJ wNUUZHm7bk2h4OhAsbssbNTVxPTYWyrxCVy7sojsv/jGjkGhZmY/9kEMp6AZBrSvo+r4 FkSw== X-Gm-Message-State: ALoCoQlgTDxDrthZ7VlbAlhMTALNIXlyVYQOWZMcQLJXPrV1khpAvbl5nru22MD3UgtUfcr8IGaX X-Received: by 10.182.66.234 with SMTP id i10mr2855390obt.12.1407860919047; Tue, 12 Aug 2014 09:28:39 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.21.84 with SMTP id 78ls195921qgk.79.gmail; Tue, 12 Aug 2014 09:28:39 -0700 (PDT) X-Received: by 10.52.0.132 with SMTP id 4mr23195984vde.10.1407860918920; Tue, 12 Aug 2014 09:28:38 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id vy2si8528343vcb.73.2014.08.12.09.28.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Aug 2014 09:28:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hq11so13624094vcb.38 for ; Tue, 12 Aug 2014 09:28:38 -0700 (PDT) X-Received: by 10.52.120.51 with SMTP id kz19mr1521292vdb.95.1407860918838; Tue, 12 Aug 2014 09:28:38 -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.221.37.5 with SMTP id tc5csp262669vcb; Tue, 12 Aug 2014 09:28:38 -0700 (PDT) X-Received: by 10.70.9.100 with SMTP id y4mr5363128pda.12.1407860917909; Tue, 12 Aug 2014 09:28:37 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id id5si16388793pbc.69.2014.08.12.09.28.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Aug 2014 09:28:37 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XHEvE-0003c4-MH; Tue, 12 Aug 2014 16:27:40 +0000 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21] helo=cam-smtp0.cambridge.arm.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XHEuK-0002uc-FH for linux-arm-kernel@lists.infradead.org; Tue, 12 Aug 2014 16:26:46 +0000 Received: from e106497-lin.cambridge.arm.com (e106497-lin.cambridge.arm.com [10.1.195.53]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id s7CGPPgf026280; Tue, 12 Aug 2014 17:25:28 +0100 From: Liviu Dudau To: Bjorn Helgaas , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Arnd Bergmann , Russell King , Tanmay Inamdar , Grant Likely , Sinan Kaya , Jingoo Han , Kukjin Kim , Suravee Suthikulanit , linux-pci Subject: [PATCH v9 11/12] arm64: Add pgprot_device() interface for device mappings. Date: Tue, 12 Aug 2014 17:25:24 +0100 Message-Id: <1407860725-25202-12-git-send-email-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1407860725-25202-1-git-send-email-Liviu.Dudau@arm.com> References: <1407860725-25202-1-git-send-email-Liviu.Dudau@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140812_092644_918692_CA502C40 X-CRM114-Status: GOOD ( 10.92 ) X-Spam-Score: -3.0 (---) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-3.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [217.140.96.21 listed in list.dnswl.org] -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record Cc: linux-arch , Device Tree ML , LKML , LAKML X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 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: liviu.dudau@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) 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 Add pgprot_device(). It will be aliased to pgprot_noncached for architectures that do not support special attributes for device mapping. Used by arm64 to define new attributes for devices. Cc: Arnd Bergmann Cc: Catalin Marinas Signed-off-by: Liviu Dudau --- include/asm-generic/pgtable.h | 4 ++++ arch/arm64/include/asm/pgtable.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 53b2acc..977e545 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -249,6 +249,10 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b) #define pgprot_writecombine pgprot_noncached #endif +#ifndef pgprot_device +#define pgprot_device pgprot_noncached +#endif + /* * When walking page tables, get the address of the next boundary, * or the end address of the range if that comes earlier. Although no diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index e0ccceb..7dbacaf 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -277,6 +277,8 @@ static inline int has_transparent_hugepage(void) __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) | PTE_PXN | PTE_UXN) +#define pgprot_device(prot) \ + __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRE) | 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,