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 D608FC32774 for ; Mon, 22 Aug 2022 15:10:06 +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:Mime-Version:References:In-Reply-To: Date:Cc:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OFv4PQTGm0egiPjidTWrXAKeAIzXjuB7hq0LES45pzI=; b=T448Qw5R8ppcHW RiuwZwO6lN6BLiEoZnBd2M+64eCvfynv7oOuzSxV/gIlDZiWGrvlcw9S72kg095zddBnIUeGQXaRp G5T+WsF8xz4fsGO/ZdnV37/JolZ2WBBRheppZBpfJ7k3+N3OWBlsRLhSPaCY2Z/y9f/26dJQBAEdI +VAUqSk+KgdO0r5DH2/cFxP0qwqlMlrpMvyDI1fZcPz/vN2kPQPsqMWWRXLsd3YTPyItEGSM5jKuj pEr2IHG82OGEkyO8gN93NAoPbqpUteqbkTUL0oXNY3I8ugZ/u/TStG3UIXkosX2/3cu4ukmc3UsRh mn0yy7JKeESrFaJXlQxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQ92d-00BzzF-5O; Mon, 22 Aug 2022 15:08:39 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQ92T-00Bztl-Bo for linux-arm-kernel@lists.infradead.org; Mon, 22 Aug 2022 15:08:36 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27MDfqsC018658; Mon, 22 Aug 2022 15:08:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=/kFdotxqYljhODEbmfcrjJRxem7m3XLEa6JfkgUOlME=; b=e7Sv3iVEHhM1QezCNWYR6rqei1mNP3oeyqeHxZCcPs2yjmXwU1vPYG2JF6NhsM2tsIil Q3BNp/e+d5bCs1j1+GLyeWeSo27AoWABPGw30tBPwbUISoMPIpgKSunYhnOLyDA7iYXJ xLZHAHPW5Jy5mnOniMKN7tYfjAVF6LwEc0IVbcQo31xuq2cfmSWaZI5swPlGQYfMEIr0 h3Y08Nug4PRHyP3RNH3zbbtuQ3VhLJ7mwpWDyejasxKu2xE87gqoIq3UBp6Q3MtX/hlw E9fX0E0R04NDhDwQBHZB5oVeR0r418ML+B/Tcwwil9lCw5n36uvKRwSVB32WlHtMX0ap 7A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3j4awkasuv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Aug 2022 15:08:18 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 27MElKn0012965; Mon, 22 Aug 2022 15:08:17 GMT Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3j4awkastk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Aug 2022 15:08:17 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 27MF5AAr022369; Mon, 22 Aug 2022 15:08:14 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma04fra.de.ibm.com with ESMTP id 3j2q88svrg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 Aug 2022 15:08:14 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 27MF8Bw325559456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Aug 2022 15:08:11 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3A44B4C04A; Mon, 22 Aug 2022 15:08:11 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D089C4C046; Mon, 22 Aug 2022 15:08:10 +0000 (GMT) Received: from oc-nschnelle.boeblingen.de.ibm.com (unknown [9.155.199.46]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 22 Aug 2022 15:08:10 +0000 (GMT) Message-ID: Subject: Re: [PATCH v2 09/11] s390: mm: Convert to GENERIC_IOREMAP From: Niklas Schnelle To: Christoph Hellwig , Baoquan He 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, Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , linux-s390@vger.kernel.org Date: Mon, 22 Aug 2022 17:08:10 +0200 In-Reply-To: References: <20220820003125.353570-1-bhe@redhat.com> <20220820003125.353570-10-bhe@redhat.com> X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 9TrsJ1zE2LTP3LvI4TlHsl8k9DtHeji8 X-Proofpoint-ORIG-GUID: kUOOtbbtGXvg16G1-b06F3wGukiJtZiM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-22_09,2022-08-22_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 mlxscore=0 clxscore=1011 priorityscore=1501 mlxlogscore=927 malwarescore=0 spamscore=0 impostorscore=0 phishscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208220064 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220822_080834_814527_9E40486E X-CRM114-Status: GOOD ( 20.76 ) 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 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. */ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel