[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b6bb68f0-7e93-4db2-9fe6-f615f06ddeb1@roeck-us.net>
Date: Fri, 21 Mar 2025 10:05:55 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Alessandro Carminati <acarmina@...hat.com>,
linux-kselftest@...r.kernel.org
Cc: David Airlie <airlied@...il.com>, Arnd Bergmann <arnd@...db.de>,
Maíra Canal <mcanal@...lia.com>,
Dan Carpenter <dan.carpenter@...aro.org>, Kees Cook <keescook@...omium.org>,
Daniel Diaz <daniel.diaz@...aro.org>, David Gow <davidgow@...gle.com>,
Arthur Grillo <arthurgrillo@...eup.net>,
Brendan Higgins <brendan.higgins@...ux.dev>,
Naresh Kamboju <naresh.kamboju@...aro.org>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>, Maxime Ripard
<mripard@...nel.org>, Ville Syrjälä
<ville.syrjala@...ux.intel.com>, Daniel Vetter <daniel@...ll.ch>,
Thomas Zimmermann <tzimmermann@...e.de>,
Alessandro Carminati <alessandro.carminati@...il.com>,
Jani Nikula <jani.nikula@...el.com>, dri-devel@...ts.freedesktop.org,
kunit-dev@...glegroups.com, linux-arch@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-parisc@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-riscv@...ts.infradead.org,
linux-s390@...r.kernel.org, linux-sh@...r.kernel.org,
loongarch@...ts.linux.dev, x86@...nel.org,
Linux Kernel Functional Testing <lkft@...aro.org>,
Heiko Carstens <hca@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>
Subject: Re: [PATCH v4 10/14] s390: Add support for suppressing warning
backtraces
On 3/13/25 04:43, Alessandro Carminati wrote:
> From: Guenter Roeck <linux@...ck-us.net>
>
> Add name of functions triggering warning backtraces to the __bug_table
> object section to enable support for suppressing WARNING backtraces.
>
> To limit image size impact, the pointer to the function name is only added
> to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and
> CONFIG_DEBUG_BUGVERBOSE are enabled. Otherwise, the __func__ assembly
> parameter is replaced with a (dummy) NULL parameter to avoid an image size
> increase due to unused __func__ entries (this is necessary because
> __func__ is not a define but a virtual variable).
>
> Tested-by: Linux Kernel Functional Testing <lkft@...aro.org>
> Acked-by: Dan Carpenter <dan.carpenter@...aro.org>
> Cc: Heiko Carstens <hca@...ux.ibm.com>
> Cc: Vasily Gorbik <gor@...ux.ibm.com>
> Cc: Alexander Gordeev <agordeev@...ux.ibm.com>
> Signed-off-by: Guenter Roeck <linux@...ck-us.net>
> Signed-off-by: Alessandro Carminati <acarmina@...hat.com>
> ---
> arch/s390/include/asm/bug.h | 17 ++++++++++++++---
> 1 file changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/arch/s390/include/asm/bug.h b/arch/s390/include/asm/bug.h
> index c500d45fb465..44d4e9f24ae0 100644
> --- a/arch/s390/include/asm/bug.h
> +++ b/arch/s390/include/asm/bug.h
> @@ -8,6 +8,15 @@
>
> #ifdef CONFIG_DEBUG_BUGVERBOSE
>
> +#ifdef CONFIG_KUNIT_SUPPRESS_BACKTRACE
> +# define HAVE_BUG_FUNCTION
> +# define __BUG_FUNC_PTR " .long %0-.\n"
> +# define __BUG_FUNC __func__
gcc 7.5.0 on s390 barfs; it doesn't like the use of "__func__" with "%0-."
drivers/gpu/drm/bridge/analogix/analogix-i2c-dptx.c: In function 'anx_dp_aux_transfer':
././include/linux/compiler_types.h:492:20: warning: asm operand 0 probably doesn't match constraints
I was unable to find an alternate constraint that the compiler would accept.
I don't know if the same problem is seen with older compilers on other architectures,
or if the problem is relevant in the first place.
gcc 10.3.0 and later do not have this problem. I also tried s390 builds with gcc 9.4
and 9.5 but they both crash for unrelated reasons.
If this is a concern, the best idea I have is to make KUNIT_SUPPRESS_BACKTRACE
depend on, say,
depends on CC_IS_CLANG || (CC_IS_GCC && GCC_VERSION >= 100300)
A more complex solution might be to define an architecture flag such
as HAVE_SUPPRESS_BACKTRACE, make that conditional on the gcc version
for s390 only, and make KUNIT_SUPPRESS_BACKTRACE depend on it.
Guenter
Powered by blists - more mailing lists