lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87wmou9bqd.fsf@mail.lhotse>
Date: Fri, 19 Apr 2024 15:12:58 +1000
From: Michael Ellerman <mpe@...erman.id.au>
To: Arnd Bergmann <arnd@...db.de>, Arnd Bergmann <arnd@...nel.org>
Cc: Naresh Kamboju <naresh.kamboju@...aro.org>,
 linux-kernel@...r.kernel.org, linuxppc-dev
 <linuxppc-dev@...ts.ozlabs.org>, "Aneesh Kumar K . V"
 <aneesh.kumar@...nel.org>, Anders Roxell <anders.roxell@...aro.org>, Kees
 Cook <keescook@...omium.org>, Niklas Schnelle <schnelle@...ux.ibm.com>,
 clang-built-linux <llvm@...ts.linux.dev>, Nick Desaulniers
 <ndesaulniers@...gle.com>, Nathan Chancellor <nathan@...nel.org>, Jeff Xu
 <jeffxu@...omium.org>, "Naveen N. Rao" <naveen.n.rao@...ux.ibm.com>, Dan
 Carpenter <dan.carpenter@...aro.org>, Nicholas Piggin <npiggin@...il.com>,
 Christophe Leroy <christophe.leroy@...roup.eu>, Bill Wendling
 <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>, Baoquan He
 <bhe@...hat.com>, Mike Rapoport <rppt@...nel.org>
Subject: Re: [PATCH] powerpc: drop port I/O helpers for CONFIG_HAS_IOPORT=n

Michael Ellerman <mpe@...erman.id.au> writes:
> "Arnd Bergmann" <arnd@...db.de> writes:
>> On Thu, Apr 18, 2024, at 08:26, Michael Ellerman wrote:
>>> Arnd Bergmann <arnd@...nel.org> 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)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ