Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1207521lql; Tue, 12 Mar 2024 10:07:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWZuDGXdFukVaTT5P3f2aU7b1sBk68f+5mrLVQ85Rz5vr5nmAIZZCdIUZIlsoKzcuAfte6nOe8HLCXjCAVK6qTYP4ZW0YCsRWiUndJ0DQ== X-Google-Smtp-Source: AGHT+IGWDTHdXNdhzzKDcB2a0kaN+EeDT16oQkZdHv4LPqeUKDpHtSBf07miGXeS4PufQqhMsiyN X-Received: by 2002:a9d:734e:0:b0:6e5:35b8:dcb7 with SMTP id l14-20020a9d734e000000b006e535b8dcb7mr4551118otk.19.1710263221136; Tue, 12 Mar 2024 10:07:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710263221; cv=pass; d=google.com; s=arc-20160816; b=zSQE1RVAW2CzWm2D37qVGOqdt9yLkQK49armKrusYchlfWKrZi596x4lnjWt7H8OQP VmYZpYA15gll00s3kpfWed1k7Xs7P2UlxHI2JweKwkAcfh7/FoWmO8WwUtBP1rhTBgXz dBJPgIh/wYN4/1T3fwY4ZMloibTg4zvuU7vkEN8QJ1YDSSwT2RYb7q5Kzr4ItvikeDV0 zDQZJ14w8xW9II4Bxdw/UcjmYTxH1uokmukQydunTGA4Yj+J48qzCMGI0dNXgEmieZPN OvQ5X+1x4nhSoApwNHt564A6yz1tg/0MIvXHiVjh+vopy70GmfT5hNc3uY5zzjdr89LL OAoA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:sender:dkim-signature; bh=8yPqiFdiMaUo8CT/x9a2ZlbShLK74ZzL6qnaxWOIrD0=; fh=wLN4OGy9yxaehlQ+xAIPi13ubcHoIULwwgD/Sq3GnyE=; b=zOW8f39soZgA4XEf2WlyVzvmcPUFkUc9WjkPIh+pA4ZspMpPAuw95fyX4vUYlFB4uV D0OkwVX+u4kCi9SCUHstTHze6/jVA3dzpakrYO6uPM0i237gbzRp5GnYJUfVpA9wGHoo vrZ92oQtrkkLuEipCiNsv8GWOj84FJsqTDAnZEYlnGrBKWwkYMAG0iSD3TYtaQ6DbIVC wN2TpQYnCHVWXuHVRk+TLOKp7i4NQBMLWj+uq4gN1hCPxVV1w3V8tfOqDH5CLpPzITEh WEFzGClJOX7HYSS5wHI7Lbz/gKzhxBsMqsYP89CYMEG8cQunD9pFJhPrqa6cR0tshkTS qypA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NQqGip5L; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-100566-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100566-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i4-20020ac5cd84000000b004d32e4fc87bsi958743vka.16.2024.03.12.10.07.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 10:07:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100566-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NQqGip5L; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-100566-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100566-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 618181C223E1 for ; Tue, 12 Mar 2024 17:06:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B22413D2F3; Tue, 12 Mar 2024 17:03:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NQqGip5L" Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B97C413C9E5; Tue, 12 Mar 2024 17:03:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710263019; cv=none; b=G3RmhYdHnT56VmbeMGLBufHUzf9CJ7kZsh2cxF+8MiK6LOFALaRUxbP9UnyuErz423BBAmp43RPeZ4fVe7Xtw/cxM18w0hZv+/dxZ0/REDIS/lEWWfenPpQs6VSGOzynnth+mQro4knnr2sjp0CXFT/rOnRyR3rOh/NAloxeZ9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710263019; c=relaxed/simple; bh=f0M5fc11HYIWKzmWkt7Ao2+081OZJPK9Hnp8Pgby/bA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=arZx3lIwZ7LVdwzMjQSNfpKBNmpIoFggs47HAbwCVVthwP7KlHmO2Qae9F2hctz7zM/XJbE3QbdVdHd1JnQG7IGQs9dLomrxaYKXseDqkmVeY1fdBEZnJsFVpxTPsY4vtUaS+a2d+pvieqUsIGw1e3A8/6ukPjxmH0YMb5d64oQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NQqGip5L; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1dc49b00bdbso34340115ad.3; Tue, 12 Mar 2024 10:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710263016; x=1710867816; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=8yPqiFdiMaUo8CT/x9a2ZlbShLK74ZzL6qnaxWOIrD0=; b=NQqGip5L6qpSjIyg0i6WDde/VoNj+WxxxiOkcLyrfDb+s8hCN4nsR/CsKpwqykYHYQ rsN1xozkX0w5k47rNB4sd1im+Vay70TeOyHMJxH/0MUI8VANAP2wBPXDI6jc9irUDOx4 P/vNSeGvOIdodmRWlsuUrcXyAgIM7UK0JjWDnDQHbTE0jztCVrRP7tALnOnnm6cjoROK exHEobP8niTbWzS6fgAeVLhzJD0T09TggUUQj+wQZi7yt/XnRbqxAp5vFkn2rutqMJiO fOa2Gj4lqeKClr0manY2nir1RiKwjpSJS8LTX+ISx7Wzvtl32Zb1O44Mmls8snR4bNTs LG9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710263016; x=1710867816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8yPqiFdiMaUo8CT/x9a2ZlbShLK74ZzL6qnaxWOIrD0=; b=RkF1zJZTW5Upo17fYAlHjhEvvQSzSWH7TW3tkSt6ZiXy44AR3SIeLKujIHAv6acrv0 8+F1IvQwep/MfZ6Y+f3XoEk/QQHQfcUAbaC2va9PTBEMXvOLjrQj5GoW/MgX5QkAkRzA PZfN4cpby3HBtz+sO6eUORqMzReIIO0HWnKllJp+I/OlKuH3rrb97dttgCM9UGjFydvk uV6YGu9/+SX7dJtV2dWFZo3hMhAuZqEHwbzZnntVXu35IGkfqJkLbejpkSMggxzvRMvJ CwXrJYL3ba4vRexYMqcOAi2LgAH46am/6DB4a1u5zm+6wblSvVzZ+ecaANVgXdRSA00a kjfw== X-Forwarded-Encrypted: i=1; AJvYcCWVS45q/EAfBJVTRP0unz9GUcHkpvHY2N/4p0C2ejvABuFlLmNahm8Ct58fp1d0YCf+yKWpVaYEZvuhBvlrXkXuiLhBRlHzmcAPoF6SwTTVUpCSdvPabCYnfK2lExZTE5pRW/abry3YT/x5dJg8rC8qTAItVA3PBHaP/T61avxkzZVFLuDO0rMX/Ifsw7YlpqQS/OBpl7p0tXBctI7gfM9jVlY9psOazYzwXf13dvlujH+Rd9OKr43R5PHQpiuJvUE7IZzD2MtcgTAW7GhhPbpFegyUf0ntkw== X-Gm-Message-State: AOJu0YyznalQ/Zc+BT38jtjxb+OGC1hYHlIGMkrD0jLbFuKB6r4gYWHz vRsjgZxM1kRwVWTtIzsGRvNSC+oMiWg2db1MIjJQm347bqr4I9ElbAgUiXpQ X-Received: by 2002:a17:903:2349:b0:1dd:afc9:a34f with SMTP id c9-20020a170903234900b001ddafc9a34fmr4471610plh.50.1710263016146; Tue, 12 Mar 2024 10:03:36 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id b21-20020a170902ed1500b001d9a42f6183sm6958877pld.45.2024.03.12.10.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 10:03:35 -0700 (PDT) Sender: Guenter Roeck From: Guenter Roeck To: linux-kselftest@vger.kernel.org Cc: David Airlie , Arnd Bergmann , =?UTF-8?q?Ma=C3=ADra=20Canal?= , Dan Carpenter , Kees Cook , Daniel Diaz , David Gow , Arthur Grillo , Brendan Higgins , Naresh Kamboju , Maarten Lankhorst , Andrew Morton , Maxime Ripard , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , 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, Guenter Roeck Subject: [PATCH 10/14] parisc: Add support for suppressing warning backtraces Date: Tue, 12 Mar 2024 10:03:05 -0700 Message-Id: <20240312170309.2546362-11-linux@roeck-us.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240312170309.2546362-1-linux@roeck-us.net> References: <20240312170309.2546362-1-linux@roeck-us.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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). 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 --- 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)) ); \ -- 2.39.2