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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B55F2ECAAD3 for ; Wed, 31 Aug 2022 09:00:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47C856B0071; Wed, 31 Aug 2022 05:00:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 42BB36B0072; Wed, 31 Aug 2022 05:00:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2CDFB6B0073; Wed, 31 Aug 2022 05:00:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 1AFD16B0071 for ; Wed, 31 Aug 2022 05:00:08 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 46241140D44 for ; Wed, 31 Aug 2022 09:00:07 +0000 (UTC) X-FDA: 79859290854.11.424CC03 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf20.hostedemail.com (Postfix) with ESMTP id F024F1C0055 for ; Wed, 31 Aug 2022 09:00:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661936406; 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=+aX/ysPy4g/ZBHpw80NPiA1D0zFDi9OYqQPxY6Pf5Q8=; b=Ylnk54VDGcx4zXiEqprxA3Z7/h4QKpTU7UNJWSUUn0D8e9JFSRaq9VYnT67Ka0BPb2H6Cm GLf3w2WGQqBDc4OrsGHQQASoMQRyUwo/ukGqcprRrMQtBZ0A8EL289QWmyn4bh3jmI4C1n UOKjDU8+bUsWCCij5ChYr0H2kgLitrM= 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-489-FkZ4Wn5qMZi3r8xGJ6smAQ-1; Wed, 31 Aug 2022 05:00:03 -0400 X-MC-Unique: FkZ4Wn5qMZi3r8xGJ6smAQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 732FE811E9B; Wed, 31 Aug 2022 09:00:02 +0000 (UTC) Received: from localhost (ovpn-13-50.pek2.redhat.com [10.72.13.50]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B6D32166B26; Wed, 31 Aug 2022 09:00:01 +0000 (UTC) Date: Wed, 31 Aug 2022 16:59:56 +0800 From: Baoquan He To: Niklas Schnelle Cc: Christoph Hellwig , 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, Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , linux-s390@vger.kernel.org Subject: Re: [PATCH v2 09/11] s390: mm: Convert to GENERIC_IOREMAP Message-ID: References: <20220820003125.353570-1-bhe@redhat.com> <20220820003125.353570-10-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.78 on 10.11.54.6 ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Ylnk54VD; spf=pass (imf20.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661936407; a=rsa-sha256; cv=none; b=W/dbHtAHDS7uerOoTrtDriivdYKwKyFcOT8mGDjuLsUWHgA6Ossb0Jb5wlx8bkepfXzVyb vVWUpshzMEeDhgIJsRCxVeEo5AmGlt/C4UX6KslBA/fK06tEcn4YaDrkBRzhHdTyIfr+fg hAmqh3oDI4rkrsAK9nuLd6v6xRdhEnI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661936407; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=+aX/ysPy4g/ZBHpw80NPiA1D0zFDi9OYqQPxY6Pf5Q8=; b=1lg7hOkMf0hlSusEI1+85mFdLGHffalEDEDAVYIACpG3jxh9Gh1RBXorEVvYDN1ysyURZ0 +WbBnDVw/OFvAa5csBhMhkK521jkfp5uDm/aomq1iuGmdDtE6Vdg6WFi+vqyb97PgMT2A2 yXHJGWmvP0+8RW8n00KzoD6DK4dE0wg= X-Rspam-User: X-Rspamd-Queue-Id: F024F1C0055 Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Ylnk54VD; spf=pass (imf20.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: x1rha87fkx4xresucu9yy655wjgjybwo X-Rspamd-Server: rspam08 X-HE-Tag: 1661936406-466475 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 08/22/22 at 05:08pm, Niklas Schnelle wrote: > On Sun, 2022-08-21 at 00:05 -0700, Christoph Hellwig wrote: > > > +void __iomem * > > > +arch_ioremap(phys_addr_t *paddr, size_t size, unsigned long *prot_val) > > > { > > > if (!static_branch_unlikely(&have_mio)) > > > + return (void __iomem *) *paddr; > > > + return NULL; > > > > This logic isn't new in the patch, but it could really use a comment > > as it is rather non-obvious. > > Yes, makes sense. Basically we fake MMIO addresses because the s390 > architecture doesn't have MMIO as a concept. That is until the PCI MIO > instructions introduced pseudo-MMIO though only for specific PCI > load/store instructions. Without those PCI BAR spaces as well as config > space is accessed with so called function handles. As these are a bad > fit for Linux' MMIO based APIs we create fake MMIO addresses (called > address cookies) that encode an index into the zpci_iomap_start[] which > can be decoded by our implementation of ioread*/iowrite*(). > > I don't think this is the right place to describe this overall scheme > in detail but maybe we can leave a a good bread crumb. Maybe something > like below? > > /* > * When PCI MIO instructions are unavailable the "physical" address encodes > * a hint for accessing the PCI memory space it represents. Just pass it > * unchanged such that ioread/iowrite can decode it. > */ Thanks. Looks good to me, I will add these to above the code. >