All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/selftest: plane_helper: Put test structures in static storage
@ 2022-03-02 23:59 ` Nathan Chancellor
  0 siblings, 0 replies; 10+ messages in thread
From: Nathan Chancellor @ 2022-03-02 23:59 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter
  Cc: Nick Desaulniers, Claudio Suarez, dri-devel, llvm, patches,
	Nathan Chancellor, kernel test robot

Clang warns on certain 32-bit architectures:

  drivers/gpu/drm/selftests/test-drm_plane_helper.c:76:5: warning: stack frame size (1064) exceeds limit (1024) in 'igt_check_plane_state' [-Wframe-larger-than]
  int igt_check_plane_state(void *ignored)
      ^
  1 warning generated.

The structures in igt_check_plane_state() total 1008 bytes, so any small
amount of inlining will cause the stack frame to exceed the 32-bit limit
of 1024, triggering the warning.

Move these structures to static storage, which dramatically reduces the
amount of stack space in igt_check_plane_state(). There is no testing
impact, as igt_check_plane_state() is only called once in the driver.

Fixes: 943e6a8beeac ("mock a drm_plane in igt_check_plane_state to make the test more robust")
Link: https://github.com/ClangBuiltLinux/linux/issues/1600
Reported-by: kernel test robot <lkp@intel.com>
Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/gpu/drm/selftests/test-drm_plane_helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/selftests/test-drm_plane_helper.c b/drivers/gpu/drm/selftests/test-drm_plane_helper.c
index ceebeede55ea..b61273e9c403 100644
--- a/drivers/gpu/drm/selftests/test-drm_plane_helper.c
+++ b/drivers/gpu/drm/selftests/test-drm_plane_helper.c
@@ -77,7 +77,7 @@ int igt_check_plane_state(void *ignored)
 {
 	int ret;
 
-	const struct drm_crtc_state crtc_state = {
+	static const struct drm_crtc_state crtc_state = {
 		.crtc = ZERO_SIZE_PTR,
 		.enable = true,
 		.active = true,
@@ -87,14 +87,14 @@ int igt_check_plane_state(void *ignored)
 				DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC)
 		},
 	};
-	struct drm_plane plane = {
+	static struct drm_plane plane = {
 		.dev = NULL
 	};
-	struct drm_framebuffer fb = {
+	static struct drm_framebuffer fb = {
 		.width = 2048,
 		.height = 2048
 	};
-	struct drm_plane_state plane_state = {
+	static struct drm_plane_state plane_state = {
 		.plane = &plane,
 		.crtc = ZERO_SIZE_PTR,
 		.fb = &fb,

base-commit: 9ae2ac4d31a85ce59cc560d514a31b95f4ace154
-- 
2.35.1


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

* [PATCH] drm/selftest: plane_helper: Put test structures in static storage
@ 2022-03-02 23:59 ` Nathan Chancellor
  0 siblings, 0 replies; 10+ messages in thread
From: Nathan Chancellor @ 2022-03-02 23:59 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter
  Cc: kernel test robot, llvm, Nick Desaulniers, patches, dri-devel,
	Nathan Chancellor, Claudio Suarez

Clang warns on certain 32-bit architectures:

  drivers/gpu/drm/selftests/test-drm_plane_helper.c:76:5: warning: stack frame size (1064) exceeds limit (1024) in 'igt_check_plane_state' [-Wframe-larger-than]
  int igt_check_plane_state(void *ignored)
      ^
  1 warning generated.

The structures in igt_check_plane_state() total 1008 bytes, so any small
amount of inlining will cause the stack frame to exceed the 32-bit limit
of 1024, triggering the warning.

Move these structures to static storage, which dramatically reduces the
amount of stack space in igt_check_plane_state(). There is no testing
impact, as igt_check_plane_state() is only called once in the driver.

Fixes: 943e6a8beeac ("mock a drm_plane in igt_check_plane_state to make the test more robust")
Link: https://github.com/ClangBuiltLinux/linux/issues/1600
Reported-by: kernel test robot <lkp@intel.com>
Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/gpu/drm/selftests/test-drm_plane_helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/selftests/test-drm_plane_helper.c b/drivers/gpu/drm/selftests/test-drm_plane_helper.c
index ceebeede55ea..b61273e9c403 100644
--- a/drivers/gpu/drm/selftests/test-drm_plane_helper.c
+++ b/drivers/gpu/drm/selftests/test-drm_plane_helper.c
@@ -77,7 +77,7 @@ int igt_check_plane_state(void *ignored)
 {
 	int ret;
 
-	const struct drm_crtc_state crtc_state = {
+	static const struct drm_crtc_state crtc_state = {
 		.crtc = ZERO_SIZE_PTR,
 		.enable = true,
 		.active = true,
@@ -87,14 +87,14 @@ int igt_check_plane_state(void *ignored)
 				DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC)
 		},
 	};
-	struct drm_plane plane = {
+	static struct drm_plane plane = {
 		.dev = NULL
 	};
-	struct drm_framebuffer fb = {
+	static struct drm_framebuffer fb = {
 		.width = 2048,
 		.height = 2048
 	};
-	struct drm_plane_state plane_state = {
+	static struct drm_plane_state plane_state = {
 		.plane = &plane,
 		.crtc = ZERO_SIZE_PTR,
 		.fb = &fb,

base-commit: 9ae2ac4d31a85ce59cc560d514a31b95f4ace154
-- 
2.35.1


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

* Re: [PATCH] drm/selftest: plane_helper: Put test structures in static storage
  2022-03-02 23:59 ` Nathan Chancellor
@ 2022-03-08 22:47   ` Nick Desaulniers
  -1 siblings, 0 replies; 10+ messages in thread
From: Nick Desaulniers @ 2022-03-08 22:47 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: David Airlie, Daniel Vetter, Claudio Suarez, dri-devel, llvm,
	patches, kernel test robot

On Wed, Mar 2, 2022 at 4:00 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> Clang warns on certain 32-bit architectures:
>
>   drivers/gpu/drm/selftests/test-drm_plane_helper.c:76:5: warning: stack frame size (1064) exceeds limit (1024) in 'igt_check_plane_state' [-Wframe-larger-than]
>   int igt_check_plane_state(void *ignored)
>       ^
>   1 warning generated.
>
> The structures in igt_check_plane_state() total 1008 bytes, so any small
> amount of inlining will cause the stack frame to exceed the 32-bit limit
> of 1024, triggering the warning.
>
> Move these structures to static storage, which dramatically reduces the
> amount of stack space in igt_check_plane_state(). There is no testing
> impact, as igt_check_plane_state() is only called once in the driver.
>
> Fixes: 943e6a8beeac ("mock a drm_plane in igt_check_plane_state to make the test more robust")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1600
> Reported-by: kernel test robot <lkp@intel.com>
> Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Thanks for the patch!
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>  drivers/gpu/drm/selftests/test-drm_plane_helper.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/selftests/test-drm_plane_helper.c b/drivers/gpu/drm/selftests/test-drm_plane_helper.c
> index ceebeede55ea..b61273e9c403 100644
> --- a/drivers/gpu/drm/selftests/test-drm_plane_helper.c
> +++ b/drivers/gpu/drm/selftests/test-drm_plane_helper.c
> @@ -77,7 +77,7 @@ int igt_check_plane_state(void *ignored)
>  {
>         int ret;
>
> -       const struct drm_crtc_state crtc_state = {
> +       static const struct drm_crtc_state crtc_state = {
>                 .crtc = ZERO_SIZE_PTR,
>                 .enable = true,
>                 .active = true,
> @@ -87,14 +87,14 @@ int igt_check_plane_state(void *ignored)
>                                 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC)
>                 },
>         };
> -       struct drm_plane plane = {
> +       static struct drm_plane plane = {
>                 .dev = NULL
>         };
> -       struct drm_framebuffer fb = {
> +       static struct drm_framebuffer fb = {
>                 .width = 2048,
>                 .height = 2048
>         };
> -       struct drm_plane_state plane_state = {
> +       static struct drm_plane_state plane_state = {
>                 .plane = &plane,
>                 .crtc = ZERO_SIZE_PTR,
>                 .fb = &fb,
>
> base-commit: 9ae2ac4d31a85ce59cc560d514a31b95f4ace154
> --
> 2.35.1
>


-- 
Thanks,
~Nick Desaulniers

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

* Re: [PATCH] drm/selftest: plane_helper: Put test structures in static storage
@ 2022-03-08 22:47   ` Nick Desaulniers
  0 siblings, 0 replies; 10+ messages in thread
From: Nick Desaulniers @ 2022-03-08 22:47 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: kernel test robot, David Airlie, llvm, patches, dri-devel,
	Claudio Suarez

On Wed, Mar 2, 2022 at 4:00 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> Clang warns on certain 32-bit architectures:
>
>   drivers/gpu/drm/selftests/test-drm_plane_helper.c:76:5: warning: stack frame size (1064) exceeds limit (1024) in 'igt_check_plane_state' [-Wframe-larger-than]
>   int igt_check_plane_state(void *ignored)
>       ^
>   1 warning generated.
>
> The structures in igt_check_plane_state() total 1008 bytes, so any small
> amount of inlining will cause the stack frame to exceed the 32-bit limit
> of 1024, triggering the warning.
>
> Move these structures to static storage, which dramatically reduces the
> amount of stack space in igt_check_plane_state(). There is no testing
> impact, as igt_check_plane_state() is only called once in the driver.
>
> Fixes: 943e6a8beeac ("mock a drm_plane in igt_check_plane_state to make the test more robust")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1600
> Reported-by: kernel test robot <lkp@intel.com>
> Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Thanks for the patch!
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>  drivers/gpu/drm/selftests/test-drm_plane_helper.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/selftests/test-drm_plane_helper.c b/drivers/gpu/drm/selftests/test-drm_plane_helper.c
> index ceebeede55ea..b61273e9c403 100644
> --- a/drivers/gpu/drm/selftests/test-drm_plane_helper.c
> +++ b/drivers/gpu/drm/selftests/test-drm_plane_helper.c
> @@ -77,7 +77,7 @@ int igt_check_plane_state(void *ignored)
>  {
>         int ret;
>
> -       const struct drm_crtc_state crtc_state = {
> +       static const struct drm_crtc_state crtc_state = {
>                 .crtc = ZERO_SIZE_PTR,
>                 .enable = true,
>                 .active = true,
> @@ -87,14 +87,14 @@ int igt_check_plane_state(void *ignored)
>                                 DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC)
>                 },
>         };
> -       struct drm_plane plane = {
> +       static struct drm_plane plane = {
>                 .dev = NULL
>         };
> -       struct drm_framebuffer fb = {
> +       static struct drm_framebuffer fb = {
>                 .width = 2048,
>                 .height = 2048
>         };
> -       struct drm_plane_state plane_state = {
> +       static struct drm_plane_state plane_state = {
>                 .plane = &plane,
>                 .crtc = ZERO_SIZE_PTR,
>                 .fb = &fb,
>
> base-commit: 9ae2ac4d31a85ce59cc560d514a31b95f4ace154
> --
> 2.35.1
>


-- 
Thanks,
~Nick Desaulniers

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

* Re: [PATCH] drm/selftest: plane_helper: Put test structures in static storage
  2022-03-02 23:59 ` Nathan Chancellor
@ 2022-03-18 17:11   ` Nathan Chancellor
  -1 siblings, 0 replies; 10+ messages in thread
From: Nathan Chancellor @ 2022-03-18 17:11 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter
  Cc: Nick Desaulniers, Claudio Suarez, dri-devel, llvm, patches,
	kernel test robot

Ping, could someone review and/or pick this up? This is going to break a
few builds with CONFIG_WERROR, it would be nice to have it in
drm-misc-next-fixes, as the commit it is fixing is in drm-misc-next.

Cheers,
Nathan

On Wed, Mar 02, 2022 at 04:59:09PM -0700, Nathan Chancellor wrote:
> Clang warns on certain 32-bit architectures:
> 
>   drivers/gpu/drm/selftests/test-drm_plane_helper.c:76:5: warning: stack frame size (1064) exceeds limit (1024) in 'igt_check_plane_state' [-Wframe-larger-than]
>   int igt_check_plane_state(void *ignored)
>       ^
>   1 warning generated.
> 
> The structures in igt_check_plane_state() total 1008 bytes, so any small
> amount of inlining will cause the stack frame to exceed the 32-bit limit
> of 1024, triggering the warning.
> 
> Move these structures to static storage, which dramatically reduces the
> amount of stack space in igt_check_plane_state(). There is no testing
> impact, as igt_check_plane_state() is only called once in the driver.
> 
> Fixes: 943e6a8beeac ("mock a drm_plane in igt_check_plane_state to make the test more robust")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1600
> Reported-by: kernel test robot <lkp@intel.com>
> Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>  drivers/gpu/drm/selftests/test-drm_plane_helper.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/selftests/test-drm_plane_helper.c b/drivers/gpu/drm/selftests/test-drm_plane_helper.c
> index ceebeede55ea..b61273e9c403 100644
> --- a/drivers/gpu/drm/selftests/test-drm_plane_helper.c
> +++ b/drivers/gpu/drm/selftests/test-drm_plane_helper.c
> @@ -77,7 +77,7 @@ int igt_check_plane_state(void *ignored)
>  {
>  	int ret;
>  
> -	const struct drm_crtc_state crtc_state = {
> +	static const struct drm_crtc_state crtc_state = {
>  		.crtc = ZERO_SIZE_PTR,
>  		.enable = true,
>  		.active = true,
> @@ -87,14 +87,14 @@ int igt_check_plane_state(void *ignored)
>  				DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC)
>  		},
>  	};
> -	struct drm_plane plane = {
> +	static struct drm_plane plane = {
>  		.dev = NULL
>  	};
> -	struct drm_framebuffer fb = {
> +	static struct drm_framebuffer fb = {
>  		.width = 2048,
>  		.height = 2048
>  	};
> -	struct drm_plane_state plane_state = {
> +	static struct drm_plane_state plane_state = {
>  		.plane = &plane,
>  		.crtc = ZERO_SIZE_PTR,
>  		.fb = &fb,
> 
> base-commit: 9ae2ac4d31a85ce59cc560d514a31b95f4ace154
> -- 
> 2.35.1
> 
> 

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

* Re: [PATCH] drm/selftest: plane_helper: Put test structures in static storage
@ 2022-03-18 17:11   ` Nathan Chancellor
  0 siblings, 0 replies; 10+ messages in thread
From: Nathan Chancellor @ 2022-03-18 17:11 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter
  Cc: kernel test robot, llvm, Nick Desaulniers, patches, dri-devel,
	Claudio Suarez

Ping, could someone review and/or pick this up? This is going to break a
few builds with CONFIG_WERROR, it would be nice to have it in
drm-misc-next-fixes, as the commit it is fixing is in drm-misc-next.

Cheers,
Nathan

On Wed, Mar 02, 2022 at 04:59:09PM -0700, Nathan Chancellor wrote:
> Clang warns on certain 32-bit architectures:
> 
>   drivers/gpu/drm/selftests/test-drm_plane_helper.c:76:5: warning: stack frame size (1064) exceeds limit (1024) in 'igt_check_plane_state' [-Wframe-larger-than]
>   int igt_check_plane_state(void *ignored)
>       ^
>   1 warning generated.
> 
> The structures in igt_check_plane_state() total 1008 bytes, so any small
> amount of inlining will cause the stack frame to exceed the 32-bit limit
> of 1024, triggering the warning.
> 
> Move these structures to static storage, which dramatically reduces the
> amount of stack space in igt_check_plane_state(). There is no testing
> impact, as igt_check_plane_state() is only called once in the driver.
> 
> Fixes: 943e6a8beeac ("mock a drm_plane in igt_check_plane_state to make the test more robust")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1600
> Reported-by: kernel test robot <lkp@intel.com>
> Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>  drivers/gpu/drm/selftests/test-drm_plane_helper.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/selftests/test-drm_plane_helper.c b/drivers/gpu/drm/selftests/test-drm_plane_helper.c
> index ceebeede55ea..b61273e9c403 100644
> --- a/drivers/gpu/drm/selftests/test-drm_plane_helper.c
> +++ b/drivers/gpu/drm/selftests/test-drm_plane_helper.c
> @@ -77,7 +77,7 @@ int igt_check_plane_state(void *ignored)
>  {
>  	int ret;
>  
> -	const struct drm_crtc_state crtc_state = {
> +	static const struct drm_crtc_state crtc_state = {
>  		.crtc = ZERO_SIZE_PTR,
>  		.enable = true,
>  		.active = true,
> @@ -87,14 +87,14 @@ int igt_check_plane_state(void *ignored)
>  				DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC)
>  		},
>  	};
> -	struct drm_plane plane = {
> +	static struct drm_plane plane = {
>  		.dev = NULL
>  	};
> -	struct drm_framebuffer fb = {
> +	static struct drm_framebuffer fb = {
>  		.width = 2048,
>  		.height = 2048
>  	};
> -	struct drm_plane_state plane_state = {
> +	static struct drm_plane_state plane_state = {
>  		.plane = &plane,
>  		.crtc = ZERO_SIZE_PTR,
>  		.fb = &fb,
> 
> base-commit: 9ae2ac4d31a85ce59cc560d514a31b95f4ace154
> -- 
> 2.35.1
> 
> 

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

* Re: (subset) [PATCH] drm/selftest: plane_helper: Put test structures in static storage
  2022-03-02 23:59 ` Nathan Chancellor
@ 2022-03-21 10:08   ` Maxime Ripard
  -1 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2022-03-21 10:08 UTC (permalink / raw)
  To: Daniel Vetter, David Airlie, Nathan Chancellor
  Cc: kernel test robot, llvm, Nick Desaulniers, patches, dri-devel,
	Claudio Suarez, Maxime Ripard

On Wed, 2 Mar 2022 16:59:09 -0700, Nathan Chancellor wrote:
> Clang warns on certain 32-bit architectures:
> 
>   drivers/gpu/drm/selftests/test-drm_plane_helper.c:76:5: warning: stack frame size (1064) exceeds limit (1024) in 'igt_check_plane_state' [-Wframe-larger-than]
>   int igt_check_plane_state(void *ignored)
>       ^
>   1 warning generated.
> 
> [...]

Applied to drm/drm-misc (drm-misc-next-fixes).

Thanks!
Maxime

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

* Re: (subset) [PATCH] drm/selftest: plane_helper: Put test structures in static storage
@ 2022-03-21 10:08   ` Maxime Ripard
  0 siblings, 0 replies; 10+ messages in thread
From: Maxime Ripard @ 2022-03-21 10:08 UTC (permalink / raw)
  To: Daniel Vetter, David Airlie, Nathan Chancellor
  Cc: Maxime Ripard, Claudio Suarez, patches, llvm, Nick Desaulniers,
	kernel test robot, dri-devel

On Wed, 2 Mar 2022 16:59:09 -0700, Nathan Chancellor wrote:
> Clang warns on certain 32-bit architectures:
> 
>   drivers/gpu/drm/selftests/test-drm_plane_helper.c:76:5: warning: stack frame size (1064) exceeds limit (1024) in 'igt_check_plane_state' [-Wframe-larger-than]
>   int igt_check_plane_state(void *ignored)
>       ^
>   1 warning generated.
> 
> [...]

Applied to drm/drm-misc (drm-misc-next-fixes).

Thanks!
Maxime

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

* Re: [PATCH] drm/selftest: plane_helper: Put test structures in static storage
  2022-03-02 23:59 ` Nathan Chancellor
@ 2022-03-25 18:30   ` Guenter Roeck
  -1 siblings, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2022-03-25 18:30 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: David Airlie, Daniel Vetter, kernel test robot, llvm,
	Nick Desaulniers, patches, dri-devel, Claudio Suarez

On Wed, Mar 02, 2022 at 04:59:09PM -0700, Nathan Chancellor wrote:
> Clang warns on certain 32-bit architectures:
> 
>   drivers/gpu/drm/selftests/test-drm_plane_helper.c:76:5: warning: stack frame size (1064) exceeds limit (1024) in 'igt_check_plane_state' [-Wframe-larger-than]
>   int igt_check_plane_state(void *ignored)
>       ^
>   1 warning generated.
> 
> The structures in igt_check_plane_state() total 1008 bytes, so any small
> amount of inlining will cause the stack frame to exceed the 32-bit limit
> of 1024, triggering the warning.
> 
> Move these structures to static storage, which dramatically reduces the
> amount of stack space in igt_check_plane_state(). There is no testing
> impact, as igt_check_plane_state() is only called once in the driver.
> 
> Fixes: 943e6a8beeac ("mock a drm_plane in igt_check_plane_state to make the test more robust")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1600
> Reported-by: kernel test robot <lkp@intel.com>
> Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

Tested-by: Guenter Roeck <linux@roeck-us.net>

Note that the offending patch is now in mainline and results in test build
failures there.

Building csky:allmodconfig ... failed
--------------
Error log:
drivers/gpu/drm/selftests/test-drm_plane_helper.c: In function 'igt_check_plane_state':
drivers/gpu/drm/selftests/test-drm_plane_helper.c:223:1: error: the frame size of 1072 bytes is larger than 1024 bytes

This is with gcc 11.2.

Guenter

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

* Re: [PATCH] drm/selftest: plane_helper: Put test structures in static storage
@ 2022-03-25 18:30   ` Guenter Roeck
  0 siblings, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2022-03-25 18:30 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: kernel test robot, David Airlie, llvm, Nick Desaulniers, patches,
	dri-devel, Claudio Suarez

On Wed, Mar 02, 2022 at 04:59:09PM -0700, Nathan Chancellor wrote:
> Clang warns on certain 32-bit architectures:
> 
>   drivers/gpu/drm/selftests/test-drm_plane_helper.c:76:5: warning: stack frame size (1064) exceeds limit (1024) in 'igt_check_plane_state' [-Wframe-larger-than]
>   int igt_check_plane_state(void *ignored)
>       ^
>   1 warning generated.
> 
> The structures in igt_check_plane_state() total 1008 bytes, so any small
> amount of inlining will cause the stack frame to exceed the 32-bit limit
> of 1024, triggering the warning.
> 
> Move these structures to static storage, which dramatically reduces the
> amount of stack space in igt_check_plane_state(). There is no testing
> impact, as igt_check_plane_state() is only called once in the driver.
> 
> Fixes: 943e6a8beeac ("mock a drm_plane in igt_check_plane_state to make the test more robust")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1600
> Reported-by: kernel test robot <lkp@intel.com>
> Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

Tested-by: Guenter Roeck <linux@roeck-us.net>

Note that the offending patch is now in mainline and results in test build
failures there.

Building csky:allmodconfig ... failed
--------------
Error log:
drivers/gpu/drm/selftests/test-drm_plane_helper.c: In function 'igt_check_plane_state':
drivers/gpu/drm/selftests/test-drm_plane_helper.c:223:1: error: the frame size of 1072 bytes is larger than 1024 bytes

This is with gcc 11.2.

Guenter

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

end of thread, other threads:[~2022-03-25 18:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-02 23:59 [PATCH] drm/selftest: plane_helper: Put test structures in static storage Nathan Chancellor
2022-03-02 23:59 ` Nathan Chancellor
2022-03-08 22:47 ` Nick Desaulniers
2022-03-08 22:47   ` Nick Desaulniers
2022-03-18 17:11 ` Nathan Chancellor
2022-03-18 17:11   ` Nathan Chancellor
2022-03-21 10:08 ` (subset) " Maxime Ripard
2022-03-21 10:08   ` Maxime Ripard
2022-03-25 18:30 ` Guenter Roeck
2022-03-25 18:30   ` Guenter Roeck

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.