From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 43B9CC282DE for ; Thu, 13 Mar 2025 12:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BSxV+VK+Fhon2iChX0AR2rHFOa8RQpYmORoSrz1bLww=; b=irMRrTvp2j2BIq Vj8K6x3+6SkJ5L04GNXauLhF2K6lLvGe6Q6Y5Utcx1eoEgRHM78UWNk/WRBVxLUB85m8Jz7fEj7hS p3i+gVXgTpx1cdjJyRWjIFn2rI38hqOM/sowOiLTqVIIl4W/E7wMTzgY3RadAzcqDQXx8RXfkuMVa EqXZeHyr/UW+4v0RL1cln0L8xFosFLkFm3I1b6RtkErktbuMSHN7S6JvN2OjtBszmhM9CNotVc0jG QXRfyrzL78IqspuNT2YNzyxI0kkOXkzl6de1d3izr76/qJCM0cBtryigATuoPqR7ZeF3I8RaUxuxD dAdtv9DYBSz59HLiVzew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tshIj-0000000BB3O-46lY; Thu, 13 Mar 2025 12:04:37 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tsh0y-0000000B5wk-22iM for linux-riscv@lists.infradead.org; Thu, 13 Mar 2025 11:46:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741866375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EdALik7flTFVSWTVblU8JKKGGV2JCoENkhxrfjNtUxw=; b=TYj6APdLqRfHJjGa8AW9y7qyjO1zHZrjO0+o+NerkLP+toPaBP5Bl3RMTM/t92Jt85vLfv KjiupLqNL+RXa8BqYqB8W2kdWCeT9ySeSHtQ2lYBTVwfR9D/uUSJkp6tz07LN5+s+BPjWd kiNc+icZrFjZ0kBy6BJQHu2AuG+VqVA= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-312-L5TeS7RtP9yBMN7_SLt2_Q-1; Thu, 13 Mar 2025 07:44:52 -0400 X-MC-Unique: L5TeS7RtP9yBMN7_SLt2_Q-1 X-Mimecast-MFC-AGG-ID: L5TeS7RtP9yBMN7_SLt2_Q_1741866292 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-391425471d6so306823f8f.3 for ; Thu, 13 Mar 2025 04:44:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741866291; x=1742471091; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EdALik7flTFVSWTVblU8JKKGGV2JCoENkhxrfjNtUxw=; b=MuWAPd+iWYJJdeMEwGNPCJUvKi5tMODpEmSxrzgeNANdLuvBuZwlSjebNFnlQxtFo9 qo5GSpgvzT9N00+XquHD7EzXB+6xL17xL6YNr9zMQS3Z5tWxrLrogwqyQeLtSu5uXPKn 2hfL5AM0VFrVx9IMIfEkzb7SsptvNnxwV+gYNsui7nFDLjQBgZNhE/Xwcz2x9/LD/6LL Air0rYnVDoef4Sk3QfR6VDRd+kE/HCUeotFYByZvOHkRHDH05ONPNiXP/9toblpzUbW7 izfX6NPrOedRFOxdsmfoa7iT0ezOsEhnBBeSkjJpvE7q52Eb8GSytDaenbrGESpG6Dxi JfzQ== X-Forwarded-Encrypted: i=1; AJvYcCXu3jMRWTn8xRflLEnxiqu7tWCIZpvnkWs/s53dlVvqkyPVNUnBVIAdmQhXaTashchAPwMdTKUqjgwRjQ==@lists.infradead.org X-Gm-Message-State: AOJu0YxHCpTILnikSdlEFTi9/KW+dXJlN5rXQN0q8YpzMWnY414sHmzQ NVr1TjHaK7UyrCCf5/G+tHJkCwg60KtDHWsSea1AT/B/Rj9jHxTDQEvrjgl8mXEepe+pPxZKuPc z3uxLK0jwRSldqPWzxwU6vZVx0Cg07z3RW8x2NQ2gZ/AlF4e/07PGxQMkb/nOZfkcKA== X-Gm-Gg: ASbGncvzEQUkgiP0eoBGNiNrrBKFvCuH5z5WVZRHCcJP8DRrgxoOes2TqDaoTTGynKu +EntvDJYhc6ZANOY0RsmdfL+xgDNsvihJPESHfrCYCowsNvz5nH8LzzgE+VpAn9AiXJogTTKE73 j3VLypLzQw+kyBvBrCusv6ZzjTzOqQa78HEEeKnMkZK5OwSSopimRyU5wt4RdXLJ/nYv1ps2/hu JDpZcRJ7os0TyjHJ15e8wsgdtLtXxpJJzb1nwq1vizquLcKwbhpCoB7vB6Wve8VwklFOZAyy/X0 iwPraQQhA4XSAOvgcmpI X-Received: by 2002:a5d:64a4:0:b0:391:a74:d7dc with SMTP id ffacd0b85a97d-39132db7543mr19148436f8f.50.1741866291559; Thu, 13 Mar 2025 04:44:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFc68icOs2UFLsGvYM02K+KaAXrxdUkEYYl5CYIXnV4BsTbvYwzMB6bzWlvY18H1nYSqaV5qQ== X-Received: by 2002:a5d:64a4:0:b0:391:a74:d7dc with SMTP id ffacd0b85a97d-39132db7543mr19148405f8f.50.1741866291178; Thu, 13 Mar 2025 04:44:51 -0700 (PDT) Received: from lab.hqhome163.com ([81.57.75.210]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-43d188b754asm17844115e9.14.2025.03.13.04.44.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 04:44:50 -0700 (PDT) From: Alessandro Carminati 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 , Guenter Roeck , Alessandro Carminati , Jani Nikula , 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, x86@kernel.org, Linux Kernel Functional Testing , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Alessandro Carminati Subject: [PATCH v4 10/14] s390: Add support for suppressing warning backtraces Date: Thu, 13 Mar 2025 11:43:25 +0000 Message-Id: <20250313114329.284104-11-acarmina@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250313114329.284104-1-acarmina@redhat.com> References: <20250313114329.284104-1-acarmina@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 6WC_mYOyGWf9qEUQBTkt8LfrBVkgGFnFvPQ77MsWJZY_1741866292 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250313_044616_620410_D3A1248C X-CRM114-Status: GOOD ( 11.26 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Guenter Roeck 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 Acked-by: Dan Carpenter Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Signed-off-by: Guenter Roeck Signed-off-by: Alessandro Carminati --- 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__ +#else +# define __BUG_FUNC_PTR +# define __BUG_FUNC NULL +#endif /* CONFIG_KUNIT_SUPPRESS_BACKTRACE */ + #define __EMIT_BUG(x) do { \ asm_inline volatile( \ "0: mc 0,0\n" \ @@ -17,10 +26,12 @@ ".section __bug_table,\"aw\"\n" \ "2: .long 0b-.\n" \ " .long 1b-.\n" \ - " .short %0,%1\n" \ - " .org 2b+%2\n" \ + __BUG_FUNC_PTR \ + " .short %1,%2\n" \ + " .org 2b+%3\n" \ ".previous\n" \ - : : "i" (__LINE__), \ + : : "i" (__BUG_FUNC), \ + "i" (__LINE__), \ "i" (x), \ "i" (sizeof(struct bug_entry))); \ } while (0) -- 2.34.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv