Message ID | 20230216123419.461016-14-bhe@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp277395wrn; Thu, 16 Feb 2023 04:43:40 -0800 (PST) X-Google-Smtp-Source: AK7set96YKy2n/xiDfz0BgZJeyOIuqfPiPvzBlK6HXswpNRWG/z31F/KoZj2CXzutqWJGhcfs/no X-Received: by 2002:a17:906:4a5a:b0:8af:33f8:dcb3 with SMTP id a26-20020a1709064a5a00b008af33f8dcb3mr5677709ejv.57.1676551420564; Thu, 16 Feb 2023 04:43:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676551420; cv=none; d=google.com; s=arc-20160816; b=e0zbfruo7NuhiAeozAGAbNAuG9a3cMtByMA9vOFeJaoM/45PlZonKPdi2UPKTvZxlI WhvA2HrO5KiYiUm0vm0fqsNddw5j86g7K0SUprkSz7g34obVnnkKTap0KkzZbgu6ZN8a fB9En/5CXMQwrZt84KnZ/KBms0QrPXnezY9SlsiRqkEyH/8SmqGa5gytHmtnev2XlLWu 40pRf+vrY3WGV+Gkj4z/NKj1fQuWCn8+KbghLATZ240AGBvIg3HIQKWdi7YF2vBJl4BR B1mwJv/8d6ww/eKw3klplm6hTHbnvOPyW7JiTF8S/g2gMNyriBTeVP18MezBn2EF7zD8 2zUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Uaseq8uUQQ6QMQSRfFux0A76lTwwiGZ3GmLj5/5Y0lk=; b=EIpGauRHjTIQfZO5BVqxPFUb/v8/DG3bQm4ID6mG2oVCECwaetgpGnafOMW/3lUCbI 3oDbkeL97p/5gviuTgwxkLt7iVDTyI5fIjaGkHng8qYdQW0Hso0ZtDeUNs3keEQJtR+e jS5LnYu98oV0/NCFmjitJtX0eaFmpbOHE0+CmLnIfXO3JxBLcvp3ETe385pNaVXfSFCa o6cejfIEFJgn8SN7PHE/wB+GlP9ibvLzfNkXdgwnq+XYGHamBLglGeuBzAfwICVnI/li Td9ios+iy849iV3D8/bEso/diIuxDdmXAqJ+tuDdGb5P9X2GNFLp6POZlLpRtai7sGh7 fDug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h+emjyw9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a17090692c300b008b144b76b49si1746059ejx.906.2023.02.16.04.43.16; Thu, 16 Feb 2023 04:43:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h+emjyw9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230366AbjBPMhl (ORCPT <rfc822;aimixsaka@gmail.com> + 99 others); Thu, 16 Feb 2023 07:37:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230135AbjBPMh1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 16 Feb 2023 07:37:27 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1263359B79 for <linux-kernel@vger.kernel.org>; Thu, 16 Feb 2023 04:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676550970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Uaseq8uUQQ6QMQSRfFux0A76lTwwiGZ3GmLj5/5Y0lk=; b=h+emjyw9UAMtDn2HIR2DGzTH+XJIclUqMm+SgHJen9OcTjmmkfvGbTvgw4fgnjIw1W7ZjH FRi+/3IJCwQq0LKZB+DOVOlb4gDvjNPim9ByJ9CgF47R9CeWBMF2IUdDxsZbPXCR8VNT2C G1fIL97jgjEGIHuNIcPJKsC/1vjQI6g= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-192-t5oiSJVUPBaODLgfCZy8BQ-1; Thu, 16 Feb 2023 07:36:07 -0500 X-MC-Unique: t5oiSJVUPBaODLgfCZy8BQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9CA37857F40; Thu, 16 Feb 2023 12:36:06 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-99.pek2.redhat.com [10.72.12.99]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A108492C3C; Thu, 16 Feb 2023 12:36:00 +0000 (UTC) From: Baoquan He <bhe@redhat.com> To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, 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, arnd@arndb.de, Baoquan He <bhe@redhat.com> Subject: [PATCH v4 13/16] mm/ioremap: Consider IOREMAP space in generic ioremap Date: Thu, 16 Feb 2023 20:34:16 +0800 Message-Id: <20230216123419.461016-14-bhe@redhat.com> In-Reply-To: <20230216123419.461016-1-bhe@redhat.com> References: <20230216123419.461016-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757991582321417039?= X-GMAIL-MSGID: =?utf-8?q?1757991582321417039?= |
Series |
mm: ioremap: Convert architectures to take GENERIC_IOREMAP way
|
|
Commit Message
Baoquan He
Feb. 16, 2023, 12:34 p.m. UTC
From: Christophe Leroy <christophe.leroy@csgroup.eu> Architectures like powerpc have a dedicated space for IOREMAP mappings. If so, use it in generic_ioremap_pro(). Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Baoquan He <bhe@redhat.com> --- mm/ioremap.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/mm/ioremap.c b/mm/ioremap.c index 2fbe6b9bc50e..4a7749d85044 100644 --- a/mm/ioremap.c +++ b/mm/ioremap.c @@ -35,8 +35,13 @@ void __iomem *generic_ioremap_prot(phys_addr_t phys_addr, size_t size, if (!ioremap_allowed(phys_addr, size, pgprot_val(prot))) return NULL; +#ifdef IOREMAP_START + area = __get_vm_area_caller(size, VM_IOREMAP, IOREMAP_START, + IOREMAP_END, __builtin_return_address(0)); +#else area = get_vm_area_caller(size, VM_IOREMAP, __builtin_return_address(0)); +#endif if (!area) return NULL; vaddr = (unsigned long)area->addr; @@ -66,7 +71,7 @@ void generic_iounmap(volatile void __iomem *addr) if (!iounmap_allowed(vaddr)) return; - if (is_vmalloc_addr(vaddr)) + if (is_ioremap_addr(vaddr)) vunmap(vaddr); }