Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp716043lqb; Fri, 15 Mar 2024 04:46:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWlSw4H6SXKKc7aUeHxOlKlzFpThNB/cVNP+O7ZPoxmE3Plj4zgDgAIcq+kT1uU6q4kTGZYRgshEi+QG+Au5fM56MRfGcS1oIso+hWHDw== X-Google-Smtp-Source: AGHT+IHwU35jYK+RWocpuCA/XLRs1RGuIU+hOfBot5Pzyp7Br2Q59jG71q4fL9grS+YkkTgo7sAK X-Received: by 2002:a05:6a00:234c:b0:6e6:ab7a:7753 with SMTP id j12-20020a056a00234c00b006e6ab7a7753mr3609085pfj.21.1710503208858; Fri, 15 Mar 2024 04:46:48 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q18-20020aa79832000000b006e6b2b2b0f8si3332461pfl.354.2024.03.15.04.46.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 04:46:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104366-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmx.de header.s=s31663417 header.b=McITOoD1; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-104366-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104366-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=QUARANTINE) header.from=gmx.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7A98D281731 for ; Fri, 15 Mar 2024 11:46:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F8C519BCA; Fri, 15 Mar 2024 11:46:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmx.de header.i=deller@gmx.de header.b="McITOoD1" Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84EDD1B805; Fri, 15 Mar 2024 11:46:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710503196; cv=none; b=SUn37Ia+lOTkeEjUAdWTRRlsRilFRPf3jr781dtWBnFvGEB3l/2yjXViv3/eczg6qjHi6lKtCrFOPHWWd4KROSsUug5BEGO/RTofTt6f+PTuV5jgVfp29n4f+kofWaK5Da4j0Y/0kmO3pacRVd+l0XrxOKh5NBr2QZje834E7iI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710503196; c=relaxed/simple; bh=VZMYtqfs6hu3j6sEtqmhf7RBOwHd3RT2KLrTrS7SDHU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=efxos+M5fLXcTpijLojiC9fM4w0XJg6xN204t7lgT3HVT3ft2fdSNGbtDmR2afhS8yIihaPMq4ndUINnMPN6avuPv0u0yiCIZ191LmnTLSzbyXqvpJz4NNCXFNBMHZX5FzSZ1d4Z1TkeOhSspBzopyUNbbr9NxjwfF37JbkNKY8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=deller@gmx.de header.b=McITOoD1; arc=none smtp.client-ip=212.227.17.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1710503142; x=1711107942; i=deller@gmx.de; bh=7qGxCcL79dacW1v0qhsaH7joRGKSBJXder9Wljx7Ons=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=McITOoD1wQOPR5qsD5lJhrmT4u/2I6i5oTsCyoNQ+HyXnnYr9lHABJxJNEfBVmE1 bnJ1MnmdGbKRpaekbFqJ1Sc+YOT1phsYE+jnd8d6asLVVMKrY40M8xgREptIDnbvH y2mErimBTccXiuWpmxUyFOdhtGVN+4463Qd0hpgSpmcplUGnYfMiAp+tngIYhhhNY pTEncmqpqTVo8ts2zW4JmtQY4Lbszh3JX7Wwh1SGisRNpGW+I3Ws6naI1vcEx94jS in2nmK4ujOjNzcgmIbahRICBxVzYe1HEkJgrelpkTzJ9xyTl7FxGwxIDRdG1Cv2cw feVm70l0GQvaQdmRfQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.20.55] ([94.134.155.107]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mo6ux-1r1oxZ2Eln-00pdXJ; Fri, 15 Mar 2024 12:45:42 +0100 Message-ID: Date: Fri, 15 Mar 2024 12:45:35 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 10/14] parisc: Add support for suppressing warning backtraces Content-Language: en-US To: Guenter Roeck , linux-kselftest@vger.kernel.org Cc: David Airlie , Arnd Bergmann , =?UTF-8?Q?Ma=C3=ADra_Canal?= , Dan Carpenter , Kees Cook , Daniel Diaz , David Gow , Arthur Grillo , Brendan Higgins , Naresh Kamboju , Maarten Lankhorst , Andrew Morton , Maxime Ripard , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , Daniel Vetter , Thomas Zimmermann , dri-devel@lists.freedesktop.org, kunit-dev@googlegroups.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, loongarch@lists.linux.dev, netdev@lists.linux.dev References: <20240312170309.2546362-1-linux@roeck-us.net> <20240312170309.2546362-11-linux@roeck-us.net> From: Helge Deller Autocrypt: addr=deller@gmx.de; keydata= xsFNBF3Ia3MBEAD3nmWzMgQByYAWnb9cNqspnkb2GLVKzhoH2QD4eRpyDLA/3smlClbeKkWT HLnjgkbPFDmcmCz5V0Wv1mKYRClAHPCIBIJgyICqqUZo2qGmKstUx3pFAiztlXBANpRECgwJ r+8w6mkccOM9GhoPU0vMaD/UVJcJQzvrxVHO8EHS36aUkjKd6cOpdVbCt3qx8cEhCmaFEO6u CL+k5AZQoABbFQEBocZE1/lSYzaHkcHrjn4cQjc3CffXnUVYwlo8EYOtAHgMDC39s9a7S90L 69l6G73lYBD/Br5lnDPlG6dKfGFZZpQ1h8/x+Qz366Ojfq9MuuRJg7ZQpe6foiOtqwKym/zV dVvSdOOc5sHSpfwu5+BVAAyBd6hw4NddlAQUjHSRs3zJ9OfrEx2d3mIfXZ7+pMhZ7qX0Axlq Lq+B5cfLpzkPAgKn11tfXFxP+hcPHIts0bnDz4EEp+HraW+oRCH2m57Y9zhcJTOJaLw4YpTY GRUlF076vZ2Hz/xMEvIJddRGId7UXZgH9a32NDf+BUjWEZvFt1wFSW1r7zb7oGCwZMy2LI/G aHQv/N0NeFMd28z+deyxd0k1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vDZ02j1wp7vthQcOEg08z1+XHXb8ZZKST7yTVa5P89JymGE8CBGdQaAXnqYK3/yWf FwRDcGV6nxanxZGKEkSHHOm8jHwvQWvPP73pvuPBEPtKGLzbgd7OOcGZWtq2hNC6cRtsRdDx 4TAGMCz4j238m+2mdbdhRh3iBnWT5yPFfnv/2IjFAk+sdix1Mrr+LIDF++kiekeq0yUpDdc4 ExBy2xf6dd+tuFFBp3/VDN4U0UfG4QJ2fg19zE5Z8dS4jGIbLg== In-Reply-To: <20240312170309.2546362-11-linux@roeck-us.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:qslnWwQiqg/DP5uqDNLV3ORiPULWbHV951NE0QBTZs+dRkfEELc Ui2EMTRqay5IFJgqBwNMOkZVxe2c2qIfhYvjWW11LmmVcUomylCerubebwaET5SdJ38HAfD biq5BtQDRRP7q1ov0JwyIPdpf3SRZ5rDbJ6vwSOAbcLsxrExJtjMmO4CHxfr09ugU+u+RTP QxkoLU7U56gOrWo57hroQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:wcEf58u/OD8=;/Vsuh9wNc66rAcyGNGklDP7P14y /KBt0M11EmbCmzLloMdXx4rUW/NT78LYr0GB36xaGvqIn+7+J10HViYMoBef4puW+1Zy+ERmU uCXPBCihgVu3H/tHpbrx7bQVb06U4Fe3PY9DeOnQN/AUubRpBj2Rs4xe7Rklg9dw2ak6y+FDH p6J2fQ/4hN/oaJv4Q0RYeZ2c+7Gsj9OcOVk5yv2q9P5gbpwbCrz+zdvIgeqV0IWNePAXeGLDZ Knwkvjmpt4FHk6T6GRU4nHOKpcR139cvr2sNU1GNyYLwU6LZmOtm8Knrm2XY0W4/z3Yz/QAUZ 8NtDanG36laI9TlZEesDorYKUVcjiZLhO/SW+ejfUMU5w11qdv5iouwWykFJjScDCk2rTsKyP Ob/kkVyAkyZpQBV6eWLvvkxksEdC8e+kBpMuB4zA/7SAuNwm8muKntfI2AP/nHnmMPmJVDgpS R957ToiHNzK38Im3ZMOOvrxjeHFQPGcJSI16olUHuvsUqbU8e7DCw3ZbDUub7HAizDcjnT1To YYIzxaQC4VoEQfmXNYZLQTFN7E0Y7NfVdNAgFho96LriyB+oNgtLnz2CHpPtxLbr0Cw6fx9P3 i5SQarSEbvdxpOjqBmI4m1AVvAaJ9M0+aZ8Bntm8DFLec27wgKSKsaxIgy01c089l/7pD0787 enyXVSs1ynlfngUb7TBdFbbaxID7J+fg/jdqQ2Qh2ej5EI6n8+19vo0FOS5YP4EE+1vARK9FA /6h5HW8J6ILML8R/YmYavoxbPMJ+ayDR53mwD0Prwij9SmhTtbk+2zLY5cRUJuXCQQAXWgikZ Bi6lPrjOdd/CuHHo38k1VOtLEpGzkK7j/EfuuR6AghFNI= On 3/12/24 18:03, Guenter Roeck wrote: > 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 add= ed > to the __bug_table section if both CONFIG_KUNIT and CONFIG_DEBUG_BUGVERB= OSE > 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). > > While at it, declare assembler parameters as constants where possible. > Refine .blockz instructions to calculate the necessary padding instead > of using fixed values. > > Signed-off-by: Guenter Roeck Acked-by: Helge Deller Helge > --- > arch/parisc/include/asm/bug.h | 29 +++++++++++++++++++++-------- > 1 file changed, 21 insertions(+), 8 deletions(-) > > diff --git a/arch/parisc/include/asm/bug.h b/arch/parisc/include/asm/bug= h > index 833555f74ffa..792dacc2a653 100644 > --- a/arch/parisc/include/asm/bug.h > +++ b/arch/parisc/include/asm/bug.h > @@ -23,8 +23,17 @@ > # define __BUG_REL(val) ".word " __stringify(val) > #endif > > - > #ifdef CONFIG_DEBUG_BUGVERBOSE > + > +#if IS_ENABLED(CONFIG_KUNIT) > +# define HAVE_BUG_FUNCTION > +# define __BUG_FUNC_PTR __BUG_REL(%c1) > +# define __BUG_FUNC __func__ > +#else > +# define __BUG_FUNC_PTR > +# define __BUG_FUNC NULL > +#endif /* IS_ENABLED(CONFIG_KUNIT) */ > + > #define BUG() \ > do { \ > asm volatile("\n" \ > @@ -33,10 +42,12 @@ > "\t.align 4\n" \ > "2:\t" __BUG_REL(1b) "\n" \ > "\t" __BUG_REL(%c0) "\n" \ > - "\t.short %1, %2\n" \ > - "\t.blockz %3-2*4-2*2\n" \ > + "\t" __BUG_FUNC_PTR "\n" \ > + "\t.short %c2, %c3\n" \ > + "\t.blockz %c4-(.-2b)\n" \ > "\t.popsection" \ > - : : "i" (__FILE__), "i" (__LINE__), \ > + : : "i" (__FILE__), "i" (__BUG_FUNC), \ > + "i" (__LINE__), \ > "i" (0), "i" (sizeof(struct bug_entry)) ); \ > unreachable(); \ > } while(0) > @@ -58,10 +69,12 @@ > "\t.align 4\n" \ > "2:\t" __BUG_REL(1b) "\n" \ > "\t" __BUG_REL(%c0) "\n" \ > - "\t.short %1, %2\n" \ > - "\t.blockz %3-2*4-2*2\n" \ > + "\t" __BUG_FUNC_PTR "\n" \ > + "\t.short %c2, %3\n" \ > + "\t.blockz %c4-(.-2b)\n" \ > "\t.popsection" \ > - : : "i" (__FILE__), "i" (__LINE__), \ > + : : "i" (__FILE__), "i" (__BUG_FUNC), \ > + "i" (__LINE__), \ > "i" (BUGFLAG_WARNING|(flags)), \ > "i" (sizeof(struct bug_entry)) ); \ > } while(0) > @@ -74,7 +87,7 @@ > "\t.align 4\n" \ > "2:\t" __BUG_REL(1b) "\n" \ > "\t.short %0\n" \ > - "\t.blockz %1-4-2\n" \ > + "\t.blockz %c1-(.-2b)\n" \ > "\t.popsection" \ > : : "i" (BUGFLAG_WARNING|(flags)), \ > "i" (sizeof(struct bug_entry)) ); \