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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64270ECAAD1 for ; Wed, 31 Aug 2022 09:01:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Q72yBuyg7n7ZjuICUflu1MS2ZyH1N3yeZwtmuoryQjw=; b=zE/ueLI85yj3yG kZ1LBpXyuisiHViRBPRT3ju3UIuDjJPuq2ouMJb56ObSNHucPWZ9BOxqyYtM6X7vgJkNZyYheTg6q n+ymBB0IKps/geKP7YQc0jkl7zU0qs2jeJ8nv6ShpHGFKaCJ4tmN8CfWBoQ/EK4+U1db63+eU8dWl djYXGN5hSb0yxyJTLMmVKwNAeMJ5lOKGvUeZlbjGzgiu2rCejLsMQq+AGnLbjyzm8FUnmUWOi34xA l4pHvy5kWbogRw5rgg9PLOAfTdU4foxb8aZJpRK55+36Dc3nSNxR6GFs4OWiM6dS9AdpUZYKHIjrH rMhvNPsCJawKUVJ3e9wg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTJa1-0057lb-9h; Wed, 31 Aug 2022 09:00:13 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTJZy-0057jv-A8 for linux-arm-kernel@lists.infradead.org; Wed, 31 Aug 2022 09:00:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661936409; 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=hmduZVuqrxGqKX3Fwl1HNepl8bU+SjPt3VEzPeA6u1TCf7u1Ds4BoDFEM6AGKYdUZEuI+5 eG77EILFQTwrtss5MRCHsOgkYywylTojMBoBk6Kc9qRYPdOqpVmx7f6im+EITZXgqoe9Aa Zk98jNKxc9b5rKrXzDcHy/rz5M9SMek= 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-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220831_020010_439995_8CBE9A30 X-CRM114-Status: GOOD ( 22.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel