Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp245856rwd; Mon, 15 May 2023 23:58:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6UMoy+VY7bMeFV6Ktz5LapUvVIQHV5lMjlrAJfYN4aY8Ae9ZFw8LXXJr7BGIyq/SJLxADW X-Received: by 2002:a17:902:db04:b0:1ac:8dae:d842 with SMTP id m4-20020a170902db0400b001ac8daed842mr33737042plx.46.1684220314911; Mon, 15 May 2023 23:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684220314; cv=none; d=google.com; s=arc-20160816; b=DBLK2YRInAgcF6YlSvSFbExFbSl1/tJ3NSov4xtQqfdg7Y1rToh6nhIUFQbs0ExmOB 2CJVSTTrbU71H3OUgE0E0GeBo7mJasUn//vODD7DK5FfiN8mnNC1MEC+KYiMC92C4IAk Q3RidF1YWO3Tt1vvu4+VtQa29HL47Zw26ouwC/ns0VaPr/2UZ1YobC/GtGOxoTKiSHqv +RnLuiWcVPvGHSMiumc5EZJF+Ysy7cco0huIqV85nxQwgqQnSDIImMuPS3+aIIZbWIRl JlarLAz1/0AKe5Y8xZBsVF2RElYEt6z8J1jISFnvNxQMUqwxXup2RCsccOH0lOuLx+te zRGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YDxuW5/Gccv/gNku+OS5oSwTPsWHEdiO44sHpzoEcoY=; b=Wv6/7uD+lbFxZXNTZ1vIxlMIQaVKd8DksD54D6sFVZ6lxf3N7Wov7ffAZdnYvd6020 xtVyj0+ynd7ZlcIw3fM8Axwc3AedvoTnX6WaSYc0NjQ1dzr3wPNuOoycRKiPNRMVi4fA 4CXE2dPYoU8lT66LqRpKq8NdEn1XsFt9764kg8/mF2iyRif3a7mLBiYP+kH4OOMTakR6 9U35wtkcLC+F1JhWGp3xHm9UiJFyZQ8G5AW1HfxmAIVr/5JkaIzGqqkIrvQRl/SB0nBH kIpp8UChywPO+0PcsE0isLoTXYZLqWDQyjOE5nN38W4HCV9kv1PW706JPbL3u21bFYyj krEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RvjD1vSA; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bf5-20020a170902b90500b001a970d40828si3862380plb.603.2023.05.15.23.58.23; Mon, 15 May 2023 23:58:34 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=RvjD1vSA; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230266AbjEPGxt (ORCPT + 99 others); Tue, 16 May 2023 02:53:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230372AbjEPGxn (ORCPT ); Tue, 16 May 2023 02:53:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5676149DD; Mon, 15 May 2023 23:53:14 -0700 (PDT) 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 E03C963525; Tue, 16 May 2023 06:53:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2D0EC433D2; Tue, 16 May 2023 06:53:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684219993; bh=zWowfpys7cJayhdbWlMlfG/naveXwBOaomK6G6YOhwc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RvjD1vSAOBJNjAg/ZIxaNqS2rkN1ZlKb87FTH1wyjTGlUAIpNihimQCBehxLwyAKY 54gGynJbfKhqXVBUQs0KQ5WYkVlgEiax4NBUKAMqRlDABOcDkYEQfDmUqFd0cVc2Rg +5tFUZtIuw2D3sq94eU18Cng/cxiFjnZIBRL6URAQLCsD8pXVC2rWlKWmYLB4LFNvN wVK415zfFdbPS4SjHqipuLQlYFG9zEqB51Of6oXmNOm2u/s3/wcGcmOyz4LvWqOjOz LoLHKaP50dbu7dxYKnvW3H+Vp/2FDG5ni4ZVU0tjPUFUOJobipbyYJvhN2PD5zGfJW 0OpmVx2CJIC7g== Date: Tue, 16 May 2023 09:53:06 +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 Subject: Re: [PATCH v5 RESEND 14/17] mm/ioremap: Consider IOREMAP space in generic ioremap Message-ID: References: <20230515090848.833045-1-bhe@redhat.com> <20230515090848.833045-15-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230515090848.833045-15-bhe@redhat.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 15, 2023 at 05:08:45PM +0800, Baoquan He wrote: > From: Christophe Leroy > > Architectures like powerpc have a dedicated space for IOREMAP mappings. > > If so, use it in generic_ioremap_pro(). > > Signed-off-by: Christophe Leroy > Signed-off-by: Baoquan He Reviewed-by: Mike Rapoport (IBM) > --- > 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); > } > > -- > 2.34.1 > > -- Sincerely yours, Mike.