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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39757ECAAD1 for ; Wed, 31 Aug 2022 09:00:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230243AbiHaJAP (ORCPT ); Wed, 31 Aug 2022 05:00:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230443AbiHaJAL (ORCPT ); Wed, 31 Aug 2022 05:00:11 -0400 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 8E6072AC48 for ; Wed, 31 Aug 2022 02:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661936407; 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=hmDmmICgg9nWdJ5dycrA0ya45nAn498SLT60LqhpC27ZLLLXOppQd2ZdL9dl2FrjywVY/Z bOkVr5QZdj4ytRc34EgOQ/ccB8am9+5sKw32lLpEA1bPzmy8p8byBLRVxxcN8sat/RUyTn x8kcLP/ZPyaYpT02sYtp3Gig7ooODzo= 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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. >