Re: Heads up: gcc miscompiling initramfs zlib decompression code at -O3

2021-04-30 Thread Vineet Gupta
On 4/30/21 3:06 PM, Linus Torvalds wrote: > On Fri, Apr 30, 2021 at 1:46 PM Vineet Gupta > wrote: >> >> I've hit a mainline gcc 10.2 (also gcc 9.3) bug which triggers at -O3 >> causing wrong codegen. > > I'd be more than happy to just disable CC_OPTIMIZE_FOR_PERFORMANCE_O3 > entirely. > > The

Heads up: gcc miscompiling initramfs zlib decompression code at -O3

2021-04-30 Thread Vineet Gupta
Hi, I've hit a mainline gcc 10.2 (also gcc 9.3) bug which triggers at -O3 causing wrong codegen. Config needs to have initramfs + gzip compressed. CONFIG_HAVE_KERNEL_GZIP=y CONFIG_KERNEL_GZIP=y CONFIG_DECOMPRESS_GZIP=y CONFIG_INITRAMFS_COMPRESSION_GZIP=y lib

Re: Heads up: gcc miscompiling initramfs zlib decompression code at -O3

2021-04-30 Thread Linus Torvalds
On Fri, Apr 30, 2021 at 3:44 PM Vineet Gupta wrote: > > I agree that -O2 is default, but we've had -O3 default for ARC kernel > forever, since last decade seriously. The reason I turned it on back > then was upside of 10% performance improvement on select LMBench numbers > on hardware at the time

Re: Heads up: gcc miscompiling initramfs zlib decompression code at -O3

2021-04-30 Thread Linus Torvalds
On Fri, Apr 30, 2021 at 1:46 PM Vineet Gupta wrote: > > I've hit a mainline gcc 10.2 (also gcc 9.3) bug which triggers at -O3 > causing wrong codegen. I'd be more than happy to just disable CC_OPTIMIZE_FOR_PERFORMANCE_O3 entirely. The advantages are very questionable - with a lot of the optimiza

[PATCH v4 1/3] sparc: explicitly set PCI_IOBASE to 0

2021-04-30 Thread Niklas Schnelle
Instead of relying on the fallback in asm-generic/io.h which sets PCI_IOBASE 0 if it is not defined set it explicitly. Link: https://lore.kernel.org/lkml/CAK8P3a3PK9zyeP4ymELtc2ZYnymECoACiigw9Za+pvSJpCk5=g...@mail.gmail.com/ Signed-off-by: Niklas Schnelle --- arch/sparc/include/asm/io.h | 8 +++

[PATCH v4 0/3] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-30 Thread Niklas Schnelle
From: Niklas Schnelle Hi, This is version 4 of my attempt to get rid of a clang -Wnull-pointer-arithmetic warning for the use of PCI_IOBASE in asm-generic/io.h. This was originally found on s390 but should apply to all platforms leaving PCI_IOBASE undefined while making use of the inb() and frie

[PATCH v4 3/3] asm-generic/io.h: warn in inb() and friends with undefined PCI_IOBASE

2021-04-30 Thread Niklas Schnelle
When PCI_IOBASE is not defined, it is set to 0 such that it is ignored in calls to the readX/writeX primitives. This triggers clang's -Wnull-pointer-arithmetic warning and will result in illegal accesses on platforms that do not support I/O ports. Make things explicit and silence the warning by le

[PATCH v4 2/3] risc-v: Use generic io.h helpers for nommu

2021-04-30 Thread Niklas Schnelle
From: Niklas Schnelle Without MMU support PCI_IOBASE is left undefined because PCI_IO_END is VMEMMAP_START. Nevertheless the in*()/out*() helper macros are left defined with uses of PCI_IOBASE. At the moment this only compiles because asm-generic/io.h defines PCI_IOBASE as 0 if it is undefined an