# git rev-parse -q --verify 3cfdbc2274139bbcc09a44f8aa18d08c0abfd51e^{commit} 3cfdbc2274139bbcc09a44f8aa18d08c0abfd51e already have revision, skipping fetch # git checkout -q -f -B kisskb 3cfdbc2274139bbcc09a44f8aa18d08c0abfd51e # git clean -qxdf # < git log -1 # commit 3cfdbc2274139bbcc09a44f8aa18d08c0abfd51e # Author: Arnd Bergmann # Date: Tue Apr 16 17:33:01 2024 +0200 # # powerpc: drop port I/O helpers for CONFIG_HAS_IOPORT=n # # Calling inb()/outb() on powerpc when CONFIG_PCI is disabled causes # a NULL pointer dereference, which is bad for a number of reasons. # # After my patch to turn on -Werror in linux-next, this caused a # compiler-time warning with clang: # # In file included from arch/powerpc/include/asm/io.h:672: # arch/powerpc/include/asm/io-defs.h:43:1: error: performing pointer # arithmetic on a null pointer has undefined behavior # [-Werror,-Wnull-pointer-arithmetic] # 43 | DEF_PCI_AC_NORET(insb, (unsigned long p, void *b, unsigned long c), # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 44 | (p, b, c), pio, p) # | ~~~~~~~~~~~~~~~~~~ # # In this configuration, CONFIG_HAS_IOPORT is already disabled, and all # drivers that use inb()/outb() should now depend on that (some patches are # still in the process of getting marged). # # Hide all references to inb()/outb() in the powerpc code and the definitions # when HAS_IOPORT is disabled to remove the possible NULL pointer access. # The same should happin in asm-generic in the near future, but for now # the empty inb() macros are still defined to ensure the generic version # does not get pulled in. # # Signed-off-by: Arnd Bergmann # Reported-by: Naresh Kamboju # Closes: https://lore.kernel.org/all/CA+G9fYtEh8zmq8k8wE-8RZwW-Qr927RLTn+KqGnq1F=ptaaNsA@mail.gmail.com # Signed-off-by: Michael Ellerman # Link: https://msgid.link/20240416153331.1617772-1-arnd@kernel.org # < /opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 3cfdbc2274139bbcc09a44f8aa18d08c0abfd51e # make -s -j 40 ARCH=powerpc O=/kisskb/build/powerpc-next_40x_walnut_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- 40x/walnut_defconfig # < make -s -j 40 ARCH=powerpc O=/kisskb/build/powerpc-next_40x_walnut_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 40 ARCH=powerpc O=/kisskb/build/powerpc-next_40x_walnut_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig # make -s -j 40 ARCH=powerpc O=/kisskb/build/powerpc-next_40x_walnut_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- In file included from /kisskb/src/include/linux/io.h:13:0, from /kisskb/src/include/linux/irq.h:20, from /kisskb/src/drivers/tty/serial/8250/8250_port.c:18: /kisskb/src/drivers/tty/serial/8250/8250_port.c: In function 'hub6_serial_in': /kisskb/src/arch/powerpc/include/asm/io.h:698:14: error: implicit declaration of function 'outb' [-Werror=implicit-function-declaration] #define outb outb ^ /kisskb/src/drivers/tty/serial/8250/8250_port.c:344:2: note: in expansion of macro 'outb' outb(p->hub6 - 1 + offset, p->iobase); ^ /kisskb/src/arch/powerpc/include/asm/io.h:695:13: error: implicit declaration of function 'inb' [-Werror=implicit-function-declaration] #define inb inb ^ /kisskb/src/drivers/tty/serial/8250/8250_port.c:345:9: note: in expansion of macro 'inb' return inb(p->iobase + 1); ^ /kisskb/src/drivers/tty/serial/8250/8250_port.c: At top level: cc1: warning: unrecognized command line option '-Wno-shift-negative-value' cc1: warning: unrecognized command line option '-Wno-stringop-overflow' cc1: some warnings being treated as errors make[7]: *** [/kisskb/src/scripts/Makefile.build:244: drivers/tty/serial/8250/8250_port.o] Error 1 make[6]: *** [/kisskb/src/scripts/Makefile.build:485: drivers/tty/serial/8250] Error 2 make[6]: *** Waiting for unfinished jobs.... make[5]: *** [/kisskb/src/scripts/Makefile.build:485: drivers/tty/serial] Error 2 make[4]: *** [/kisskb/src/scripts/Makefile.build:485: drivers/tty] Error 2 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [/kisskb/src/scripts/Makefile.build:485: drivers] Error 2 make[3]: *** Waiting for unfinished jobs.... In file included from /kisskb/src/arch/powerpc/kernel/udbg_16550.c:9:0: /kisskb/src/arch/powerpc/kernel/udbg_16550.c: In function 'udbg_uart_in_pio': /kisskb/src/arch/powerpc/include/asm/io.h:695:13: error: implicit declaration of function 'inb' [-Werror=implicit-function-declaration] #define inb inb ^ /kisskb/src/arch/powerpc/kernel/udbg_16550.c:167:9: note: in expansion of macro 'inb' return inb(udbg_uart.pio_base + (reg * udbg_uart_stride)); ^ /kisskb/src/arch/powerpc/kernel/udbg_16550.c: In function 'udbg_uart_out_pio': /kisskb/src/arch/powerpc/include/asm/io.h:698:14: error: implicit declaration of function 'outb' [-Werror=implicit-function-declaration] #define outb outb ^ /kisskb/src/arch/powerpc/kernel/udbg_16550.c:172:2: note: in expansion of macro 'outb' outb(data, udbg_uart.pio_base + (reg * udbg_uart_stride)); ^ /kisskb/src/arch/powerpc/kernel/udbg_16550.c: At top level: cc1: error: unrecognized command line option '-Wno-shift-negative-value' [-Werror] cc1: error: unrecognized command line option '-Wno-stringop-overflow' [-Werror] cc1: all warnings being treated as errors make[5]: *** [/kisskb/src/scripts/Makefile.build:244: arch/powerpc/kernel/udbg_16550.o] Error 1 make[5]: *** Waiting for unfinished jobs.... make[4]: *** [/kisskb/src/scripts/Makefile.build:485: arch/powerpc/kernel] Error 2 make[3]: *** [/kisskb/src/scripts/Makefile.build:485: arch/powerpc] Error 2 make[2]: *** [/kisskb/src/Makefile:1919: .] Error 2 make[1]: *** [/kisskb/src/Makefile:240: __sub-make] Error 2 make: *** [Makefile:240: __sub-make] Error 2 Command 'make -s -j 40 ARCH=powerpc O=/kisskb/build/powerpc-next_40x_walnut_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- ' returned non-zero exit status 2. # rm -rf /kisskb/build/powerpc-next_40x_walnut_defconfig_powerpc-gcc5 # Build took: 0:00:22.104986