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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 21D95C77B7A for ; Tue, 16 May 2023 07:02:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=b615G4ht7lDEiZCTVpsS2WP9IWs6MaoBfA77O6gjxEM=; b=xf9VAtQfwjaVqZ ejvTxnkll4VQdhBQJxt12kL+vbIjxfvCnp8K7OH8GTjbeDHIE1mTeHC+JXOis5LD21sPyhQfOhXE5 6m0faEFmgY08E6NWUojOosGz+CXtYJwqxrcKkz2WiABLF6+1YSNPtuLNZc4fbffOYvr9KqTWikqT5 9yr9Bkn7KkCtyEPz1ugew5xZtIg2f4agU2H2AfthlG1KG6xXGogtLPE+gQyKHrotSWN7U1+jr/N6O 13u1lVxCvEcSWfyYuxSCvYLs2qRmfTsYVAO5hLWsxLTtneaNhXWYBiTSw0+Ws3cfzzcTPn4+6TZ6d xLXGDbewz00ZntrUZR3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyohR-004aad-0M; Tue, 16 May 2023 07:02:21 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyohO-004aZi-0s for linux-arm-kernel@lists.infradead.org; Tue, 16 May 2023 07:02:19 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A63316351C; Tue, 16 May 2023 07:02:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2488C433EF; Tue, 16 May 2023 07:02:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684220537; bh=0oIdahxmDcks/2I2njxfN/C39E1GVYEqbwY+cPgU10U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lFWmtz+SVS8WKz6sXrGBaXts2fFXA+qshSS6blyCsJR6AqF7t0JOZgPVjyZSO6eLh gYGpj9NwRda+r4uaUo8fMKUvO84rzoo13pa2Ybxj5USHpSSKfxnhQblW8rkf2uiJ/y A0i0hdXKjG4H2DZY6LEqn+GBz7IQEdNiPv76r5/pvKryx2xdx6QizqQadPDdbe2srD XSRmH7K7f7rPVqroJe/wonig8z2ryl/UkWBJZxaAMGJhGMZ5uUwgPswVzHf08f02Cr PiUHfAWBeEvECflYTrM4I0vE0ipunJt0ENiq1Lu/T867LZ5X+c7n8rsEjfi1ftEyAB 0QrjywtKuLnsA== Date: Tue, 16 May 2023 10:02:08 +0300 From: Mike Rapoport To: Baoquan He Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, arnd@arndb.de, christophe.leroy@csgroup.eu, hch@infradead.org, agordeev@linux.ibm.com, wangkefeng.wang@huawei.com, schnelle@linux.ibm.com, David.Laight@aculab.com, shorne@gmail.com, willy@infradead.org, deller@gmx.de, Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v5 RESEND 16/17] arm64 : mm: add wrapper function ioremap_prot() Message-ID: References: <20230515090848.833045-1-bhe@redhat.com> <20230515090848.833045-17-bhe@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230515090848.833045-17-bhe@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230516_000218_376183_3FDFBB2D X-CRM114-Status: GOOD ( 20.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, May 15, 2023 at 05:08:47PM +0800, Baoquan He wrote: > Since hook functions ioremap_allowed() and iounmap_allowed() will be > obsoleted, add wrapper function ioremap_prot() to contain the > the specific handling in addition to generic_ioremap_prot() invocation. > > Signed-off-by: Baoquan He > Cc: Catalin Marinas > Cc: Will Deacon > Cc: linux-arm-kernel@lists.infradead.org Reviewed-by: Mike Rapoport (IBM) > --- > arch/arm64/include/asm/io.h | 3 +-- > arch/arm64/mm/ioremap.c | 10 ++++++---- > 2 files changed, 7 insertions(+), 6 deletions(-) > > diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h > index 877495a0fd0c..97dd4ff1253b 100644 > --- a/arch/arm64/include/asm/io.h > +++ b/arch/arm64/include/asm/io.h > @@ -139,8 +139,7 @@ extern void __memset_io(volatile void __iomem *, int, size_t); > * I/O memory mapping functions. > */ > > -bool ioremap_allowed(phys_addr_t phys_addr, size_t size, unsigned long prot); > -#define ioremap_allowed ioremap_allowed > +#define ioremap_prot ioremap_prot > > #define _PAGE_IOREMAP PROT_DEVICE_nGnRE > > diff --git a/arch/arm64/mm/ioremap.c b/arch/arm64/mm/ioremap.c > index c5af103d4ad4..269f2f63ab7d 100644 > --- a/arch/arm64/mm/ioremap.c > +++ b/arch/arm64/mm/ioremap.c > @@ -3,20 +3,22 @@ > #include > #include > > -bool ioremap_allowed(phys_addr_t phys_addr, size_t size, unsigned long prot) > +void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size, > + unsigned long prot) > { > unsigned long last_addr = phys_addr + size - 1; > > /* Don't allow outside PHYS_MASK */ > if (last_addr & ~PHYS_MASK) > - return false; > + return NULL; > > /* Don't allow RAM to be mapped. */ > if (WARN_ON(pfn_is_map_memory(__phys_to_pfn(phys_addr)))) > - return false; > + return NULL; > > - return true; > + return generic_ioremap_prot(phys_addr, size, __pgprot(prot)); > } > +EXPORT_SYMBOL(ioremap_prot); > > /* > * Must be called after early_fixmap_init > -- > 2.34.1 > > -- Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel