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 3679BC433F5 for ; Fri, 17 Dec 2021 15:27:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238163AbhLQP1m (ORCPT ); Fri, 17 Dec 2021 10:27:42 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:4304 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbhLQP1l (ORCPT ); Fri, 17 Dec 2021 10:27:41 -0500 Received: from fraeml706-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4JFt6764x3z67HV7; Fri, 17 Dec 2021 23:23:11 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml706-chm.china.huawei.com (10.206.15.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.20; Fri, 17 Dec 2021 16:27:38 +0100 Received: from [10.47.26.158] (10.47.26.158) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 17 Dec 2021 15:27:37 +0000 Subject: Re: [GIT PULL 1/2] asm-generic: rework PCI I/O space access To: Arnd Bergmann CC: Niklas Schnelle , Linus Torvalds , linux-arch , linux-pci , Linux Kernel Mailing List References: <5e8dfbd2-a6c0-6d02-53e9-1f29aebcc44e@huawei.com> <47744c7bce7b7bb37edee7f249d61dc57ac1fbc5.camel@linux.ibm.com> <849d70bddde1cfcb3ab1163970a148ff447ee94b.camel@linux.ibm.com> <53746e42-23a2-049d-9b38-dcfbaaae728f@huawei.com> From: John Garry Message-ID: Date: Fri, 17 Dec 2021 15:27:09 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.47.26.158] X-ClientProxiedBy: lhreml751-chm.china.huawei.com (10.201.108.201) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/12/2021 14:32, Arnd Bergmann wrote: >> I was interesting in the IOPORT_NATIVE flag (or whatever we call it) as >> it solves the problem of drivers which "unconditionally do inb()/outb() >> without checking the validity of the address using firmware or other >> methods first" being built for (and loaded on and crashing) unsuitable >> systems. Such a problem is in [0] >> >> So if we want to support that later, then it seems that someone would >> need to go back and re-edit many same driver Kconfigs – like hwmon, for >> example. I think it's better to avoid that and do it now. >> >> Arnd, any opinion on that? >> >> I'm happy to help with that effort. > I looked at the options the other day and couldn't really find any that > fell into this category, so I suggested that Niklas would skip that for the > moment. From looking at the patch Niklas directed us at, as I understand, HAS_IOPORT is to decide whether the arch/platform may support PIO accessors - inb et al. And on that basis I am confused why it is not selected for arm64. And further compounded by: config INDIRECT_PIO bool "Access I/O in non-MMIO mode" depends on ARM64 + depends on HAS_IOPORT If arm64 does not select, then why depend on it? > If you have a better way of finding the affected drivers, > that would be great. Assuming arm64 should select HAS_IOPORT, I am talking about f71805f as an example. According to that patch, this driver additionally depends on HAS_IOPORT; however I would rather arm64, like powerpc, should not allow that driver to be built at all. Thanks, John