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 >