Re: [PATCH 05/26] openrisc: map as uncached in ioremap

2019-08-30 Thread Stafford Horne
On Fri, Aug 30, 2019 at 06:07:05PM +0200, Christoph Hellwig wrote:
> On Fri, Aug 23, 2019 at 10:55:39PM +0900, Stafford Horne wrote:
> > On Sat, Aug 17, 2019 at 09:32:32AM +0200, Christoph Hellwig wrote:
> > > Openrisc is the only architecture not mapping ioremap as uncached,
> > > which has been the default since the Linux 2.6.x days.  Switch it
> > > over to implement uncached semantics by default.
> > > 
> > > Signed-off-by: Christoph Hellwig 
> > > ---
> > >  arch/openrisc/include/asm/io.h  | 20 +++-
> > >  arch/openrisc/include/asm/pgtable.h |  2 +-
> > >  arch/openrisc/mm/ioremap.c  |  8 
> > >  3 files changed, 8 insertions(+), 22 deletions(-)
> > 
> > Acked-by: Stafford Horne 
> 
> Can you send this one to Linus for 5.4?  That would help with the
> possibility to remove ioremap_nocache after that.

Sure, I will pick this up.

-Stafford

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 2/3] kbuild, arc: add CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 for ARC

2019-08-30 Thread Vineet Gupta
On 8/20/19 10:09 AM, Masahiro Yamada wrote:
> arch/arc/Makefile overrides -O2 with -O3. This is the only user of
> ARCH_CFLAGS. There is no user of ARCH_CPPFLAGS or ARCH_AFLAGS.
> My plan is to remove ARCH_{CPP,A,C}FLAGS after refactoring the ARC
> Makefile.

Why, it seems like a good generic facility for arches to over-ride stuff
(specially adding any toggles at the end of cmdline).

And even if there are no current users, it would be good to have. I understand 
we
don't keep code for future, but strictly this is meta-code ;-)

> Currently, ARC has no way to enable -Wmaybe-uninitialized because both
> -O3 and -Os disable it. Enabling it will be useful for compile-testing.
> This commit allows allmodconfig (, which defaults to -O2) to enable it.

But this is a separate issue and was done on purpose because of unbearable build
spew at the time. As an experiment I enabled it in current kernel and at -O3 we
still get the dreaded spew in net/sunrpc/xdr.c and some more in net/ipv4. The 
spew
doesn't happen at -O2 and seems not ARC specific as I can see this with ARM -O3
build with gcc 7.3 (buildroot 2018.08)

| $ make ARCH=arm CROSS_COMPILE=arm-linux- net
| ..
| ..
| ../net/sunrpc/xdr.c: In function ‘xdr_encode_word’:
| ../net/sunrpc/xdr.c:1199:2: warning: ‘subbuf.tail[0].iov_base’ may be used
| uninitialized in this function [-Wmaybe-uninitialized]
|  memcpy(subbuf->tail[0].iov_base, obj, this_len);
|  ^~~
| ../net/sunrpc/xdr.c:1205:17: note: ‘subbuf.tail[0].iov_base’ was declared here
|  struct xdr_buf subbuf;


I understand the value of this toggle, but the spew is too much and at times
obfuscated likely other real issues.
> Add CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y to all the defconfig files
> in arch/arc/configs/ in order to keep the current config settings.

My first reaction to adding this to all defconfigs was that this was inelegant :
for lack of better word :-)

But indeed it seems better this way as we can now experiment with -O2 vs. -O3 
from
config, rather than hardwiring to -O3.

So if you could please split out the Wmaybe-uninitialized change

Acked-by: Vineet Gupta 

> Signed-off-by: Masahiro Yamada 
> ---
> 
>  Makefile   | 10 ++
>  arch/arc/Makefile  |  8 
>  arch/arc/configs/axs101_defconfig  |  1 +
>  arch/arc/configs/axs103_defconfig  |  1 +
>  arch/arc/configs/axs103_smp_defconfig  |  1 +
>  arch/arc/configs/haps_hs_defconfig |  1 +
>  arch/arc/configs/haps_hs_smp_defconfig |  1 +
>  arch/arc/configs/hsdk_defconfig|  1 +
>  arch/arc/configs/nps_defconfig |  1 +
>  arch/arc/configs/nsim_700_defconfig|  1 +
>  arch/arc/configs/nsim_hs_defconfig |  1 +
>  arch/arc/configs/nsim_hs_smp_defconfig |  1 +
>  arch/arc/configs/nsimosci_defconfig|  1 +
>  arch/arc/configs/nsimosci_hs_defconfig |  1 +
>  arch/arc/configs/nsimosci_hs_smp_defconfig |  1 +
>  arch/arc/configs/tb10x_defconfig   |  1 +
>  arch/arc/configs/vdk_hs38_defconfig|  1 +
>  arch/arc/configs/vdk_hs38_smp_defconfig|  1 +
>  init/Kconfig   | 12 ++--
>  19 files changed, 32 insertions(+), 14 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index bc55f366677d..891e47da503f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -716,10 +716,12 @@ KBUILD_CFLAGS   += $(call cc-disable-warning, 
> format-truncation)
>  KBUILD_CFLAGS+= $(call cc-disable-warning, format-overflow)
>  KBUILD_CFLAGS+= $(call cc-disable-warning, address-of-packed-member)
>  
> -ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
> -KBUILD_CFLAGS+= -Os
> -else
> -KBUILD_CFLAGS   += -O2
> +ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
> +KBUILD_CFLAGS += -O2
> +else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
> +KBUILD_CFLAGS += -O3
> +else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
> +KBUILD_CFLAGS += -Os
>  endif
>  
>  ifdef CONFIG_CC_DISABLE_WARN_MAYBE_UNINITIALIZED
> diff --git a/arch/arc/Makefile b/arch/arc/Makefile
> index ee6d1184c2b1..f1c44cccf8d6 100644
> --- a/arch/arc/Makefile
> +++ b/arch/arc/Makefile
> @@ -48,14 +48,6 @@ endif
>  cfi := $(call as-instr,.cfi_startproc\n.cfi_endproc,-DARC_DW2_UNWIND_AS_CFI)
>  cflags-$(CONFIG_ARC_DW2_UNWIND)  += -fasynchronous-unwind-tables 
> $(cfi)
>  
> -ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
> -# Generic build system uses -O2, we want -O3
> -# Note: No need to add to cflags-y as that happens anyways
> -#
> -# Disable the false maybe-uninitialized warings gcc spits out at -O3
> -ARCH_CFLAGS += -O3 $(call cc-disable-warning,maybe-uninitialized,)
> -endif
> -
>  # small data is default for elf32 tool-chain. If not usable, disable it
>  # This also allows repurposing GP as scratch reg to gcc reg allocator
>  disable_small_data := y
> diff --git a/arch/arc/configs/axs101_defconfig 
> b/arch/arc/configs/axs101_defconfig
> index e31a8ebc3ecc..0016149f9583 100644

Re: [PATCH 05/26] openrisc: map as uncached in ioremap

2019-08-30 Thread Christoph Hellwig
On Fri, Aug 23, 2019 at 10:55:39PM +0900, Stafford Horne wrote:
> On Sat, Aug 17, 2019 at 09:32:32AM +0200, Christoph Hellwig wrote:
> > Openrisc is the only architecture not mapping ioremap as uncached,
> > which has been the default since the Linux 2.6.x days.  Switch it
> > over to implement uncached semantics by default.
> > 
> > Signed-off-by: Christoph Hellwig 
> > ---
> >  arch/openrisc/include/asm/io.h  | 20 +++-
> >  arch/openrisc/include/asm/pgtable.h |  2 +-
> >  arch/openrisc/mm/ioremap.c  |  8 
> >  3 files changed, 8 insertions(+), 22 deletions(-)
> 
> Acked-by: Stafford Horne 

Can you send this one to Linus for 5.4?  That would help with the
possibility to remove ioremap_nocache after that.

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 04/26] mips: remove ioremap_cachable

2019-08-30 Thread Christoph Hellwig
On Mon, Aug 19, 2019 at 08:57:30PM +, Paul Burton wrote:
> Hi Christoph,
> 
> On Sat, Aug 17, 2019 at 09:32:31AM +0200, Christoph Hellwig wrote:
> > Just define ioremap_cache directly.
> > 
> > Signed-off-by: Christoph Hellwig 
> 
> Acked-by: Paul Burton 

Can you pick this patch up through the mips tree?

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 08/26] m68k: simplify ioremap_nocache

2019-08-30 Thread Christoph Hellwig
On Mon, Aug 19, 2019 at 10:56:02AM +0200, Geert Uytterhoeven wrote:
> Hi Christoph,
> 
> On Sat, Aug 17, 2019 at 9:48 AM Christoph Hellwig  wrote:
> > Just define ioremap_nocache to ioremap instead of duplicating the
> > inline.  Also defined ioremap_uc in terms of ioremap instead of
> > the using a double indirection.
> >
> > Signed-off-by: Christoph Hellwig 
> 
> Acked-by: Geert Uytterhoeven 

Do you mind picking this up through the m68k tree?

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 19/26] arm64: remove __iounmap

2019-08-30 Thread Christoph Hellwig
On Mon, Aug 19, 2019 at 08:36:02AM +0100, Will Deacon wrote:
> On Sat, Aug 17, 2019 at 09:32:46AM +0200, Christoph Hellwig wrote:
> > No need to indirect iounmap for arm64.
> > 
> > Signed-off-by: Christoph Hellwig 
> > ---
> >  arch/arm64/include/asm/io.h | 3 +--
> >  arch/arm64/mm/ioremap.c | 4 ++--
> >  2 files changed, 3 insertions(+), 4 deletions(-)
> 
> Not sure why we did it like this...
> 
> Acked-by: Will Deacon 

Can you just pick this one up through the arm64 tree for 5.4?

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 12/26] x86: clean up ioremap

2019-08-30 Thread Christoph Hellwig
On Sat, Aug 17, 2019 at 12:34:02PM +0200, Ingo Molnar wrote:
> 
> * Christoph Hellwig  wrote:
> 
> > Use ioremap as the main implemented function, and defined
> > ioremap_nocache to it as a deprecated alias.
> > 
> > Signed-off-by: Christoph Hellwig 
> > ---
> >  arch/x86/include/asm/io.h | 8 ++--
> >  arch/x86/mm/ioremap.c | 8 
> >  arch/x86/mm/pageattr.c| 4 ++--
> >  3 files changed, 8 insertions(+), 12 deletions(-)
> 
> Acked-by: Ingo Molnar 

Can you pick it up through tip for 5.4?  That way we can get most
bits in through their maintainer trees, and then I'll resubmit the
rest for the next merge window.

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc