linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "KVM: x86: enable -Werror"
@ 2020-02-26 15:39 Christoph Hellwig
  2020-02-27  3:33 ` Michael Ellerman
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2020-02-26 15:39 UTC (permalink / raw)
  To: torvalds; +Cc: kvm, pbonzini, linux-kernel

This reverts commit ead68df94d248c80fdbae220ae5425eb5af2e753.

Using the brain dead Werror flag fixes the build for me due to mostly
harmless KASAN or similar warnings:

arch/x86/kvm/x86.c: In function ‘kvm_timer_init’:
arch/x86/kvm/x86.c:7209:1: error: the frame size of 1112 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
 7209 | }

Feel free to add a CONFIG_WERROR if you care strong enough, but don't break
peoples builds for absolutely no good reason.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/x86/kvm/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/kvm/Makefile b/arch/x86/kvm/Makefile
index 4654e97a05cc..b19ef421084d 100644
--- a/arch/x86/kvm/Makefile
+++ b/arch/x86/kvm/Makefile
@@ -1,7 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 
 ccflags-y += -Iarch/x86/kvm
-ccflags-y += -Werror
 
 KVM := ../../../virt/kvm
 
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Revert "KVM: x86: enable -Werror"
  2020-02-26 15:39 [PATCH] Revert "KVM: x86: enable -Werror" Christoph Hellwig
@ 2020-02-27  3:33 ` Michael Ellerman
  2020-02-27  6:41   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2020-02-27  3:33 UTC (permalink / raw)
  To: Christoph Hellwig, torvalds; +Cc: kvm, pbonzini, linux-kernel

Christoph Hellwig <hch@lst.de> writes:
> This reverts commit ead68df94d248c80fdbae220ae5425eb5af2e753.
>
> Using the brain dead Werror flag fixes the build for me due to mostly
> harmless KASAN or similar warnings:
>
> arch/x86/kvm/x86.c: In function ‘kvm_timer_init’:
> arch/x86/kvm/x86.c:7209:1: error: the frame size of 1112 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
>  7209 | }
>
> Feel free to add a CONFIG_WERROR if you care strong enough, but don't break
> peoples builds for absolutely no good reason.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  arch/x86/kvm/Makefile | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch/x86/kvm/Makefile b/arch/x86/kvm/Makefile
> index 4654e97a05cc..b19ef421084d 100644
> --- a/arch/x86/kvm/Makefile
> +++ b/arch/x86/kvm/Makefile
> @@ -1,7 +1,6 @@
>  # SPDX-License-Identifier: GPL-2.0
>  
>  ccflags-y += -Iarch/x86/kvm
> -ccflags-y += -Werror
>  
>  KVM := ../../../virt/kvm

We've had -Werror enabled by default on powerpc for over 10 years, and
haven't had many complaints. Possibly that's just because no one builds
powerpc kernels ...

The key thing is that it's configurable, so if it does break the build
for someone they can just turn it off. It's also off by default for
allyes/allmod builds because the user-selectable option disables
-Werror, eg:

config PPC_DISABLE_WERROR
	bool "Don't build arch/powerpc code with -Werror"
	help
	  This option tells the compiler NOT to build the code under
	  arch/powerpc with the -Werror flag (which means warnings
	  are treated as errors).

	  Only enable this if you are hitting a build failure in the
	  arch/powerpc code caused by a warning, and you don't feel
	  inclined to fix it.

config PPC_WERROR
	bool
	depends on !PPC_DISABLE_WERROR
	default y


In fact these days with shell support in Kconfig we could make it even
smarter, eg:

diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 0b063830eea8..e7564f7cabc6 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -2,6 +2,7 @@
 
 config PPC_DISABLE_WERROR
        bool "Don't build arch/powerpc code with -Werror"
+       default $(success,whoami | grep hch)
        help
          This option tells the compiler NOT to build the code under
          arch/powerpc with the -Werror flag (which means warnings


cheers

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Revert "KVM: x86: enable -Werror"
  2020-02-27  3:33 ` Michael Ellerman
@ 2020-02-27  6:41   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2020-02-27  6:41 UTC (permalink / raw)
  To: Michael Ellerman, Christoph Hellwig, torvalds; +Cc: kvm, linux-kernel

On 27/02/20 04:33, Michael Ellerman wrote:
> We've had -Werror enabled by default on powerpc for over 10 years, and
> haven't had many complaints. Possibly that's just because no one builds
> powerpc kernels ...

I looked for other cases of -Werror being always on in Linux before
writing this patch.  There are both unconditional cases and others like
PPC where it's governed by Kconfig.

I will add a Kconfig for now.  It probably should be made global instead
of having a dozen different Kconfig symbols.

kvm_timer_init should be fixed, though.

Paolo

> The key thing is that it's configurable, so if it does break the build
> for someone they can just turn it off. It's also off by default for
> allyes/allmod builds because the user-selectable option disables
> -Werror, eg:


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-27  6:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-26 15:39 [PATCH] Revert "KVM: x86: enable -Werror" Christoph Hellwig
2020-02-27  3:33 ` Michael Ellerman
2020-02-27  6:41   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).