i915: increase frame warning limit in intel_workaround when using KASAN or KCSAN
Subsystems (2)
PATCH 1/1 i915: increase frame warning limit in intel_workaround when using KASAN or KCSAN
From: Peng Hao <[email protected]>
When building kernel with clang, which will typically
have sanitizers enabled, there is a warning about a large stack frame.
drivers/gpu/drm/i915/gt/intel_workarounds.c:3044:6: error: stack frame size (5176) exceeds limit (2048) in 'intel_engine_init_workarounds' [-Werror,-Wframe-larger-than] void intel_engine_init_workarounds(struct intel_engine_cs *engine)
^
128/5176 (2.47%) spills, 5048/5176 (97.53%) variables
so increase the limit for configurations that have KASAN or KCSAN enabled for not breaking the majority of builds.
--- drivers/gpu/drm/i915/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/Makefile +5 -1
@@ -36,7 +36,11 @@ subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror CFLAGS_i915_pci.o = -Wno-override-init CFLAGS_display/intel_display_device.o = -Wno-override-init CFLAGS_display/intel_fbdev.o = -Wno-override-init - +ifneq ($(CONFIG_FRAME_WARN),0) +ifeq ($(filter y,$(CONFIG_KASAN)$(CONFIG_KCSAN)),y) +CFLAGS_gt/intel_workarounds.o = -Wframe-larger-than=5272 +endif +endif # Support compiling the display code separately for both i915 and xe # drivers. Define I915 when building i915. subdir-ccflags-y += -DI915
Signature · 1 line
2.27.0
Jani Nikula
maintainerQuoted 5 lines · On Thu, 13 Jun 2024, [email protected] wrote:
From: Peng Hao <[email protected]>
When building kernel with clang, which will typically
have sanitizers enabled, there is a warning about a large stack frame.
Quoted 8 lines
drivers/gpu/drm/i915/gt/intel_workarounds.c:3044:6: error: stack frame size (5176) exceeds limit (2048) in 'intel_engine_init_workarounds' [-Werror,-Wframe-larger-than] voidintel_engine_init_workarounds(struct intel_engine_cs *engine)^128/5176 (2.47%) spills, 5048/5176 (97.53%) variables
so increase the limit for configurations that have KASAN or KCSAN enabled for not breaking the majority of builds.
We need to fix the issue instead of sweeping it under the carpet.
Also, please see MAINTAINERS for where to send i915 patches.
BR,
Jani.
Quoted 23 lines
Signed-off-by Peng Hao <[email protected]>--- drivers/gpu/drm/i915/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/Makefile +5
-1@@ -36,7 +36,11 @@ subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror CFLAGS_i915_pci.o = -Wno-override-init CFLAGS_display/intel_display_device.o = -Wno-override-init CFLAGS_display/intel_fbdev.o = -Wno-override-init - +ifneq ($(CONFIG_FRAME_WARN),0) +ifeq ($(filter y,$(CONFIG_KASAN)$(CONFIG_KCSAN)),y) +CFLAGS_gt/intel_workarounds.o = -Wframe-larger-than=5272 +endif +endif # Support compiling the display code separately for both i915 and xe # drivers. Define I915 when building i915. subdir-ccflags-y += -DI915
Signature · 1 line
Jani Nikula, Intel