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 DB12DC4321E for ; Wed, 29 Dec 2021 04:15:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238702AbhL2EPw (ORCPT ); Tue, 28 Dec 2021 23:15:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234127AbhL2EPv (ORCPT ); Tue, 28 Dec 2021 23:15:51 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8C94C061574; Tue, 28 Dec 2021 20:15:50 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id y16-20020a17090a6c9000b001b13ffaa625so23422714pjj.2; Tue, 28 Dec 2021 20:15:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=oo7gGMOkpKZtsifyQrF9uAkP4p/YBx2m/GIQa4Tq0YE=; b=SgUGGN6VhsGuSJ4+x7BV8WmUFGnq6AU/S3MGIbRuvgcmK5iemLDPInHX4HtGqsDBOP X+ShdKiY6WGvZxZzGll6Lp9gXc9Iofh3zmxzNCmw3Dn3KgxWg++og+5/hcFLsP9lz2Xr 2GF2kpRya+BTKsokuDFYluzgdLN+9R6oDmfEeq5seHlKkuDQoWmHZpB5lsfFQJLsHHhA J+6fOy7KSqTSf4RHl5+/z/3kvG8PPaQjjUrbxIO/1twWStmOPd1O5hfeFSFRI+7/1KDQ V6duyLcOszOYryU8sc+sZAK9TuMnZyNEumxgE9K0xpEM2ht/1sy9t9bhV6U0QsHIl9qG 4r0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=oo7gGMOkpKZtsifyQrF9uAkP4p/YBx2m/GIQa4Tq0YE=; b=KBzGL3s6jpYh+zXFhoNlooew1/s2GIKYj5wfouCPH52rXnr7OLq4aIlM9+vyDkDQCd IpiAzfROzeAL+RaHmxRt4fQg0ufpGoqkoc+B7E1ztllRb0oZRIn0Fuqwikmg5sTDz7UX auuBwKPJy1Zw7LwGNj/yBVs1wB0NX7XhKCpQ/+3PZjfpx1qjNThDu6bb9jBB17m+E4OD J+IX+YHJSHEZ3odqwLIYkjOr1a9rduBLYr2MDq9pv/a8dboDTFxQo0tYvmlWi56MKCLB r84H/bcbmM29qT19TbQ1N72096xP2NTeXQbo3fWS48Zk44qUqT7Ar/nYZsdw97ZbOd9g aKEA== X-Gm-Message-State: AOAM531I4wokCnYgtKI2zEtEXZOhBV7RmIehnSoVPQ5d3n7itvOZeaVa X8yVj//7LWOtrWR33DZPFyg= X-Google-Smtp-Source: ABdhPJyjCqGNhQip5lk1bKe/Q9ifrO91rL0XFrD4WiMDGXXaVLZjRe+Yr2Tq1lIfNgSSQkzYLSFwkQ== X-Received: by 2002:a17:902:d48a:b0:148:a8ae:7ab7 with SMTP id c10-20020a170902d48a00b00148a8ae7ab7mr24900237plg.171.1640751350387; Tue, 28 Dec 2021 20:15:50 -0800 (PST) Received: from [10.1.1.24] (222-155-5-102-adsl.sparkbb.co.nz. [222.155.5.102]) by smtp.gmail.com with ESMTPSA id k9sm13406563pgr.47.2021.12.28.20.15.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Dec 2021 20:15:49 -0800 (PST) Subject: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary To: Arnd Bergmann References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> Cc: Geert Uytterhoeven , Niklas Schnelle , Bjorn Helgaas , John Garry , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Dinh Nguyen , Chris Zankel , Karol Gugala , Jeff Dike , Yoshinori Sato , Brian Cain , Heiko Carstens , Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Michal Simek , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Rich Felker , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, linux-s390@vger.kernel.org, linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, Greg Ungerer From: Michael Schmitz Message-ID: <1f90f145-219e-1cad-6162-9959d43a27ad@gmail.com> Date: Wed, 29 Dec 2021 17:15:23 +1300 User-Agent: Mozilla/5.0 (X11; Linux ppc; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, Am 29.12.2021 um 16:41 schrieb Arnd Bergmann: > On Tue, Dec 28, 2021 at 8:20 PM Michael Schmitz wrote: >> Am 28.12.2021 um 23:08 schrieb Geert Uytterhoeven: >>> On Mon, Dec 27, 2021 at 5:44 PM Niklas Schnelle wrote: >>>> We introduce a new HAS_IOPORT Kconfig option to gate support for >>>> I/O port access. In a future patch HAS_IOPORT=n will disable compilation >>>> of the I/O accessor functions inb()/outb() and friends on architectures >>>> which can not meaningfully support legacy I/O spaces. On these platforms >>>> inb()/outb() etc are currently just stubs in asm-generic/io.h which when >>>> called will cause a NULL pointer access which some compilers actually >>>> detect and warn about. >>>> >>>> The dependencies on HAS_IOPORT in drivers as well as ifdefs for >>>> HAS_IOPORT specific sections will be added in subsequent patches on >>>> a per subsystem basis. Then a final patch will ifdef the I/O access >>>> functions on HAS_IOPORT thus turning any use not gated by HAS_IOPORT >>>> into a compile-time warning. >>>> >>>> Link: https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/ >>>> Co-developed-by: Arnd Bergmann >>>> Signed-off-by: Arnd Bergmann >>>> Signed-off-by: Niklas Schnelle >>> >>> Thanks for your patch! >>> >>>> --- a/arch/m68k/Kconfig >>>> +++ b/arch/m68k/Kconfig >>>> @@ -16,6 +16,7 @@ config M68K >>>> select GENERIC_CPU_DEVICES >>>> select GENERIC_IOMAP >>>> select GENERIC_IRQ_SHOW >>>> + select HAS_IOPORT >>>> select HAVE_AOUT if MMU >>>> select HAVE_ASM_MODVERSIONS >>>> select HAVE_DEBUG_BUGVERBOSE >>> >>> This looks way too broad to me: most m68k platform do not have I/O >>> port access support. >>> >>> My gut feeling says: >>> >>> select HAS_IOPORT if PCI || ISA >>> >>> but that might miss some intricate details... >> >> In particular, this misses the Atari ROM port ISA adapter case - >> >> select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA >> >> might do instead. > > Right, makes sense. I had suggested to go the easy way and assume that > each architecture would select HAS_IOPORT if any configuration supports > it, but it looks like for m68k there is a clearly defined set of platforms that > do. > > Note that for the platforms that don't set any of the three symbols, the > fallback makes inb() an alias for readb() with a different argument type, > so there may be m68k specific drivers that rely on this, but those would > already be broken if ATARI_ROM_ISA is set. I'd hope not - we spent some effort to make sure setting ATARI_ROM_ISA does not affect other m68k platforms when e.g. building multiplatform kernels. Replacing inb() by readb() without any address translation won't do much good for m68k though - addresses in the traditional ISA I/O port range would hit the (unmapped) zero page. Cheers, Michael > > Arnd > 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 28D79C433FE for ; Wed, 29 Dec 2021 04:15:57 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From:Cc: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lNl9tGOju5nEkk4xClG7Ek9FZLs3OYgGMtscMrRbesY=; b=S6QhUjPo7QK3xOnEwvENxRqnV9 imaVeGJZnQxmOYt4ux3Kk3fA4XE2PrTcBLUPNp+RHVx1VBoQFuj28T27aLty3XWQlOPK0r8wcoFWr CinTniQkedsYJVHUTl7oz+qP/yq5Cevekg+jhxunwlGfYfFoAqu1OtMbtwtJ4olRRbS04UW3IoDIx bq9TNFyjc/6VO9nScQiN8j8EPse2spPp0f2S1QBXk6laBgcVJbbDC5bltNaQmYVB1D2ktsx6Aqx4H osN4tXp7gkXh6QMfK/r63xPakp4VSPoeef3g4IfexvIxWL+a4adOURgMDjAHtphn1GZD/CjGEuR9P 9MVwBtMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2QNW-002EHL-5T; Wed, 29 Dec 2021 04:15:54 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2QNT-002EGV-4d; Wed, 29 Dec 2021 04:15:52 +0000 Received: by mail-pl1-x633.google.com with SMTP id n16so15011027plc.2; Tue, 28 Dec 2021 20:15:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=oo7gGMOkpKZtsifyQrF9uAkP4p/YBx2m/GIQa4Tq0YE=; b=SgUGGN6VhsGuSJ4+x7BV8WmUFGnq6AU/S3MGIbRuvgcmK5iemLDPInHX4HtGqsDBOP X+ShdKiY6WGvZxZzGll6Lp9gXc9Iofh3zmxzNCmw3Dn3KgxWg++og+5/hcFLsP9lz2Xr 2GF2kpRya+BTKsokuDFYluzgdLN+9R6oDmfEeq5seHlKkuDQoWmHZpB5lsfFQJLsHHhA J+6fOy7KSqTSf4RHl5+/z/3kvG8PPaQjjUrbxIO/1twWStmOPd1O5hfeFSFRI+7/1KDQ V6duyLcOszOYryU8sc+sZAK9TuMnZyNEumxgE9K0xpEM2ht/1sy9t9bhV6U0QsHIl9qG 4r0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=oo7gGMOkpKZtsifyQrF9uAkP4p/YBx2m/GIQa4Tq0YE=; b=nUCQ9Bu0xoyq6CCzVT633pT35+WYTQpEsLuYSzVe9ZxIR8v21HMqtzTbdp5/+P0IVm wUJdVoob0tSPg8DMqODqvo0nmyvOBxnHR231PyBpg351wIcM3AsE+OTdVcCyGSmlBaVC egtjDnP+YLG3VvzwGbUiKgdNk80Nujvb4uSojWckPae7PPNrtTYT8bnv9XfZ9AF87HML a1JD7vJXP0qr5+KzvoZU3Tqo9zrkpYMzDiZ8oS4UIFos+8qRHS040GMr05SxZkL+U9pT y9+UGr5/sbUWdbr40ymClRgsUY2/C3AddU3FxkDeL96OWdb4tL34CZnuh5YAK3GS7Fy3 u91w== X-Gm-Message-State: AOAM531AFkG1hgCuDIib1JLG/mLs1TD9bWMDNGgaYwLrCJrLK6Ux3Enw DDM4AJoH8VgvyEmNG+RtqbQ= X-Google-Smtp-Source: ABdhPJyjCqGNhQip5lk1bKe/Q9ifrO91rL0XFrD4WiMDGXXaVLZjRe+Yr2Tq1lIfNgSSQkzYLSFwkQ== X-Received: by 2002:a17:902:d48a:b0:148:a8ae:7ab7 with SMTP id c10-20020a170902d48a00b00148a8ae7ab7mr24900237plg.171.1640751350387; Tue, 28 Dec 2021 20:15:50 -0800 (PST) Received: from [10.1.1.24] (222-155-5-102-adsl.sparkbb.co.nz. [222.155.5.102]) by smtp.gmail.com with ESMTPSA id k9sm13406563pgr.47.2021.12.28.20.15.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Dec 2021 20:15:49 -0800 (PST) Subject: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary To: Arnd Bergmann References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> Cc: Geert Uytterhoeven , Niklas Schnelle , Bjorn Helgaas , John Garry , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Dinh Nguyen , Chris Zankel , Karol Gugala , Jeff Dike , Yoshinori Sato , Brian Cain , Heiko Carstens , Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Michal Simek , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Rich Felker , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, linux-s390@vger.kernel.org, linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, Greg Ungerer From: Michael Schmitz Message-ID: <1f90f145-219e-1cad-6162-9959d43a27ad@gmail.com> Date: Wed, 29 Dec 2021 17:15:23 +1300 User-Agent: Mozilla/5.0 (X11; Linux ppc; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211228_201551_230451_42F87658 X-CRM114-Status: GOOD ( 21.24 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org Hi Arnd, Am 29.12.2021 um 16:41 schrieb Arnd Bergmann: > On Tue, Dec 28, 2021 at 8:20 PM Michael Schmitz wrote: >> Am 28.12.2021 um 23:08 schrieb Geert Uytterhoeven: >>> On Mon, Dec 27, 2021 at 5:44 PM Niklas Schnelle wrote: >>>> We introduce a new HAS_IOPORT Kconfig option to gate support for >>>> I/O port access. In a future patch HAS_IOPORT=n will disable compilation >>>> of the I/O accessor functions inb()/outb() and friends on architectures >>>> which can not meaningfully support legacy I/O spaces. On these platforms >>>> inb()/outb() etc are currently just stubs in asm-generic/io.h which when >>>> called will cause a NULL pointer access which some compilers actually >>>> detect and warn about. >>>> >>>> The dependencies on HAS_IOPORT in drivers as well as ifdefs for >>>> HAS_IOPORT specific sections will be added in subsequent patches on >>>> a per subsystem basis. Then a final patch will ifdef the I/O access >>>> functions on HAS_IOPORT thus turning any use not gated by HAS_IOPORT >>>> into a compile-time warning. >>>> >>>> Link: https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/ >>>> Co-developed-by: Arnd Bergmann >>>> Signed-off-by: Arnd Bergmann >>>> Signed-off-by: Niklas Schnelle >>> >>> Thanks for your patch! >>> >>>> --- a/arch/m68k/Kconfig >>>> +++ b/arch/m68k/Kconfig >>>> @@ -16,6 +16,7 @@ config M68K >>>> select GENERIC_CPU_DEVICES >>>> select GENERIC_IOMAP >>>> select GENERIC_IRQ_SHOW >>>> + select HAS_IOPORT >>>> select HAVE_AOUT if MMU >>>> select HAVE_ASM_MODVERSIONS >>>> select HAVE_DEBUG_BUGVERBOSE >>> >>> This looks way too broad to me: most m68k platform do not have I/O >>> port access support. >>> >>> My gut feeling says: >>> >>> select HAS_IOPORT if PCI || ISA >>> >>> but that might miss some intricate details... >> >> In particular, this misses the Atari ROM port ISA adapter case - >> >> select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA >> >> might do instead. > > Right, makes sense. I had suggested to go the easy way and assume that > each architecture would select HAS_IOPORT if any configuration supports > it, but it looks like for m68k there is a clearly defined set of platforms that > do. > > Note that for the platforms that don't set any of the three symbols, the > fallback makes inb() an alias for readb() with a different argument type, > so there may be m68k specific drivers that rely on this, but those would > already be broken if ATARI_ROM_ISA is set. I'd hope not - we spent some effort to make sure setting ATARI_ROM_ISA does not affect other m68k platforms when e.g. building multiplatform kernels. Replacing inb() by readb() without any address translation won't do much good for m68k though - addresses in the traditional ISA I/O port range would hit the (unmapped) zero page. Cheers, Michael > > Arnd > _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc 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 377CAC433EF for ; Wed, 29 Dec 2021 04:16:12 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From:Cc: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GD/nRebwCMobWP7sk1CDZ15FuPE6bDqZ3OBcH1ehA6Y=; b=bwbxG3qFSE1eXAIuL19+wKDDcW 3/q24GX3heVHLfQZD7rQoCGS2YoJw8v4acxGQUuwZrnlAnOV7oetWq1GIgNtfhcd34hfpbZDfqpnj trg/0vGyoDZ7+CmRYhftfopcqnxpdkuuPRgxXdn3hZg93X0CMI45Nn6xGsL1dLmOc8i7Mt//s/3cX x75ZqtnxWOkp4mEYU3qYWHd3QA7tVIVfMqtWIFjnM+DjGhc6ee0xQqZ+DBVX3EQXKnplLoTBhXkrh bHbE+nWXNv46xm6P2sg8F0JjFHY5dZmLW7ZdDpVhBbZ7Q5Jt33YS3C9J0JU8nvbfKuQix44ZCDMKa goC7wvdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2QNW-002EHR-CO; Wed, 29 Dec 2021 04:15:54 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2QNT-002EGV-4d; Wed, 29 Dec 2021 04:15:52 +0000 Received: by mail-pl1-x633.google.com with SMTP id n16so15011027plc.2; Tue, 28 Dec 2021 20:15:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=oo7gGMOkpKZtsifyQrF9uAkP4p/YBx2m/GIQa4Tq0YE=; b=SgUGGN6VhsGuSJ4+x7BV8WmUFGnq6AU/S3MGIbRuvgcmK5iemLDPInHX4HtGqsDBOP X+ShdKiY6WGvZxZzGll6Lp9gXc9Iofh3zmxzNCmw3Dn3KgxWg++og+5/hcFLsP9lz2Xr 2GF2kpRya+BTKsokuDFYluzgdLN+9R6oDmfEeq5seHlKkuDQoWmHZpB5lsfFQJLsHHhA J+6fOy7KSqTSf4RHl5+/z/3kvG8PPaQjjUrbxIO/1twWStmOPd1O5hfeFSFRI+7/1KDQ V6duyLcOszOYryU8sc+sZAK9TuMnZyNEumxgE9K0xpEM2ht/1sy9t9bhV6U0QsHIl9qG 4r0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=oo7gGMOkpKZtsifyQrF9uAkP4p/YBx2m/GIQa4Tq0YE=; b=nUCQ9Bu0xoyq6CCzVT633pT35+WYTQpEsLuYSzVe9ZxIR8v21HMqtzTbdp5/+P0IVm wUJdVoob0tSPg8DMqODqvo0nmyvOBxnHR231PyBpg351wIcM3AsE+OTdVcCyGSmlBaVC egtjDnP+YLG3VvzwGbUiKgdNk80Nujvb4uSojWckPae7PPNrtTYT8bnv9XfZ9AF87HML a1JD7vJXP0qr5+KzvoZU3Tqo9zrkpYMzDiZ8oS4UIFos+8qRHS040GMr05SxZkL+U9pT y9+UGr5/sbUWdbr40ymClRgsUY2/C3AddU3FxkDeL96OWdb4tL34CZnuh5YAK3GS7Fy3 u91w== X-Gm-Message-State: AOAM531AFkG1hgCuDIib1JLG/mLs1TD9bWMDNGgaYwLrCJrLK6Ux3Enw DDM4AJoH8VgvyEmNG+RtqbQ= X-Google-Smtp-Source: ABdhPJyjCqGNhQip5lk1bKe/Q9ifrO91rL0XFrD4WiMDGXXaVLZjRe+Yr2Tq1lIfNgSSQkzYLSFwkQ== X-Received: by 2002:a17:902:d48a:b0:148:a8ae:7ab7 with SMTP id c10-20020a170902d48a00b00148a8ae7ab7mr24900237plg.171.1640751350387; Tue, 28 Dec 2021 20:15:50 -0800 (PST) Received: from [10.1.1.24] (222-155-5-102-adsl.sparkbb.co.nz. [222.155.5.102]) by smtp.gmail.com with ESMTPSA id k9sm13406563pgr.47.2021.12.28.20.15.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Dec 2021 20:15:49 -0800 (PST) Subject: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary To: Arnd Bergmann References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> Cc: Geert Uytterhoeven , Niklas Schnelle , Bjorn Helgaas , John Garry , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Dinh Nguyen , Chris Zankel , Karol Gugala , Jeff Dike , Yoshinori Sato , Brian Cain , Heiko Carstens , Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Michal Simek , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Rich Felker , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, linux-s390@vger.kernel.org, linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, Greg Ungerer From: Michael Schmitz Message-ID: <1f90f145-219e-1cad-6162-9959d43a27ad@gmail.com> Date: Wed, 29 Dec 2021 17:15:23 +1300 User-Agent: Mozilla/5.0 (X11; Linux ppc; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211228_201551_230451_42F87658 X-CRM114-Status: GOOD ( 21.24 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Hi Arnd, Am 29.12.2021 um 16:41 schrieb Arnd Bergmann: > On Tue, Dec 28, 2021 at 8:20 PM Michael Schmitz wrote: >> Am 28.12.2021 um 23:08 schrieb Geert Uytterhoeven: >>> On Mon, Dec 27, 2021 at 5:44 PM Niklas Schnelle wrote: >>>> We introduce a new HAS_IOPORT Kconfig option to gate support for >>>> I/O port access. In a future patch HAS_IOPORT=n will disable compilation >>>> of the I/O accessor functions inb()/outb() and friends on architectures >>>> which can not meaningfully support legacy I/O spaces. On these platforms >>>> inb()/outb() etc are currently just stubs in asm-generic/io.h which when >>>> called will cause a NULL pointer access which some compilers actually >>>> detect and warn about. >>>> >>>> The dependencies on HAS_IOPORT in drivers as well as ifdefs for >>>> HAS_IOPORT specific sections will be added in subsequent patches on >>>> a per subsystem basis. Then a final patch will ifdef the I/O access >>>> functions on HAS_IOPORT thus turning any use not gated by HAS_IOPORT >>>> into a compile-time warning. >>>> >>>> Link: https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/ >>>> Co-developed-by: Arnd Bergmann >>>> Signed-off-by: Arnd Bergmann >>>> Signed-off-by: Niklas Schnelle >>> >>> Thanks for your patch! >>> >>>> --- a/arch/m68k/Kconfig >>>> +++ b/arch/m68k/Kconfig >>>> @@ -16,6 +16,7 @@ config M68K >>>> select GENERIC_CPU_DEVICES >>>> select GENERIC_IOMAP >>>> select GENERIC_IRQ_SHOW >>>> + select HAS_IOPORT >>>> select HAVE_AOUT if MMU >>>> select HAVE_ASM_MODVERSIONS >>>> select HAVE_DEBUG_BUGVERBOSE >>> >>> This looks way too broad to me: most m68k platform do not have I/O >>> port access support. >>> >>> My gut feeling says: >>> >>> select HAS_IOPORT if PCI || ISA >>> >>> but that might miss some intricate details... >> >> In particular, this misses the Atari ROM port ISA adapter case - >> >> select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA >> >> might do instead. > > Right, makes sense. I had suggested to go the easy way and assume that > each architecture would select HAS_IOPORT if any configuration supports > it, but it looks like for m68k there is a clearly defined set of platforms that > do. > > Note that for the platforms that don't set any of the three symbols, the > fallback makes inb() an alias for readb() with a different argument type, > so there may be m68k specific drivers that rely on this, but those would > already be broken if ATARI_ROM_ISA is set. I'd hope not - we spent some effort to make sure setting ATARI_ROM_ISA does not affect other m68k platforms when e.g. building multiplatform kernels. Replacing inb() by readb() without any address translation won't do much good for m68k though - addresses in the traditional ISA I/O port range would hit the (unmapped) zero page. Cheers, Michael > > Arnd > _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 CEE40C433EF for ; Thu, 30 Dec 2021 08:02:10 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4JPgjF1jQRz3dm0 for ; Thu, 30 Dec 2021 19:02:09 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=SgUGGN6V; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::102d; helo=mail-pj1-x102d.google.com; envelope-from=schmitzmic@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=SgUGGN6V; dkim-atps=neutral Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4JNykf0rRdz2xsq for ; Wed, 29 Dec 2021 15:15:53 +1100 (AEDT) Received: by mail-pj1-x102d.google.com with SMTP id y16-20020a17090a6c9000b001b13ffaa625so23422738pjj.2 for ; Tue, 28 Dec 2021 20:15:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=oo7gGMOkpKZtsifyQrF9uAkP4p/YBx2m/GIQa4Tq0YE=; b=SgUGGN6VhsGuSJ4+x7BV8WmUFGnq6AU/S3MGIbRuvgcmK5iemLDPInHX4HtGqsDBOP X+ShdKiY6WGvZxZzGll6Lp9gXc9Iofh3zmxzNCmw3Dn3KgxWg++og+5/hcFLsP9lz2Xr 2GF2kpRya+BTKsokuDFYluzgdLN+9R6oDmfEeq5seHlKkuDQoWmHZpB5lsfFQJLsHHhA J+6fOy7KSqTSf4RHl5+/z/3kvG8PPaQjjUrbxIO/1twWStmOPd1O5hfeFSFRI+7/1KDQ V6duyLcOszOYryU8sc+sZAK9TuMnZyNEumxgE9K0xpEM2ht/1sy9t9bhV6U0QsHIl9qG 4r0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=oo7gGMOkpKZtsifyQrF9uAkP4p/YBx2m/GIQa4Tq0YE=; b=IcS6pXXtgeeDtusl2ex5Irte4KZsLGSmOzGOioDJkA3OKeWgWKDFp3HfGRf+Ij4L80 GpY41VX5JQ2dq8UoYG5Ij6H6lgbGVTh/Fgxm8C1ZWoOaBbBEvYMqUMNgunJAP98ZgYWg /uyaxpnwP0V67iwGoed5IFLE2N2QX+QsR5xw0w7TtqI6Ru3Fsweo6hD97I+R5DCIJW27 +7e3JIfU5LdRI5o7Snm3bpBuTry1wf7fcZb/13FnclF2X/FVNx6mv0rw5httejxANc9c Fl036O0i7G5T+hAXcI/+VRqucXeomWxE+Kts9Km6+h9Smn8s90NuWb4t92rcxkqZgTeo fRAg== X-Gm-Message-State: AOAM5333aNZGviHR8fPpbcr2eVDVJwfKsfW7hrT5HCxViq83aLRw65/k HJOshKFVirjTbQI0hsk3cWw= X-Google-Smtp-Source: ABdhPJyjCqGNhQip5lk1bKe/Q9ifrO91rL0XFrD4WiMDGXXaVLZjRe+Yr2Tq1lIfNgSSQkzYLSFwkQ== X-Received: by 2002:a17:902:d48a:b0:148:a8ae:7ab7 with SMTP id c10-20020a170902d48a00b00148a8ae7ab7mr24900237plg.171.1640751350387; Tue, 28 Dec 2021 20:15:50 -0800 (PST) Received: from [10.1.1.24] (222-155-5-102-adsl.sparkbb.co.nz. [222.155.5.102]) by smtp.gmail.com with ESMTPSA id k9sm13406563pgr.47.2021.12.28.20.15.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Dec 2021 20:15:49 -0800 (PST) Subject: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary To: Arnd Bergmann References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> From: Michael Schmitz Message-ID: <1f90f145-219e-1cad-6162-9959d43a27ad@gmail.com> Date: Wed, 29 Dec 2021 17:15:23 +1300 User-Agent: Mozilla/5.0 (X11; Linux ppc; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Thu, 30 Dec 2021 18:58:16 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , linux-sh@vger.kernel.org, Catalin Marinas , Dave Hansen , linux-pci@vger.kernel.org, linux-mips@vger.kernel.org, "James E.J. Bottomley" , sparclinux@vger.kernel.org, Guo Ren , "H. Peter Anvin" , Borislav Petkov , linux-ia64@vger.kernel.org, linux-riscv@lists.infradead.org, Vincent Chen , Will Deacon , Greg Ungerer , Karol Gugala , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Yoshinori Sato , Helge Deller , x86@kernel.org, Russell King , linux-csky@vger.kernel.org, Ingo Molnar , Geert Uytterhoeven , linux-parisc@vger.kernel.org, Vineet Gupta , Matt Turner , linux-snps-arc@lists.infradead.org, Heiko Carstens , linux-xtensa@linux-xtensa.org, Albert Ou , Niklas Schnelle , Jeff Dike , John Garry , linux-m68k@lists.linux-m68k.org, openrisc@lists.librecores.org, Ivan Kokshaysky , Greentime Hu , Paul Walmsley , Bjorn Helgaas , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Richard Henderson , Chris Zankel , Michal Simek , Thomas Bogendoerfer , Brian Cain , Nick Hu , linux-kernel@vger.kernel.org, Dinh Nguyen , Palmer Dabbelt , linux-alpha@vger.kernel.org, Paul Mackerras , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi Arnd, Am 29.12.2021 um 16:41 schrieb Arnd Bergmann: > On Tue, Dec 28, 2021 at 8:20 PM Michael Schmitz wrote: >> Am 28.12.2021 um 23:08 schrieb Geert Uytterhoeven: >>> On Mon, Dec 27, 2021 at 5:44 PM Niklas Schnelle wrote: >>>> We introduce a new HAS_IOPORT Kconfig option to gate support for >>>> I/O port access. In a future patch HAS_IOPORT=n will disable compilation >>>> of the I/O accessor functions inb()/outb() and friends on architectures >>>> which can not meaningfully support legacy I/O spaces. On these platforms >>>> inb()/outb() etc are currently just stubs in asm-generic/io.h which when >>>> called will cause a NULL pointer access which some compilers actually >>>> detect and warn about. >>>> >>>> The dependencies on HAS_IOPORT in drivers as well as ifdefs for >>>> HAS_IOPORT specific sections will be added in subsequent patches on >>>> a per subsystem basis. Then a final patch will ifdef the I/O access >>>> functions on HAS_IOPORT thus turning any use not gated by HAS_IOPORT >>>> into a compile-time warning. >>>> >>>> Link: https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/ >>>> Co-developed-by: Arnd Bergmann >>>> Signed-off-by: Arnd Bergmann >>>> Signed-off-by: Niklas Schnelle >>> >>> Thanks for your patch! >>> >>>> --- a/arch/m68k/Kconfig >>>> +++ b/arch/m68k/Kconfig >>>> @@ -16,6 +16,7 @@ config M68K >>>> select GENERIC_CPU_DEVICES >>>> select GENERIC_IOMAP >>>> select GENERIC_IRQ_SHOW >>>> + select HAS_IOPORT >>>> select HAVE_AOUT if MMU >>>> select HAVE_ASM_MODVERSIONS >>>> select HAVE_DEBUG_BUGVERBOSE >>> >>> This looks way too broad to me: most m68k platform do not have I/O >>> port access support. >>> >>> My gut feeling says: >>> >>> select HAS_IOPORT if PCI || ISA >>> >>> but that might miss some intricate details... >> >> In particular, this misses the Atari ROM port ISA adapter case - >> >> select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA >> >> might do instead. > > Right, makes sense. I had suggested to go the easy way and assume that > each architecture would select HAS_IOPORT if any configuration supports > it, but it looks like for m68k there is a clearly defined set of platforms that > do. > > Note that for the platforms that don't set any of the three symbols, the > fallback makes inb() an alias for readb() with a different argument type, > so there may be m68k specific drivers that rely on this, but those would > already be broken if ATARI_ROM_ISA is set. I'd hope not - we spent some effort to make sure setting ATARI_ROM_ISA does not affect other m68k platforms when e.g. building multiplatform kernels. Replacing inb() by readb() without any address translation won't do much good for m68k though - addresses in the traditional ISA I/O port range would hit the (unmapped) zero page. Cheers, Michael > > Arnd > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Schmitz Date: Wed, 29 Dec 2021 17:15:23 +1300 Subject: [OpenRISC] [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary In-Reply-To: References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> Message-ID: <1f90f145-219e-1cad-6162-9959d43a27ad@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.org Hi Arnd, Am 29.12.2021 um 16:41 schrieb Arnd Bergmann: > On Tue, Dec 28, 2021 at 8:20 PM Michael Schmitz wrote: >> Am 28.12.2021 um 23:08 schrieb Geert Uytterhoeven: >>> On Mon, Dec 27, 2021 at 5:44 PM Niklas Schnelle wrote: >>>> We introduce a new HAS_IOPORT Kconfig option to gate support for >>>> I/O port access. In a future patch HAS_IOPORT=n will disable compilation >>>> of the I/O accessor functions inb()/outb() and friends on architectures >>>> which can not meaningfully support legacy I/O spaces. On these platforms >>>> inb()/outb() etc are currently just stubs in asm-generic/io.h which when >>>> called will cause a NULL pointer access which some compilers actually >>>> detect and warn about. >>>> >>>> The dependencies on HAS_IOPORT in drivers as well as ifdefs for >>>> HAS_IOPORT specific sections will be added in subsequent patches on >>>> a per subsystem basis. Then a final patch will ifdef the I/O access >>>> functions on HAS_IOPORT thus turning any use not gated by HAS_IOPORT >>>> into a compile-time warning. >>>> >>>> Link: https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g at mail.gmail.com/ >>>> Co-developed-by: Arnd Bergmann >>>> Signed-off-by: Arnd Bergmann >>>> Signed-off-by: Niklas Schnelle >>> >>> Thanks for your patch! >>> >>>> --- a/arch/m68k/Kconfig >>>> +++ b/arch/m68k/Kconfig >>>> @@ -16,6 +16,7 @@ config M68K >>>> select GENERIC_CPU_DEVICES >>>> select GENERIC_IOMAP >>>> select GENERIC_IRQ_SHOW >>>> + select HAS_IOPORT >>>> select HAVE_AOUT if MMU >>>> select HAVE_ASM_MODVERSIONS >>>> select HAVE_DEBUG_BUGVERBOSE >>> >>> This looks way too broad to me: most m68k platform do not have I/O >>> port access support. >>> >>> My gut feeling says: >>> >>> select HAS_IOPORT if PCI || ISA >>> >>> but that might miss some intricate details... >> >> In particular, this misses the Atari ROM port ISA adapter case - >> >> select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA >> >> might do instead. > > Right, makes sense. I had suggested to go the easy way and assume that > each architecture would select HAS_IOPORT if any configuration supports > it, but it looks like for m68k there is a clearly defined set of platforms that > do. > > Note that for the platforms that don't set any of the three symbols, the > fallback makes inb() an alias for readb() with a different argument type, > so there may be m68k specific drivers that rely on this, but those would > already be broken if ATARI_ROM_ISA is set. I'd hope not - we spent some effort to make sure setting ATARI_ROM_ISA does not affect other m68k platforms when e.g. building multiplatform kernels. Replacing inb() by readb() without any address translation won't do much good for m68k though - addresses in the traditional ISA I/O port range would hit the (unmapped) zero page. Cheers, Michael > > Arnd > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Schmitz Date: Wed, 29 Dec 2021 04:15:23 +0000 Subject: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary Message-Id: <1f90f145-219e-1cad-6162-9959d43a27ad@gmail.com> List-Id: References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Arnd Bergmann Cc: Geert Uytterhoeven , Niklas Schnelle , Bjorn Helgaas , John Garry , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Dinh Nguyen , Chris Zankel , Karol Gugala , Jeff Dike , Yoshinori Sato , Brian Cain , Heiko Carstens , Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Michal Simek , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Rich Felker , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, linux-s390@vger.kernel.org, linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, Greg Ungerer Hi Arnd, Am 29.12.2021 um 16:41 schrieb Arnd Bergmann: > On Tue, Dec 28, 2021 at 8:20 PM Michael Schmitz wrote: >> Am 28.12.2021 um 23:08 schrieb Geert Uytterhoeven: >>> On Mon, Dec 27, 2021 at 5:44 PM Niklas Schnelle wrote: >>>> We introduce a new HAS_IOPORT Kconfig option to gate support for >>>> I/O port access. In a future patch HAS_IOPORT=n will disable compilation >>>> of the I/O accessor functions inb()/outb() and friends on architectures >>>> which can not meaningfully support legacy I/O spaces. On these platforms >>>> inb()/outb() etc are currently just stubs in asm-generic/io.h which when >>>> called will cause a NULL pointer access which some compilers actually >>>> detect and warn about. >>>> >>>> The dependencies on HAS_IOPORT in drivers as well as ifdefs for >>>> HAS_IOPORT specific sections will be added in subsequent patches on >>>> a per subsystem basis. Then a final patch will ifdef the I/O access >>>> functions on HAS_IOPORT thus turning any use not gated by HAS_IOPORT >>>> into a compile-time warning. >>>> >>>> Link: https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/ >>>> Co-developed-by: Arnd Bergmann >>>> Signed-off-by: Arnd Bergmann >>>> Signed-off-by: Niklas Schnelle >>> >>> Thanks for your patch! >>> >>>> --- a/arch/m68k/Kconfig >>>> +++ b/arch/m68k/Kconfig >>>> @@ -16,6 +16,7 @@ config M68K >>>> select GENERIC_CPU_DEVICES >>>> select GENERIC_IOMAP >>>> select GENERIC_IRQ_SHOW >>>> + select HAS_IOPORT >>>> select HAVE_AOUT if MMU >>>> select HAVE_ASM_MODVERSIONS >>>> select HAVE_DEBUG_BUGVERBOSE >>> >>> This looks way too broad to me: most m68k platform do not have I/O >>> port access support. >>> >>> My gut feeling says: >>> >>> select HAS_IOPORT if PCI || ISA >>> >>> but that might miss some intricate details... >> >> In particular, this misses the Atari ROM port ISA adapter case - >> >> select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA >> >> might do instead. > > Right, makes sense. I had suggested to go the easy way and assume that > each architecture would select HAS_IOPORT if any configuration supports > it, but it looks like for m68k there is a clearly defined set of platforms that > do. > > Note that for the platforms that don't set any of the three symbols, the > fallback makes inb() an alias for readb() with a different argument type, > so there may be m68k specific drivers that rely on this, but those would > already be broken if ATARI_ROM_ISA is set. I'd hope not - we spent some effort to make sure setting ATARI_ROM_ISA does not affect other m68k platforms when e.g. building multiplatform kernels. Replacing inb() by readb() without any address translation won't do much good for m68k though - addresses in the traditional ISA I/O port range would hit the (unmapped) zero page. Cheers, Michael > > Arnd > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Schmitz Subject: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary Date: Wed, 29 Dec 2021 17:15:23 +1300 Message-ID: <1f90f145-219e-1cad-6162-9959d43a27ad@gmail.com> References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=oo7gGMOkpKZtsifyQrF9uAkP4p/YBx2m/GIQa4Tq0YE=; b=SgUGGN6VhsGuSJ4+x7BV8WmUFGnq6AU/S3MGIbRuvgcmK5iemLDPInHX4HtGqsDBOP X+ShdKiY6WGvZxZzGll6Lp9gXc9Iofh3zmxzNCmw3Dn3KgxWg++og+5/hcFLsP9lz2Xr 2GF2kpRya+BTKsokuDFYluzgdLN+9R6oDmfEeq5seHlKkuDQoWmHZpB5lsfFQJLsHHhA J+6fOy7KSqTSf4RHl5+/z/3kvG8PPaQjjUrbxIO/1twWStmOPd1O5hfeFSFRI+7/1KDQ V6duyLcOszOYryU8sc+sZAK9TuMnZyNEumxgE9K0xpEM2ht/1sy9t9bhV6U0QsHIl9qG 4r0w== In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Arnd Bergmann Cc: Geert Uytterhoeven , Niklas Schnelle , Bjorn Helgaas , John Garry , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Dinh Nguyen , Chris Zankel , Karol Gugala , Jeff Dike , Yoshinori Sato , Brian Cain , Heiko Carstens , Richard Henderson , Ivan Kokshaysky , Matt Hi Arnd, Am 29.12.2021 um 16:41 schrieb Arnd Bergmann: > On Tue, Dec 28, 2021 at 8:20 PM Michael Schmitz wrote: >> Am 28.12.2021 um 23:08 schrieb Geert Uytterhoeven: >>> On Mon, Dec 27, 2021 at 5:44 PM Niklas Schnelle wrote: >>>> We introduce a new HAS_IOPORT Kconfig option to gate support for >>>> I/O port access. In a future patch HAS_IOPORT=n will disable compilation >>>> of the I/O accessor functions inb()/outb() and friends on architectures >>>> which can not meaningfully support legacy I/O spaces. On these platforms >>>> inb()/outb() etc are currently just stubs in asm-generic/io.h which when >>>> called will cause a NULL pointer access which some compilers actually >>>> detect and warn about. >>>> >>>> The dependencies on HAS_IOPORT in drivers as well as ifdefs for >>>> HAS_IOPORT specific sections will be added in subsequent patches on >>>> a per subsystem basis. Then a final patch will ifdef the I/O access >>>> functions on HAS_IOPORT thus turning any use not gated by HAS_IOPORT >>>> into a compile-time warning. >>>> >>>> Link: https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/ >>>> Co-developed-by: Arnd Bergmann >>>> Signed-off-by: Arnd Bergmann >>>> Signed-off-by: Niklas Schnelle >>> >>> Thanks for your patch! >>> >>>> --- a/arch/m68k/Kconfig >>>> +++ b/arch/m68k/Kconfig >>>> @@ -16,6 +16,7 @@ config M68K >>>> select GENERIC_CPU_DEVICES >>>> select GENERIC_IOMAP >>>> select GENERIC_IRQ_SHOW >>>> + select HAS_IOPORT >>>> select HAVE_AOUT if MMU >>>> select HAVE_ASM_MODVERSIONS >>>> select HAVE_DEBUG_BUGVERBOSE >>> >>> This looks way too broad to me: most m68k platform do not have I/O >>> port access support. >>> >>> My gut feeling says: >>> >>> select HAS_IOPORT if PCI || ISA >>> >>> but that might miss some intricate details... >> >> In particular, this misses the Atari ROM port ISA adapter case - >> >> select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA >> >> might do instead. > > Right, makes sense. I had suggested to go the easy way and assume that > each architecture would select HAS_IOPORT if any configuration supports > it, but it looks like for m68k there is a clearly defined set of platforms that > do. > > Note that for the platforms that don't set any of the three symbols, the > fallback makes inb() an alias for readb() with a different argument type, > so there may be m68k specific drivers that rely on this, but those would > already be broken if ATARI_ROM_ISA is set. I'd hope not - we spent some effort to make sure setting ATARI_ROM_ISA does not affect other m68k platforms when e.g. building multiplatform kernels. Replacing inb() by readb() without any address translation won't do much good for m68k though - addresses in the traditional ISA I/O port range would hit the (unmapped) zero page. Cheers, Michael > > Arnd >