* [PATCH] i915: increase frame warning limit in intel_workaround when using KASAN or KCSAN
@ 2024-06-13 2:23 flyingpenghao
2024-06-13 9:57 ` Jani Nikula
0 siblings, 1 reply; 2+ messages in thread
From: flyingpenghao @ 2024-06-13 2:23 UTC (permalink / raw)
To: airlied, daniel; +Cc: dri-devel, Peng Hao
From: Peng Hao <flyingpeng@tencent.com>
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.
Signed-off-by: Peng Hao <flyingpeng@tencent.com>
---
drivers/gpu/drm/i915/Makefile | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index fba73c38e235..884e2f010bdd 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -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
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] i915: increase frame warning limit in intel_workaround when using KASAN or KCSAN
2024-06-13 2:23 [PATCH] i915: increase frame warning limit in intel_workaround when using KASAN or KCSAN flyingpenghao
@ 2024-06-13 9:57 ` Jani Nikula
0 siblings, 0 replies; 2+ messages in thread
From: Jani Nikula @ 2024-06-13 9:57 UTC (permalink / raw)
To: flyingpenghao, airlied, daniel; +Cc: dri-devel, Peng Hao
On Thu, 13 Jun 2024, flyingpenghao@gmail.com wrote:
> From: Peng Hao <flyingpeng@tencent.com>
>
> 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.
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.
>
> Signed-off-by: Peng Hao <flyingpeng@tencent.com>
> ---
> drivers/gpu/drm/i915/Makefile | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> index fba73c38e235..884e2f010bdd 100644
> --- a/drivers/gpu/drm/i915/Makefile
> +++ b/drivers/gpu/drm/i915/Makefile
> @@ -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
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-06-13 9:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-13 2:23 [PATCH] i915: increase frame warning limit in intel_workaround when using KASAN or KCSAN flyingpenghao
2024-06-13 9:57 ` Jani Nikula
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.