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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 F2403C35FF1 for ; Thu, 13 Mar 2025 20:01:38 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4ZDJKp3zj7z3cV6; Fri, 14 Mar 2025 07:01:34 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1741866296; cv=none; b=PCVDynD1tQWBsfYrtvYrcGkMSyar9Ufbd/doa8aJ1rLSwMbS4xIr9S7Iy7RCQQ52AU/aI4CmTjg5mELkUwv3oIUdTWR8Vo4K7qB0iJy4fsq2GhsyW/9dEK9vpcuU1MqhTVAkM9jxOW76HawzO2hetNklSJykSD3As1e/Fa5q+v3Ak2vK+jKElYCm/bikVqvMHaK5Xc8pSld245scndgt3jS66GlNVMZWeE7UPNpQY9x3vm3BqlOBf9L+jQPsuv6cvaqu4LcOqgLnZQK1MiyxdENVu/2s0zl/8/b11ws7NmZ0cPZ8WN0vlXvDba5FW300fJrdT1oeFtM/BEHYFelPRw== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1741866296; c=relaxed/relaxed; bh=oNDdusV5kHSN69Wnsdcb+ESaCAhVWZZ95i0rdnVfZIo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-type; b=R0cXGc8sqy8mCwRypXksVYDUhLSU43hgnGo8qFy9dEiUqHkaCzoi3ZLp08TNXn831C/f+qNt4eFZ2A6cxNcDUFbhemqyrT17VCnRAjZK+cv0NpKuo2px6NXLo9xrDwg8ohOBlpIjXwRTnCoT8o+vtUFKVOMjagw/6pK5FwGbFwEEUvyIl7/nUjIACZyYrdYZBPLwmGuPkt3D5+Qm63Xnny/vMJpfUCfxwhva5mNCHDqNT3o2r4tIcZbFYxwXlMbs4F3ai3iSYGsgFiDCeQjDZX7EZ9Dj/d+99h0qQzg5bzvNAS5Ewln3IUrxZGNDARJ3W6PWXkhaQ97L4vMfj2ssug== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=UhzjzNNl; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AlxoX2DI; dkim-atps=neutral; spf=pass (client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=acarmina@redhat.com; receiver=lists.ozlabs.org) smtp.mailfrom=redhat.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=UhzjzNNl; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AlxoX2DI; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=acarmina@redhat.com; receiver=lists.ozlabs.org) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4ZD5Jl2DJGz2ynL for ; Thu, 13 Mar 2025 22:44:55 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741866291; 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=oNDdusV5kHSN69Wnsdcb+ESaCAhVWZZ95i0rdnVfZIo=; b=UhzjzNNlkWyKPCBgU3I7/myJZoQ/R4kROmu9b//6VZraxGHS6AhCciyKggGA20l9g79beY /xN8afHGR2yKYsqfLHEPA6onEHo9pa4tQ+hX7qqJ3Dio5eLOFE4Ub50RFbZn6WGIw3y3Kn C5jd4tTbTY0BapeU8xCd7KkGyqRY4C4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741866292; 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=oNDdusV5kHSN69Wnsdcb+ESaCAhVWZZ95i0rdnVfZIo=; b=AlxoX2DI8jfL8OdV/Mj9lXXImOquR9Y7d96KgUA5r2p5KooxwGK6jULtE/qbvMjQubtV+T wmAJGrItqXp/hY71RfwhddqxcEFkWJIcezbVv5iAWjRnge35IkbPtryGuob42nNremPJJA TFPvpfnkI+ksnd2bvt7BDTbLIQsO9+o= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-637-IaMTluXNNvuxF87A8MdMZw-1; Thu, 13 Mar 2025 07:44:50 -0400 X-MC-Unique: IaMTluXNNvuxF87A8MdMZw-1 X-Mimecast-MFC-AGG-ID: IaMTluXNNvuxF87A8MdMZw_1741866289 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-391459c0395so372295f8f.2 for ; Thu, 13 Mar 2025 04:44:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741866289; x=1742471089; 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=oNDdusV5kHSN69Wnsdcb+ESaCAhVWZZ95i0rdnVfZIo=; b=e2IwZFMZz1nUh8eFsb6kzfALB5EBKgzbadF/Fuo+FK0/RRZFaaSvQB/A9EYVBVG5bW lydQE/j7ccrO1Z2gol3lyl7wDCk0+gdE+RK55YhxvzCyamsSzfbS/NuKpfdddtAjiqS7 Pj9FwCjFX9ZDtfKKVXsV8CTg2jjLaLeQvt1DgAgFKzIbGxa6aq1pnlfijW5QjBLUyZcI z6l3yI5rdmOx7gF0X3n9nGvlc7H6ZsxEBC02P7KKbSzO8nc/svOk18tPrZoRPUdCicFC UlGAx/rczismGLolaWhlobRrq9XIpxKfz+bnc5FmsDmDeS6OMYi/WaGJ5loUbPo/81Ps qU5A== X-Forwarded-Encrypted: i=1; AJvYcCXDWK0XUlLTOCUPaFhxA3YITS2UIVcDdOjW9F4+UZM2h7cNVxbRyO1eOsMP5P75ckpVgrtFU4+1yOkJAQg=@lists.ozlabs.org X-Gm-Message-State: AOJu0YzL1jgsdfOGroQr1t44jXjfK1IZelyNOMemROgbDwSteMZ29rGR 8bKUcK6KQzJFGx7lzQu9SXAm1hgWcWUetprfUr6mO3xOoQBJD53P+ttekE2tTorLhGBqSE7TehX G9NoET8/PSCIWOa1TQn0upw66Wx32/qokxCf1IoLAUMhvysNb6IH4779EbvY5uVo= X-Gm-Gg: ASbGncuWhDzGpW6ziR3Q8E0nlFb3Usgad3TnVdDIo9zqJQMCntDLb145DloEZDDYMVD /Ctpa3PSsoA8zUyG5mYCdMZQdG3WNS26gxWlyaMD8GklDpOFBlTHTSaAeHn6Xkii22/yqMZvOzX 9zHQ9EBzgTc3MJXfsWLE15Ywdvfbg0UXfFGobpav5Y6ey39VwYYvWMs+0sfK/J/hSG1OftdCRyI 6EZqlsBsJFzvIi0H024//DdvEPZzjZgXYSdHlSs2H0OqzDg0avzt7f1F+bF68DkUBSjhMZstttX /yYHjyo0MlFvncdp2fYd X-Received: by 2002:a5d:6daa:0:b0:390:fbba:e64b with SMTP id ffacd0b85a97d-39132d8afb7mr18596837f8f.31.1741866289404; Thu, 13 Mar 2025 04:44:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGYwocEA7kYpHNOe02FWF9uxS8M3FuzRDEqfu4GtiOXX78+oDlT7RdxLzaiu9BpsPlw7lldzQ== X-Received: by 2002:a5d:6daa:0:b0:390:fbba:e64b with SMTP id ffacd0b85a97d-39132d8afb7mr18596786f8f.31.1741866289052; Thu, 13 Mar 2025 04:44:49 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Mar 2025 04:44:48 -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 , Helge Deller , Alessandro Carminati Subject: [PATCH v4 09/14] parisc: Add support for suppressing warning backtraces Date: Thu, 13 Mar 2025 11:43:24 +0000 Message-Id: <20250313114329.284104-10-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> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 1_jgj7OamAU_rCRuGohDm25tiGHHHvzW15gczRDPLJs_1741866289 X-Mimecast-Originator: redhat.com Content-type: text/plain Content-Transfer-Encoding: 8bit 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). While at it, declare assembler parameters as constants where possible. Refine .blockz instructions to calculate the necessary padding instead of using fixed values. Tested-by: Linux Kernel Functional Testing Acked-by: Dan Carpenter Acked-by: Helge Deller Signed-off-by: Guenter Roeck Signed-off-by: Alessandro Carminati --- 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..b59c3f7380bf 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 + +#ifdef CONFIG_KUNIT_SUPPRESS_BACKTRACE +# 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 /* CONFIG_KUNIT_SUPPRESS_BACKTRACE */ + #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.34.1