Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3052042rwa; Mon, 22 Aug 2022 20:13:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR4IJDF0q3KMyvRMOaUlzXbhFNwwr3U8FrZOIhH7DextKWNlA//2o/kGUTDkb7GzPTQfncF1 X-Received: by 2002:a05:6402:22f3:b0:446:39e9:5d0e with SMTP id dn19-20020a05640222f300b0044639e95d0emr1792697edb.300.1661224418864; Mon, 22 Aug 2022 20:13:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661224418; cv=none; d=google.com; s=arc-20160816; b=U4siyd9VqAxAhx6BokaLa4tArBTS/2I1ElP9fKWpBtLD2gmpdUH3pGbQ6QYh+b9yEY 9Mv8LI3KxnAC6m+3utgwuCGpXjsfmUwsh8hIPUK5FojpuBXXtgmey3HUbgOqwuI9YyAP uEsJuDP+ArgE8dKpX2B1/z8h4aRnLYCRkCu2EWbK8BB3PDaC0Z+7Hmn44skE2Xx9ofYS HFS5Bfz6IjVUzkMbJYI6xlNhRcT5eQnf9MI5knUc3Q8+tsEoorqwB05aJv7of+Qf2g+x q6kI2yABNUEOOqakDaC7kh4XuMeDEKneSmBqAOu+N5nfFmPiCedzVSAAoU1mBUinltmu VekA== 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=YgbO8iFV6P0Cia6+3yhw+UCHidRLj9zT3dgvk0gufSI=; b=vjgCCRTQLZP85a5/dYjnZQTIjKrj2+iHDShldHWmiZ14O/EbeRVfnrPITEWi/ASVAl sbOLOacUicZMAGBuQTI3zMPlwLzOBjMVoxgfFBSZdn0sGTOw57UyU0oxkB+lJ4Qfqgh3 pgSsWaO+JQMP9QWyczEbOjSjwroSlMvTam1xmos9KUuRrEvQjpIEKUW+duSpY3fgbfbB bDg/ru94XMPOz2/j0oqVoJIbp/4B1lVVnM5ArcHIzSGtiAhfENqcUf0D0q2k7CxgRhpx gzdP9HLCxpSIfDyyvB3Se+yLsOtxFjRmi70OJWEi/oYy3UpzCQzeEJpAWgDFjKH+ZpjI bJmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=StAsM2OZ; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y44-20020a50bb2f000000b0044398d6220csi984692ede.503.2022.08.22.20.13.11; Mon, 22 Aug 2022 20:13:38 -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=@redhat.com header.s=mimecast20190719 header.b=StAsM2OZ; 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 S239487AbiHWCm6 (ORCPT + 99 others); Mon, 22 Aug 2022 22:42:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238943AbiHWCmz (ORCPT ); Mon, 22 Aug 2022 22:42:55 -0400 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 E17315C364 for ; Mon, 22 Aug 2022 19:42:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661222573; 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: in-reply-to:in-reply-to:references:references; bh=YgbO8iFV6P0Cia6+3yhw+UCHidRLj9zT3dgvk0gufSI=; b=StAsM2OZzPqoI83hBNGKIFcsc4RLzI/vq955buAhx1A9g20Zwx7rdLfTiMJekc27zp8o+x mAgs1LodJfyD66T6aogdv2flSBbtRA9lnuxg2I5a0zEQWB/MhLEZuSu8u8LyFcVYCU9v6I tTSkuBugcfPO5Kdel0ZJyuiokdVESKU= 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-628-h3Fs69brOC2KXtLqff6kzw-1; Mon, 22 Aug 2022 22:42:50 -0400 X-MC-Unique: h3Fs69brOC2KXtLqff6kzw-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 283A13C01E12; Tue, 23 Aug 2022 02:42:50 +0000 (UTC) Received: from localhost (ovpn-12-31.pek2.redhat.com [10.72.12.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5017D492C3B; Tue, 23 Aug 2022 02:42:48 +0000 (UTC) Date: Tue, 23 Aug 2022 10:42:44 +0800 From: Baoquan He To: Christoph Hellwig Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, agordeev@linux.ibm.com, wangkefeng.wang@huawei.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 03/11] mm: ioremap: allow ARCH to have its own ioremap definition Message-ID: References: <20220820003125.353570-1-bhe@redhat.com> <20220820003125.353570-4-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.85 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, SPF_HELO_NONE,SPF_NONE,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 08/20/22 at 11:57pm, Christoph Hellwig wrote: > On Sat, Aug 20, 2022 at 08:31:17AM +0800, Baoquan He wrote: > > Architectures like xtensa, arc, can be converted to GENERIC_IOREMAP, > > to take standard ioremap_prot() and ioremap_xxx() way. But they have > > ARCH specific handling for ioremap() method, than standard ioremap() > > method. > > Do they? > > For arc, the arc_uncached_addr_space case can be easily handled by > arch_ioremap, and the xtensa case looks very similar to that. I am worried it will impact ioremap_prot(). Arc has selected HAVE_IOREMAP_PROT in Kconfig. Putting arc_uncached_addr_space() calling into arch_ioremap() will change ioremap_prot(), right? And I have the same about xtensa. You can see ioremap() and ioremap_cache() will return different value since they take XCHAL_KIO_BYPASS_VADDR and XCHAL_KIO_CACHED_VADDR differently. I haven't figured out a way to handle them in arch_ioremap() differently. static inline void __iomem *ioremap(unsigned long offset, unsigned long size) { if (offset >= XCHAL_KIO_PADDR && offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE) return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR); else return xtensa_ioremap_nocache(offset, size); } static inline void __iomem *ioremap_cache(unsigned long offset, unsigned long size) { if (offset >= XCHAL_KIO_PADDR && offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE) return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR); else return xtensa_ioremap_cache(offset, size); } > > I'd really like to kill off arch definitions of ioremap going > forward, as they should just be a special case of ioremap_prot > by definition.