Message ID | 20230301034247.136007-15-bhe@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3422363wrd; Tue, 28 Feb 2023 20:18:33 -0800 (PST) X-Google-Smtp-Source: AK7set+Si9K6tW4pL5yMjM4Y81q6EUZ9ngKHeCdX2D+iQDdQ3HO3//hX4wLu+p5i5CPu5blDDb2p X-Received: by 2002:a62:4e06:0:b0:5a8:a973:450a with SMTP id c6-20020a624e06000000b005a8a973450amr4416275pfb.2.1677644312942; Tue, 28 Feb 2023 20:18:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677644312; cv=none; d=google.com; s=arc-20160816; b=KqnRVc0urkpCDsDEZhj65NOYBA0qhQzxDY0uqvflkV8Ww1NdDpPatIqWrL7I8KPKeY 05OaxNkj9qYNqPEuO8b5UVsiHuimza6P6YwIHw/Ze2OXBCktNz1t7b3aB2KAClYwTJ3+ if87+3roEbtUezGoh7G4kPt15/Q130gjhRrAeDdEsh6WDDBMcAUIOphWprrawtjljAXv zA2j52n91mKTKTk2x5IzEaWCtQURVcVh+EtZAvu+m96uE7X4mmrkU7AB0P+x6C0mnxw0 brOySq58wv+AXLS5cHavRDfnQqUQuKR3SpVzKE5nfsjT9KYqsQuOQPouIOcpO2Pchne+ M6dA== 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=YMblMGLwFnH98VwBOzmlS3ogtp25mgyqTJ0/UmOIm6AYn8NT/oBQDWaBsJF6t6h07e VJFI799sdwA2QHWakmxpcTmk8du4pqezhl/Tf2zBOZ57oiATxW+C9s4p4tjFsnEf/UQu BEdzlKRTcyixnUoyBrYXi08/rwu005OkIucO4YznqMgOjc50kU1iIqasL9WiSp/eyKdg rWSlXAxqvUCKiiS3BV5o3+z3O4ft8HO7FhJFqhRO7BbFQYwzj3+BjSuJPfMvuR3Im5+L +usY1uj0kr3rI9ESBbcO65sCnWgb4qBA381jN1lXkbqGb3gFhPw0XDDSf0OA/f89CKai dcxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=auYpdm4U; 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 y16-20020aa79430000000b005a90ca008a9si11441300pfo.350.2023.02.28.20.18.19; Tue, 28 Feb 2023 20:18:32 -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=auYpdm4U; 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 S230040AbjCADqQ (ORCPT <rfc822;aaron.seo0120@gmail.com> + 99 others); Tue, 28 Feb 2023 22:46:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230076AbjCADpu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 28 Feb 2023 22:45:50 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 505EF31E16 for <linux-kernel@vger.kernel.org>; Tue, 28 Feb 2023 19:44:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677642271; 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=auYpdm4UMZe/BA+PT7/0aA1FAxcDeVb4tINrgO6AccM2vsDvygI/ts1yvduYBr7I0LWlfz VtFav56VP8okbxepkdfMVg5dod7JnvDgk/udmu5/H8j2iWsQiOK8vY1lF/CXa/LmoSRrdY OjnyKyDRaFe8PX379SsL6ejXTVFgh6o= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-361-Nku5RR7JO3SsoRvpup12WQ-1; Tue, 28 Feb 2023 22:44:28 -0500 X-MC-Unique: Nku5RR7JO3SsoRvpup12WQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C97973C0DDB2; Wed, 1 Mar 2023 03:44:27 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-13-180.pek2.redhat.com [10.72.13.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6933CC15BAE; Wed, 1 Mar 2023 03:44:21 +0000 (UTC) From: Baoquan He <bhe@redhat.com> To: linux-kernel@vger.kernel.org Cc: 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, Baoquan He <bhe@redhat.com> Subject: [PATCH v5 14/17] mm/ioremap: Consider IOREMAP space in generic ioremap Date: Wed, 1 Mar 2023 11:42:44 +0800 Message-Id: <20230301034247.136007-15-bhe@redhat.com> In-Reply-To: <20230301034247.136007-1-bhe@redhat.com> References: <20230301034247.136007-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.8 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?1759137562763538039?= X-GMAIL-MSGID: =?utf-8?q?1759137562763538039?= |
Series |
mm: ioremap: Convert architectures to take GENERIC_IOREMAP way
|
|
Commit Message
Baoquan He
March 1, 2023, 3:42 a.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); }