Skip to contentSkip to conversation

Fix a bunch of allmodconfig errors

PATCH Applied Lee Jones 4 participants 11 messages Nov 25, 2022 – Nov 28, 2022

Subsystems (4)
lore
Share & tools
lore

Lee Jones

author
#0 lore raw

v2 cover Fix a bunch of allmodconfig errors

Since b339ec9c229aa ("kbuild: Only default to -Werror if COMPILE_TEST") WERROR now defaults to COMPILE_TEST meaning that it's enabled for allmodconfig builds. This leads to some interesting failures, each resolved in this set.

With this set applied, I am able to obtain a successful allmodconfig Arm build.

v1 => v2:
- Remove superfluous change (these two override it)
- Mark only DRM_AMD_DC ("the new display engine) as Broken
- Change logic to only *include* working arches, not *preclude* them

Lee Jones (2):
drm/amdgpu: Temporarily disable broken Clang builds due to blown
stack-frame
Kconfig.debug: Provide a little extra FRAME_WARN leeway when KASAN is
enabled

 drivers/gpu/drm/amd/display/Kconfig | 7 +++++++
 lib/Kconfig.debug                   | 1 +
 2 files changed, 8 insertions(+)
Signature · 1 line
2.38.1.584.g0f3c55d4c2-goog
author
#1 lore raw

PATCH v2 1/2 drm/amdgpu: Temporarily disable broken Clang builds due to blown stack-frame

calculate_bandwidth() is presently broken on all !(X86_64 || SPARC64 || ARM64) architectures built with Clang (all released versions), whereby the stack frame gets blown up to well over 5k. This would cause an immediate kernel panic on most architectures. We'll revert this when the following bug report has been resolved: https://github.com/llvm/llvm-project/issues/41896.

---
 drivers/gpu/drm/amd/display/Kconfig | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/display/Kconfig +7 -0
index 6925e0280dbe6..f4f3d2665a6b2 100644
@@ -5,6 +5,7 @@ menu "Display Engine Configuration"
 config DRM_AMD_DC
 	bool "AMD DC - Enable new display engine"
 	default y
+	depends on BROKEN || !CC_IS_CLANG || X86_64 || SPARC64 || ARM64
 	select SND_HDA_COMPONENT if SND_HDA_CORE
 	select DRM_AMD_DC_DCN if (X86 || PPC_LONG_DOUBLE_128)
 	help
@@ -12,6 +13,12 @@ config DRM_AMD_DC
 	  support for AMDGPU. This adds required support for Vega and
 	  Raven ASICs.
 
+	  calculate_bandwidth() is presently broken on all !(X86_64 || SPARC64 || ARM64)
+	  architectures built with Clang (all released versions), whereby the stack
+	  frame gets blown up to well over 5k.  This would cause an immediate kernel
+	  panic on most architectures.  We'll revert this when the following bug report
+	  has been resolved: https://github.com/llvm/llvm-project/issues/41896.
+
 config DRM_AMD_DC_DCN
 	def_bool n
 	help
Signature · 1 line
2.38.1.584.g0f3c55d4c2-goog
Acked-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] drm/amdgpu: Temporarily disable broken Clang builds due to blown stack-frame

Quoted 8 lines · Lee Jones

calculate_bandwidth() is presently broken on all !(X86_64 || SPARC64 || ARM64) architectures built with Clang (all released versions), whereby the stack frame gets blown up to well over 5k. This would cause an immediate kernel panic on most architectures. We'll revert this when the following bug report has been resolved: https://github.com/llvm/llvm-project/issues/41896.

Reviewed-by on v2 1/2
#3 lore raw

Re: [PATCH v2 1/2] drm/amdgpu: Temporarily disable broken Clang builds due to blown stack-frame

In reply to Lee Jones
Quoted 8 lines · Lee Jones

calculate_bandwidth() is presently broken on all !(X86_64 || SPARC64 || ARM64) architectures built with Clang (all released versions), whereby the stack frame gets blown up to well over 5k. This would cause an immediate kernel panic on most architectures. We'll revert this when the following bug report has been resolved: https://github.com/llvm/llvm-project/issues/41896.

Quoted 32 lines
---
 drivers/gpu/drm/amd/display/Kconfig | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/display/Kconfig +7 -0
index 6925e0280dbe6..f4f3d2665a6b2 100644
@@ -5,6 +5,7 @@ menu "Display Engine Configuration"
 config DRM_AMD_DC
 	bool "AMD DC - Enable new display engine"
 	default y
+	depends on BROKEN || !CC_IS_CLANG || X86_64 || SPARC64 || ARM64
 	select SND_HDA_COMPONENT if SND_HDA_CORE
 	select DRM_AMD_DC_DCN if (X86 || PPC_LONG_DOUBLE_128)
 	help
@@ -12,6 +13,12 @@ config DRM_AMD_DC
 	  support for AMDGPU. This adds required support for Vega and
 	  Raven ASICs.
 
+	  calculate_bandwidth() is presently broken on all !(X86_64 || SPARC64 || ARM64)
+	  architectures built with Clang (all released versions), whereby the stack
+	  frame gets blown up to well over 5k.  This would cause an immediate kernel
+	  panic on most architectures.  We'll revert this when the following bug report
+	  has been resolved: https://github.com/llvm/llvm-project/issues/41896.
+
 config DRM_AMD_DC_DCN
 	def_bool n
 	help
Signature · 1 line
2.38.1.584.g0f3c55d4c2-goog
author
#4 lore raw

PATCH v2 2/2 Kconfig.debug: Provide a little extra FRAME_WARN leeway when KASAN is enabled

In reply to Lee Jones

When enabled, KASAN enlarges function's stack-frames. Pushing quite a few over the current threshold. This can mainly be seen on 32-bit architectures where the present limit (when !GCC) is a lowly 1024-Bytes.

---
 lib/Kconfig.debug | 1 +
 1 file changed, 1 insertion(+)
lib/Kconfig.debug +1 -0
index c3c0b077ade33..82d475168db95 100644
@@ -399,6 +399,7 @@ config FRAME_WARN
 	default 2048 if GCC_PLUGIN_LATENT_ENTROPY
 	default 2048 if PARISC
 	default 1536 if (!64BIT && XTENSA)
+	default 1280 if KASAN && !64BIT
 	default 1024 if !64BIT
 	default 2048 if 64BIT
 	help
Signature · 1 line
2.38.1.584.g0f3c55d4c2-goog
author
#5 lore raw

Re: [PATCH v2 2/2] Kconfig.debug: Provide a little extra FRAME_WARN leeway when KASAN is enabled

Quoted 15 lines · Lee Jones

When enabled, KASAN enlarges function's stack-frames. Pushing quite a few over the current threshold. This can mainly be seen on 32-bit architectures where the present limit (when !GCC) is a lowly 1024-Bytes.

---
 lib/Kconfig.debug | 1 +
 1 file changed, 1 insertion(+)
lib/Kconfig.debug +0 -0
index c3c0b077ade33..82d475168db95 100644

lib/Kconfig.debug config FRAME_WARN · line 405

Quoted 7 lines
lib/Kconfig.debug +1 -0
@@ -399,6 +399,7 @@ config FRAME_WARN
 	default 2048 if GCC_PLUGIN_LATENT_ENTROPY
 	default 2048 if PARISC
 	default 1536 if (!64BIT && XTENSA)
+	default 1280 if KASAN && !64BIT
 	default 1024 if !64BIT
 	default 2048 if 64BIT
 	help

Note this also fixes 61 warnings when

  (GCC && !GCC_PLUGIN_LATENT_ENTROPY)

... which as Arnd says should not be enabled by default. We'll address that issue once this set has been applied.

Signature · 1 line
Lee Jones [李琼斯]
Reviewed-by
#6 lore raw

Re: [PATCH v2 2/2] Kconfig.debug: Provide a little extra FRAME_WARN leeway when KASAN is enabled

Quoted 27 lines · Lee Jones
Quoted 15 lines · Lee Jones

When enabled, KASAN enlarges function's stack-frames. Pushing quite a few over the current threshold. This can mainly be seen on 32-bit architectures where the present limit (when !GCC) is a lowly 1024-Bytes.

---
 lib/Kconfig.debug | 1 +
 1 file changed, 1 insertion(+)
lib/Kconfig.debug +0 -0
index c3c0b077ade33..82d475168db95 100644

lib/Kconfig.debug config FRAME_WARN · line 405

Quoted 7 lines
lib/Kconfig.debug +1 -0
@@ -399,6 +399,7 @@ config FRAME_WARN
 	default 2048 if GCC_PLUGIN_LATENT_ENTROPY
 	default 2048 if PARISC
 	default 1536 if (!64BIT && XTENSA)
+	default 1280 if KASAN && !64BIT
 	default 1024 if !64BIT
 	default 2048 if 64BIT
 	help

Note this also fixes 61 warnings when

Quoted 4 lines
  (GCC && !GCC_PLUGIN_LATENT_ENTROPY)

... which as Arnd says should not be enabled by default. We'll address that issue once this set has been applied.

Thanks a lot for checking this!

Reviewed-by on v2 2/2
#7 lore raw

Re: [PATCH v2 2/2] Kconfig.debug: Provide a little extra FRAME_WARN leeway when KASAN is enabled

In reply to Lee Jones
Quoted 6 lines · Lee Jones

When enabled, KASAN enlarges function's stack-frames. Pushing quite a few over the current threshold. This can mainly be seen on 32-bit architectures where the present limit (when !GCC) is a lowly 1024-Bytes.

Quoted 19 lines
---
 lib/Kconfig.debug | 1 +
 1 file changed, 1 insertion(+)
lib/Kconfig.debug +1 -0
index c3c0b077ade33..82d475168db95 100644
@@ -399,6 +399,7 @@ config FRAME_WARN
 	default 2048 if GCC_PLUGIN_LATENT_ENTROPY
 	default 2048 if PARISC
 	default 1536 if (!64BIT && XTENSA)
+	default 1280 if KASAN && !64BIT
 	default 1024 if !64BIT
 	default 2048 if 64BIT
 	help
Signature · 1 line
2.38.1.584.g0f3c55d4c2-goog
maintainer
#8 lore raw
In reply to Lee Jones
Quoted 3 lines · On Fri, 25 Nov 2022 12:07:48 +0000 Lee Jones <[email protected]> wrote:

Since b339ec9c229aa ("kbuild: Only default to -Werror if COMPILE_TEST") WERROR now defaults to COMPILE_TEST meaning that it's enabled for allmodconfig builds. This leads to some interesting failures, each resolved in this set.

I'm not sure who this patchset is aimed at, so I'll take my usual approach of grabbing it and seeing who complains.

Quoted 1 line

With this set applied, I am able to obtain a successful allmodconfig Arm build.

b339ec9c229aa is a year old and I've been doing arm allmodconfig for ever. What am I missing here?

A broken arm allmodconfig is pretty irritating - I'm thinking that a fix should be backported into -stable kernels. But I'm clearly missing something here.

author
#9 lore raw
Quoted 9 lines · Andrew Morton
Quoted 3 lines · On Fri, 25 Nov 2022 12:07:48 +0000 Lee Jones <[email protected]> wrote:

Since b339ec9c229aa ("kbuild: Only default to -Werror if COMPILE_TEST") WERROR now defaults to COMPILE_TEST meaning that it's enabled for allmodconfig builds. This leads to some interesting failures, each resolved in this set.

I'm not sure who this patchset is aimed at, so I'll take my usual approach of grabbing it and seeing who complains.

Quoted 8 lines
Quoted 1 line

With this set applied, I am able to obtain a successful allmodconfig Arm build.

b339ec9c229aa is a year old and I've been doing arm allmodconfig for ever. What am I missing here?

A broken arm allmodconfig is pretty irritating - I'm thinking that a fix should be backported into -stable kernels. But I'm clearly missing something here.

I will be taking these through all applicable Stable kernels.

Signature · 1 line
Lee Jones [李琼斯]
maintainer
#10 lore raw
In reply to Lee Jones
Quoted 3 lines · On Fri, 25 Nov 2022 12:07:48 +0000 Lee Jones <[email protected]> wrote:

Since b339ec9c229aa ("kbuild: Only default to -Werror if COMPILE_TEST") WERROR now defaults to COMPILE_TEST meaning that it's enabled for allmodconfig builds. This leads to some interesting failures, each resolved in this set.

Oh, I get it. Clang. I'll tweak the above para to make that clearer.

cc:stable question still applies? How much trouble will these build errors be causing people for the next N years?

Quoted 1 line

With this set applied, I am able to obtain a successful allmodconfig Arm build.