From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCAAEC31E4E for ; Fri, 14 Jun 2019 20:37:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9286921473 for ; Fri, 14 Jun 2019 20:37:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="BDM1M+27" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727484AbfFNUhZ (ORCPT ); Fri, 14 Jun 2019 16:37:25 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:33878 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727660AbfFNUhX (ORCPT ); Fri, 14 Jun 2019 16:37:23 -0400 Received: by mail-pl1-f195.google.com with SMTP id i2so1466502plt.1 for ; Fri, 14 Jun 2019 13:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ctzVWLxLHqItydbbPUXjVh0gv8n1U7GRnaTqF8ILaog=; b=BDM1M+271IQoGfkSDrl85T8Rg7KP/lRKJEOPCJCfChPITi0i6Zs3pcycaA0GBFCgll ZQD1tlZUFKuxGUoqIjPaF/Qk+ZU199aERuJ0yHM5V4ez2VXIdzvl/L2iaeThCLAIVS2b DdSbS6oQg5U5nGMrQ1vc6prTrvy5arXwJE6ZU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ctzVWLxLHqItydbbPUXjVh0gv8n1U7GRnaTqF8ILaog=; b=Wn8VF5oQdFouE9BLPo4tOYcDRGFzCsAbZFTTYgrMKxUTwRj7Y2MAgm44z6oknUPYSB 52qT209X+Ye4cuFDwRczOTj2ETTLADNLjQpyE4nVN+bnK453TLUw0pNNwfdiKzoNEEe+ HG53ZQNXpLpLggt7JiPDphxH9Q/mq/6UXzqJJrhPKvwWvTGdNWsaYp31fTpl1yH8ez0l FsxjknDpVOsJY8Es4tCohxYe7BqT1JelrlBpEJPqOzBEJ7xKVppmFVicIPEPSnsH7DRe KgRfqW5Zw8SBm6NvkAXQfzF7orkj0TprpEyDNbr40u9Emcc1pQAJPCQvNRw/ud3Pe0xi FdEA== X-Gm-Message-State: APjAAAVpNjbLbis4KZ2izoOmvYl40sgLXTOJiiTl2eL9fKNpZ7HmL5M8 Ux6ntptBVa4u4j5V4wlTOhVCZA== X-Google-Smtp-Source: APXvYqw21FhItxYFfLoN4gG820hTamDRhMvYBgFH74z4L0jEESW79mOUdZTsiokL1tAuHIASvtvreQ== X-Received: by 2002:a17:902:f204:: with SMTP id gn4mr77051069plb.3.1560544642914; Fri, 14 Jun 2019 13:37:22 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id x5sm3673187pjp.21.2019.06.14.13.37.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 14 Jun 2019 13:37:22 -0700 (PDT) From: Stephen Boyd To: Dan Williams Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Evan Green , Rob Herring , Bjorn Andersson , Andy Gross , Will Deacon , Catalin Marinas Subject: [PATCH v2 4/5] arm64: Add support for arch_memremap_ro() Date: Fri, 14 Jun 2019 13:37:16 -0700 Message-Id: <20190614203717.75479-5-swboyd@chromium.org> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog In-Reply-To: <20190614203717.75479-1-swboyd@chromium.org> References: <20190614203717.75479-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Pass in PAGE_KERNEL_RO to the underlying IO mapping mechanism to get a read-only mapping for the MEMREMAP_RO type of memory mappings that memremap() supports. Cc: Evan Green Cc: Rob Herring Cc: Bjorn Andersson Cc: Andy Gross Cc: Will Deacon Cc: Catalin Marinas Cc: Dan Williams Reviewed-by: Bjorn Andersson Acked-by: Catalin Marinas Signed-off-by: Stephen Boyd --- arch/arm64/include/asm/io.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h index b807cb9b517d..cc33f4c8647b 100644 --- a/arch/arm64/include/asm/io.h +++ b/arch/arm64/include/asm/io.h @@ -183,6 +183,7 @@ extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size); #define ioremap_nocache(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE)) #define ioremap_wc(addr, size) __ioremap((addr), (size), __pgprot(PROT_NORMAL_NC)) #define ioremap_wt(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE)) +#define arch_memremap_ro(addr, size) __ioremap((addr), (size), PAGE_KERNEL_RO) #define iounmap __iounmap /* -- Sent by a computer through tubes From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D22C7C31E4B for ; Fri, 14 Jun 2019 20:42:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A524D2084D for ; Fri, 14 Jun 2019 20:42:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pxw1aZ70"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="BDM1M+27" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A524D2084D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YU6toghDZQZi927WBFLZSbJgdlixUKxTLi88uNnQIow=; b=pxw1aZ70RGZ63f oCxmC+L7WfTkMMZI3av97vdxcNaK7sqyOsp9ubfVUWL7KbXpD6/hp2BONNi6LSmwuFlNDugygFPeO m6q1SR6lpLaRt1Tj+09Osi5doKppGWtdruKh5+wyv079ZIXcqwrLBYzEw3H0kpHxECJlo/hQBTuAb Q+Pim0FvAX6MhYjX0yKvtmSpKcx5hQftOMPwhhGSLpxjnvi9ePrwA3RNfIC4rE4SM83sfj4gqgIt+ Vv4QirrSVilfaQSXtYc6oTxmKBwqEn3FN2Ty2HUm9+f8etRxZUEh9oTmy2yl5HHbBlDPTu+zWXJAY e+Ta1tiaWDhprTXetK/Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hbt1Q-0001GF-6v; Fri, 14 Jun 2019 20:42:04 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hbswt-0004Lo-MT for linux-arm-kernel@lists.infradead.org; Fri, 14 Jun 2019 20:37:34 +0000 Received: by mail-pl1-x641.google.com with SMTP id c14so1466639plo.0 for ; Fri, 14 Jun 2019 13:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ctzVWLxLHqItydbbPUXjVh0gv8n1U7GRnaTqF8ILaog=; b=BDM1M+271IQoGfkSDrl85T8Rg7KP/lRKJEOPCJCfChPITi0i6Zs3pcycaA0GBFCgll ZQD1tlZUFKuxGUoqIjPaF/Qk+ZU199aERuJ0yHM5V4ez2VXIdzvl/L2iaeThCLAIVS2b DdSbS6oQg5U5nGMrQ1vc6prTrvy5arXwJE6ZU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ctzVWLxLHqItydbbPUXjVh0gv8n1U7GRnaTqF8ILaog=; b=DRwrDVUKRtCVKSQ6rAbA18Hycmrll0Ep2BaxH4cD1Q2Qo0mbtm162ggFO9DqvEMQbr B0sWcBsJ9kqWmBav5L3r8Sy5gKfh9OOiTWtNYyJLQ213NmQipqacLWQGn4yXKH8U3m0Q aQuFk8ULdt2J8O+qvh60VwRgo5h/dqzyF043pyZaZHKTkRbLYnq2Tli9OmQB9PyYO/g6 aZCEy2ezZWkqeBZjk8M8ucO1BjEe/ditDOCjg26YCAIi7dIc0VyDy/DRKkoueP2C5I/s cuQ/qnGAMvnk/r0VXi3bOnxUvc5zPOiJqUnKTvyGVjsfsR+mb/STwHXEE41yyCQfY5uJ wOjw== X-Gm-Message-State: APjAAAXdU8rgiotIal3XdLOphgzM9ABelllGuRNHYhUHVAftDkc0repH Q82egFNpFeusYOhPchLhXqoqVQ== X-Google-Smtp-Source: APXvYqw21FhItxYFfLoN4gG820hTamDRhMvYBgFH74z4L0jEESW79mOUdZTsiokL1tAuHIASvtvreQ== X-Received: by 2002:a17:902:f204:: with SMTP id gn4mr77051069plb.3.1560544642914; Fri, 14 Jun 2019 13:37:22 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id x5sm3673187pjp.21.2019.06.14.13.37.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 14 Jun 2019 13:37:22 -0700 (PDT) From: Stephen Boyd To: Dan Williams Subject: [PATCH v2 4/5] arm64: Add support for arch_memremap_ro() Date: Fri, 14 Jun 2019 13:37:16 -0700 Message-Id: <20190614203717.75479-5-swboyd@chromium.org> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog In-Reply-To: <20190614203717.75479-1-swboyd@chromium.org> References: <20190614203717.75479-1-swboyd@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190614_133723_790341_F3555761 X-CRM114-Status: GOOD ( 11.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, Will Deacon , linux-kernel@vger.kernel.org, Evan Green , Bjorn Andersson , Rob Herring , Andy Gross , Catalin Marinas , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Pass in PAGE_KERNEL_RO to the underlying IO mapping mechanism to get a read-only mapping for the MEMREMAP_RO type of memory mappings that memremap() supports. Cc: Evan Green Cc: Rob Herring Cc: Bjorn Andersson Cc: Andy Gross Cc: Will Deacon Cc: Catalin Marinas Cc: Dan Williams Reviewed-by: Bjorn Andersson Acked-by: Catalin Marinas Signed-off-by: Stephen Boyd --- arch/arm64/include/asm/io.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h index b807cb9b517d..cc33f4c8647b 100644 --- a/arch/arm64/include/asm/io.h +++ b/arch/arm64/include/asm/io.h @@ -183,6 +183,7 @@ extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size); #define ioremap_nocache(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE)) #define ioremap_wc(addr, size) __ioremap((addr), (size), __pgprot(PROT_NORMAL_NC)) #define ioremap_wt(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE)) +#define arch_memremap_ro(addr, size) __ioremap((addr), (size), PAGE_KERNEL_RO) #define iounmap __iounmap /* -- Sent by a computer through tubes _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel