Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp414808lqt; Thu, 18 Apr 2024 22:13:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWNwZk9tEamdJq946elGfNwtp9qzqAFEvTvBHLG1XyFAqZhghFqHxtACuh9t4kBXN253CX3R2ppxEe1OrhqynGKqudIMGrX0qkSpEGv0g== X-Google-Smtp-Source: AGHT+IFjxM9yXfZGT5zfopCaDHhmSV/LygMs4qG/egFgm3r72upS4VdNBBNbD8CG9i8OO2PONbMz X-Received: by 2002:a17:906:4c48:b0:a52:7456:bac8 with SMTP id d8-20020a1709064c4800b00a527456bac8mr973309ejw.6.1713503600180; Thu, 18 Apr 2024 22:13:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713503600; cv=pass; d=google.com; s=arc-20160816; b=Z8omEauOI6Z9Cww7LXFsxmHQw35oZYs8JkGuI5iisbcG89gm+G36r3+v5cQVc2cePj 6CIPZDTXJeywHbT5FRslfDXsuml0cxrMoRWR0tmbAsQOKo3bRjUxZVEWYmD41rdkNdyN ToVO7U+Qpi87acmVWeC8Nbbb9fPvkjikqM7AgVVvgI4DVNlH4OhyJy2GF/tRFa7sN7Zh BVWxmG87CyfIrbnKCE5TWIxvC1dp5ip9qrenX7a1hcntekFas9snH8rkC1FuqLYCH3qe hZ/UFaRQ4VuzNrdHJwIw8CNWWgB6Pj0jxbeOtMZ+jzEryu8MKGsTz/7x3sHdioxuOEHI npYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=kKJbHRkyLHBaxd0WzWWbPlJiRCeUkrJqnmVheMKFAs8=; fh=rSWCAQGyGvFLMFy+VjB8K7o4FxWh68koreDF2K4jWtk=; b=QzHFx6z09bbic7L/mUxgQ03NpQbGOQZIeLUq0e615YOCvySXOEw5/vZZQU5Wfklhx6 oLXU0NQhmuMgKt0Lw6xLvCtP+CZNTfwg9mS9TUG0T5rXxrhnvvurccDlIermOkH3JLvP BPOZoFBJEzhahG6ZrWkRGDU6ogQwO6LnN/GjaSLSZ8SrC8OKc4oNqfmDmG1aVoK6CSm4 ANZbB2KEHlSusvw+Bw5AKV0gyW1QEBHwrWURxChkuGBXSvYwS80ohhwEsT8g0w3uvg0r b5/ME9lHSpCxHiGomn7xuohNkVA4pCfy8idE1iKKmU5FXKDparehoAqMr4lbVS48jgg/ sUrQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=BuDsMaCr; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au dkim=pass dkdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-151007-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151007-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id kw15-20020a170907770f00b00a51bd07bf5esi1712075ejc.143.2024.04.18.22.13.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 22:13:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151007-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=BuDsMaCr; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au dkim=pass dkdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-151007-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151007-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E5F661F2245A for ; Fri, 19 Apr 2024 05:13:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 088CDBA2B; Fri, 19 Apr 2024 05:13:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="BuDsMaCr" Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02E547494 for ; Fri, 19 Apr 2024 05:13:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=150.107.74.76 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713503592; cv=none; b=mJWw+8ISk6+/F7M4jFiifklCZfNnjHNAtYfra34BlnAZIvUttClcFiehputiq5MjLXxwspazD6TvOFDVuwnl0iMddeT+nQHb/gWS39BSHFITJhy0a2KrC+OYQWDwWxniCaDaw4bcdwunc+AhjzRltvv3PD1BdPYxpkZDCFJerOI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713503592; c=relaxed/simple; bh=0uUaHshrb8NAIBnznpZKZX0Au6m6hxj9X/9tabmQHAc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=mfFHcWKjRydxDbqDZpnDi5QjqO8gd5cm8zyfcN6n14klCaHwlmKkUQUnNt0a62CCJji6rS5d/D5dq6Bv6CLQ6W+UJ1HFz72LLRd31oFgMvtRQfdfmLPiGGIqFtTde1f6a1hN8tC11IattOdsZWWtBiA1JpSHILU+E6Lqj5ReQ7I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; spf=pass smtp.mailfrom=ellerman.id.au; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b=BuDsMaCr; arc=none smtp.client-ip=150.107.74.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1713503582; bh=kKJbHRkyLHBaxd0WzWWbPlJiRCeUkrJqnmVheMKFAs8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=BuDsMaCrIPoMUPy5N7wfOxpl9Q7/pGYp4Sl8j2DC2jVZ5CcGvulsbeS4mEdlPHaQj JxFVWgcvjAnVgg/68Ew8uK3o4C9UJgpkdWIF12waMjhr7fFcfoHNBZJuaadQLDjZCW xBPIQ30XChhLhDOsIQkiYGsU+f6iPH6bQ2ckBJbzRI+rGjD1NU5yOrCOTZdup7ba6/ gYeoT4OUck4v4i3UKzsilII1+q+bOUbW43KKDWw86IHGM+jxbHTcghrrGHvrQmxsY6 rYA0ZN5w5jAbdMJVRTkTZjovEXhlxtmSNfxIS8gqhuPxs9xNBkMCo5gR1UbcWYgCg/ uI8piTbVvl/Qg== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4VLN7x53gbz4wnr; Fri, 19 Apr 2024 15:13:01 +1000 (AEST) From: Michael Ellerman To: Arnd Bergmann , Arnd Bergmann Cc: Naresh Kamboju , linux-kernel@vger.kernel.org, linuxppc-dev , "Aneesh Kumar K . V" , Anders Roxell , Kees Cook , Niklas Schnelle , clang-built-linux , Nick Desaulniers , Nathan Chancellor , Jeff Xu , "Naveen N. Rao" , Dan Carpenter , Nicholas Piggin , Christophe Leroy , Bill Wendling , Justin Stitt , Baoquan He , Mike Rapoport Subject: Re: [PATCH] powerpc: drop port I/O helpers for CONFIG_HAS_IOPORT=n In-Reply-To: <8734ribza2.fsf@mail.lhotse> References: <20240416153331.1617772-1-arnd@kernel.org> <878r1bb2zj.fsf@mail.lhotse> <59473eb6-1707-4bbf-85a3-ba4835f3ee7f@app.fastmail.com> <8734ribza2.fsf@mail.lhotse> Date: Fri, 19 Apr 2024 15:12:58 +1000 Message-ID: <87wmou9bqd.fsf@mail.lhotse> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Michael Ellerman writes: > "Arnd Bergmann" writes: >> On Thu, Apr 18, 2024, at 08:26, Michael Ellerman wrote: >>> Arnd Bergmann writes: >> >>> @@ -692,6 +692,7 @@ static inline void name at >>> \ >>> #define writesw writesw >>> #define writesl writesl >>> >>> +#ifdef CONFIG_HAS_IOPORT >>> #define inb inb >>> #define inw inw >>> #define inl inl >>> @@ -704,6 +705,8 @@ static inline void name at >>> \ >>> #define outsb outsb >>> #define outsw outsw >>> #define outsl outsl >>> +#endif // CONFIG_HAS_IOPORT >>> + >>> #ifdef __powerpc64__ >>> #define readq readq >>> #define writeq writeq >> >> I had included this at first, but then I still ran into >> the same warnings because it ends up pulling in the >> generic outsb() etc from include/asm-generic/io.h >> that relies on setting a non-NULL PCI_IOBASE. > > Yes you're right. The above fixes the gcc build, but not clang. > > So I think I'll just cherry pick f0a816fb12da ("/dev/port: don't compile > file operations without CONFIG_DEVPORT") into my next and then apply > this. But will see if there's any other build failures over night. That didn't work. Still lots of drivers in my tree (based on rc2) which use inb/outb etc, and barf on the empty #define inb. So I think this patch needs to wait until all the CONFIG_HAS_IOPORT checks have been merged for various drivers. For now the below fixes the clang warning. AFAICS it's safe because any code using inb() etc. with CONFIG_PCI=n is currently just doing a plain load from virtual address ~zero which should fault anyway. cheers diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h index 08c550ed49be..1cd6eb6c8101 100644 --- a/arch/powerpc/include/asm/io.h +++ b/arch/powerpc/include/asm/io.h @@ -37,7 +37,7 @@ extern struct pci_dev *isa_bridge_pcidev; * define properly based on the platform */ #ifndef CONFIG_PCI -#define _IO_BASE 0 +#define _IO_BASE POISON_POINTER_DELTA #define _ISA_MEM_BASE 0 #define PCI_DRAM_OFFSET 0 #elif defined(CONFIG_PPC32)