From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 2635F1B950 for ; Wed, 26 Jun 2024 08:00:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719388851; cv=none; b=FhV8NILDaZpq+8MOjf0RKJTbq/q02YnY7ffr3Sxz1vinwZ5FyRmvWd/rEyeQcQj+2uzE9ifnvZCHDkNOtrcdJQVSdV52+S2lOVCcccHF7b46+Y5Onu/B43hY/6/5IErPeRBBPPOTHFmsMXdl1fIEbix73EDKlBBna2myLrgKlaE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719388851; c=relaxed/simple; bh=x3JWCReIk4L301ENiFVZf4/DH2qQaKuD3zTUasYkt80=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BwWGDsQIQGRS5L6VOhCD3A3QgoBkMPFRm2UK/I2RR9FQFgHEPC9SpzfibuyDSIj2Xw/JS0HVMo0dcgMEzAlDy9SjLySUng3Gln9IqxRs0ksHVp+hBgxrFqWRM0B4S5/G7082rBQTiZy6UyAOTWSj4SvHQ1Cz6W/9Zd5OcY2YRys= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=WrSyL8/5; arc=none smtp.client-ip=209.85.208.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="WrSyL8/5" Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2ed5ac077f5so5402191fa.1 for ; Wed, 26 Jun 2024 01:00:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1719388846; x=1719993646; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=whiJiQULxxjVU5JYMGY4dR9TuAgnrWcS7amyjh3Lhhk=; b=WrSyL8/51FJa9TdHwiZlPjdEXN2CvIvMagsgSlIQyVt9dLdE9desicy6T6X9Y7VNs1 Ob5Vv+nJLgH3FAGj6NC7iSPRrSAK/CLbCGKDfyh8TA2MeJT4KYwl3PZF+sObbWtKgZ9c /szY44OyuzEqPMcv2EBTARrknZgqYGkRX+rs16WE39Ju/3V9GC1GJ6dptepw5P2xm0fQ Xhp6C2o2jfpNAu+XSNztbBAJ1x7PyYK8smQ9iQcX3WWK6T2MDStTGd/JVtfuAMpUQUnk PFMvAiXSqXB8R6YTg2q+F06r1Z02nWfjPeCHlYPLuhudmi/aDPOCtirDrJMfdZsqS0X2 mM9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719388846; x=1719993646; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=whiJiQULxxjVU5JYMGY4dR9TuAgnrWcS7amyjh3Lhhk=; b=eKoPEZaxVN7aBnBxHC5X4OcsoCqiTO3ykeFu+QpscgPFbtEwRit+nhehDLudldMRRN j8xPe/LtAoh+QSRkM+sOibCJTxEnDO8jD9XLlWHrmgxmPXgEMy2TR6nsgOlVmc1bG8Xt 1Um8k7mhXck2k4nueYZexMVeXbHO1q0ivNCABaWnP9sAAAO4O+gUALBimbqaebttuA18 eX4cUBZPwxgb54Ke6nofVBvpN+JakAqLBYNw2wVjSMzmdiUu4wW7n3eBXS+Anos4jc9Q azbyU3jsf4pX16SL/WiZZembT1XFAqXfzTGh9n9FDwnYdF8vsTQo7/5600Jz66WBTphn kweg== X-Forwarded-Encrypted: i=1; AJvYcCWQDiqtxWlsx7VzOD0T8dA1yE7oyxtUL91letTIboLn54twvKVWBe3Mg6I1naUKKM5DT96CEkKmXKky8YIChpJSpwffdM5MW8RsU6Q469bZ X-Gm-Message-State: AOJu0Yy9uY/HMHrRCEvNIQ5pQtQg4eBJHVyKVBQE441GHa6wrPIQMjIQ WtK7D/gignEsagfwnQXnnumCs3S9SewmFeFmMSXOqR5zC+ZJv9ga3hBYHUDZXbg= X-Google-Smtp-Source: AGHT+IFNePKBHG9JpceEuNMrhp5ms+q4nwziDYVudYAAE2EIYWBHCuZo7vzBBRTi5aESxDL6rd8szA== X-Received: by 2002:a2e:3a13:0:b0:2ec:5019:bec3 with SMTP id 38308e7fff4ca-2ec593e0cd9mr61741411fa.21.1719388846249; Wed, 26 Jun 2024 01:00:46 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.50]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70676a2113csm6032019b3a.214.2024.06.26.01.00.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 01:00:45 -0700 (PDT) Date: Wed, 26 Jun 2024 10:00:23 +0200 From: Petr Mladek To: Jocelyn Falempe Cc: Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Naveen N. Rao" , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Kees Cook , Tony Luck , "Guilherme G. Piccoli" , Steven Rostedt , John Ogness , Sergey Senozhatsky , Andrew Morton , Jani Nikula , Greg Kroah-Hartman , Kefeng Wang , Thomas Gleixner , Uros Bizjak , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-hyperv@vger.kernel.org, linux-mtd@lists.infradead.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] printk: Add a short description string to kmsg_dump() Message-ID: References: <20240625123954.211184-1-jfalempe@redhat.com> Precedence: bulk X-Mailing-List: linux-hardening@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240625123954.211184-1-jfalempe@redhat.com> On Tue 2024-06-25 14:39:29, Jocelyn Falempe wrote: > kmsg_dump doesn't forward the panic reason string to the kmsg_dumper > callback. > This patch adds a new parameter "const char *desc" to the kmsg_dumper > dump() callback, and update all drivers that are using it. > > To avoid updating all kmsg_dump() call, it adds a kmsg_dump_desc() > function and a macro for backward compatibility. > > I've written this for drm_panic, but it can be useful for other > kmsg_dumper. > It allows to see the panic reason, like "sysrq triggered crash" > or "VFS: Unable to mount root fs on xxxx" on the drm panic screen. > > Signed-off-by: Jocelyn Falempe > --- > arch/powerpc/kernel/nvram_64.c | 3 ++- > arch/powerpc/platforms/powernv/opal-kmsg.c | 3 ++- > drivers/gpu/drm/drm_panic.c | 3 ++- > drivers/hv/hv_common.c | 3 ++- > drivers/mtd/mtdoops.c | 3 ++- > fs/pstore/platform.c | 3 ++- > include/linux/kmsg_dump.h | 13 ++++++++++--- > kernel/panic.c | 2 +- > kernel/printk/printk.c | 8 +++++--- > 9 files changed, 28 insertions(+), 13 deletions(-) The parameter is added into all dumpers. I guess that it would be used only drm_panic() because it is graphics and might be "fancy". The others simply dump the log buffer and the reason is in the dumped log as well. Anyway, the passed buffer is static. Alternative solution would be to make it global and export it like, for example, panic_cpu. Best Regards, Petr 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 51455C27C4F for ; Wed, 26 Jun 2024 08:00:55 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sPOfZ6BTTdwGYVA/MVgDSTTKkMQ+SZuhTWZqJw7l42U=; b=suRujpLv027o9B Ci4AosiDtTr4mjTo0x0vrF0nRGa8af00HlRxZ0rG/YB3on/xfiLOfPTZhE9bmOxUbEjnjcgQm3xSi AgIQzyFTXvZ1wFyXY+hWrVePmfz6b2YiFLJZWnzYITASFK2kdzIgQ24JYqHVgTr7dtafO/HkOCGDJ DqTnTlDIHFzA4eHJ9cRwHlg2Hj8Ig7rlowsqASBAwEAwzvDKcZZZXB0o7fWHCi0UGC+s33vNqYoA9 biHShs37qXnQg0hG741LQghG3PXY8bow8ilL3EEPsEeX53oxz9k5YFQ0r5opZjpdYl75Ggb89vjmv lwhEIqUXUy3pQkfX53Xg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMNaG-00000005q5Y-3lm6; Wed, 26 Jun 2024 08:00:52 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMNaD-00000005q32-1Fco for linux-mtd@lists.infradead.org; Wed, 26 Jun 2024 08:00:50 +0000 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2ec0f3b9cfeso76152031fa.0 for ; Wed, 26 Jun 2024 01:00:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1719388846; x=1719993646; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=whiJiQULxxjVU5JYMGY4dR9TuAgnrWcS7amyjh3Lhhk=; b=GS4ny46V7dXpctmlfAKZGcxldwhtdDpTaKyQpxLJZIU9N68NtMTwhIvZPgp7idcCAP Nbnw/Ms4JI4T0IizpX930+WrqWqVajVKPhc1orj+2HONH0Ln/JetkYYPEXmGUYedJf2+ aL5mS95pC5TqsUP0URCiVbXlSNtFwhMku8NhnmALSe98+Qw0qm6pX0CzQEuSyo509XSq 9diE6S5wjXZmH1itmP8RURi0NiNwvId47N4IEuKOqikm8m8yRnBchbMlB40mehqG9Zys lV83U8Bx2fOnbkJL6swtuWY1wcX21qxtqKKQDwAj7LYxS1qc7iysA45Aiad0mwqdq40E as7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719388846; x=1719993646; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=whiJiQULxxjVU5JYMGY4dR9TuAgnrWcS7amyjh3Lhhk=; b=CWGKojt7ww3zd7hQLuxPQmEm4JAsByE3RybzT/EbDoHC024som7LwFSiRhwFg+m7m7 7/gj7cxwfQjAvMC5G1k5ZEIe0gazfhNmq5cDcVQhWB09NKUi6f41YnSLB6/AAmeBOTqU BV2Z6sqZehpH0f0KPBylFHil9monuA+E1xwzWgXwzptSupZovCBO/2HbfYZkvCXc6UZ1 XuimwB0265rIsQPzINhQEMbX4u5yQenPruQZIIw9rHEDb8YtjWPXMWVyoIk2xkTUjg8d 79QZ15C9RoTQXKKc7eSk7VggBD+1yB5HEOBBYsbDr7ZNV49nkthQmztWh3MDiqE/P65a P1/w== X-Forwarded-Encrypted: i=1; AJvYcCXfYPS4Fbx7qMm+rymhHzsFlHTdyZeVBtwTC1/OieBp2M2+9hRTVWFq6Nlzeow5JpY2LMhtfHsfjCLvJFbsS3dUM/CsAq3tvkMZIJVPeA== X-Gm-Message-State: AOJu0YzGymePzYapprSnvnPlNpt3hk5sgvRN0GFrlPkAce9o7cUZSeUO S8lumsYCf4g/6tA33vVhcyqNP7ouvun/rgCdZjxPxil6lQa7wgNUnvrSumyuBq0= X-Google-Smtp-Source: AGHT+IFNePKBHG9JpceEuNMrhp5ms+q4nwziDYVudYAAE2EIYWBHCuZo7vzBBRTi5aESxDL6rd8szA== X-Received: by 2002:a2e:3a13:0:b0:2ec:5019:bec3 with SMTP id 38308e7fff4ca-2ec593e0cd9mr61741411fa.21.1719388846249; Wed, 26 Jun 2024 01:00:46 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.50]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70676a2113csm6032019b3a.214.2024.06.26.01.00.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 01:00:45 -0700 (PDT) Date: Wed, 26 Jun 2024 10:00:23 +0200 From: Petr Mladek To: Jocelyn Falempe Cc: Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Naveen N. Rao" , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Kees Cook , Tony Luck , "Guilherme G. Piccoli" , Steven Rostedt , John Ogness , Sergey Senozhatsky , Andrew Morton , Jani Nikula , Greg Kroah-Hartman , Kefeng Wang , Thomas Gleixner , Uros Bizjak , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-hyperv@vger.kernel.org, linux-mtd@lists.infradead.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] printk: Add a short description string to kmsg_dump() Message-ID: References: <20240625123954.211184-1-jfalempe@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240625123954.211184-1-jfalempe@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240626_010049_365408_A99A7410 X-CRM114-Status: GOOD ( 20.66 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Tue 2024-06-25 14:39:29, Jocelyn Falempe wrote: > kmsg_dump doesn't forward the panic reason string to the kmsg_dumper > callback. > This patch adds a new parameter "const char *desc" to the kmsg_dumper > dump() callback, and update all drivers that are using it. > > To avoid updating all kmsg_dump() call, it adds a kmsg_dump_desc() > function and a macro for backward compatibility. > > I've written this for drm_panic, but it can be useful for other > kmsg_dumper. > It allows to see the panic reason, like "sysrq triggered crash" > or "VFS: Unable to mount root fs on xxxx" on the drm panic screen. > > Signed-off-by: Jocelyn Falempe > --- > arch/powerpc/kernel/nvram_64.c | 3 ++- > arch/powerpc/platforms/powernv/opal-kmsg.c | 3 ++- > drivers/gpu/drm/drm_panic.c | 3 ++- > drivers/hv/hv_common.c | 3 ++- > drivers/mtd/mtdoops.c | 3 ++- > fs/pstore/platform.c | 3 ++- > include/linux/kmsg_dump.h | 13 ++++++++++--- > kernel/panic.c | 2 +- > kernel/printk/printk.c | 8 +++++--- > 9 files changed, 28 insertions(+), 13 deletions(-) The parameter is added into all dumpers. I guess that it would be used only drm_panic() because it is graphics and might be "fancy". The others simply dump the log buffer and the reason is in the dumped log as well. Anyway, the passed buffer is static. Alternative solution would be to make it global and export it like, for example, panic_cpu. Best Regards, Petr ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ 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 3A6B4C30653 for ; Wed, 26 Jun 2024 08:01:42 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=ag8ok4Yf; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4W8Dg755Z2z3cFw for ; Wed, 26 Jun 2024 18:01:39 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=ag8ok4Yf; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=permerror (SPF Permanent Error: Too many DNS lookups) smtp.mailfrom=suse.com (client-ip=2a00:1450:4864:20::22a; helo=mail-lj1-x22a.google.com; envelope-from=pmladek@suse.com; receiver=lists.ozlabs.org) Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) (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 4W8DfL03Fyz30fM for ; Wed, 26 Jun 2024 18:00:54 +1000 (AEST) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2ec0f3b9cfeso76152061fa.0 for ; Wed, 26 Jun 2024 01:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1719388846; x=1719993646; darn=lists.ozlabs.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=whiJiQULxxjVU5JYMGY4dR9TuAgnrWcS7amyjh3Lhhk=; b=ag8ok4YfDavjQMlNmKRTS+sBpQ/qrkTH+eO5UIlYsfM2bnM8w+A5x7XHPTsVDVeAGh H5QDSY7QOXapD0c88dSze7PQwDhGXhCO063+L0+aPeXlyNpOw48KpFeAiQYbtpoUbSEl JeubkqZs09e3tm/dUAn21wsSX4fv0f1x8HJjbX+BP+HSZV094dGqMe9mggHQKCBv1g/E BvC0kbCM/T/O6aDUiwe1qNDoVpGd26M2S4btk4TUVSFhfRpMonv5lTStYa4mA4uplnnV W0wKmjNg5joLRex27A6tT5jAnHxl2Fb1NxrrEwjQ5FBHE1u14wpdogNoVvklhT1BhPXD pwPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719388846; x=1719993646; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=whiJiQULxxjVU5JYMGY4dR9TuAgnrWcS7amyjh3Lhhk=; b=cajtJRqbm1lpjd7QPUxy50zc806tuZqUQ0uTHxszqFlA0i0LqFhbbRid6EYU5s56D0 5a4euwDI1Dj/xLTkVyJ7uG6Ubw/gQly5WCx/sVnx2yhcIJ5k+JFs5W787FI2Y1sP6f6a XzTRkLz3pETOIZ3JkI9h8hjuoTp7//hYU3HYz6DX1lTWfY0sxc0llJ4TsTBWqXBWeT0r K0Jn3u0GQlBOzO+HVzrykvAHTk/uWUspQdEmL7iUgo21QhPvnWJwjsGdnOdDksa6yhmY zBsi6ysLvuSerUiyCH31xy6/uE8ODl2xUglg92bR6/yzCqjEIlwGY/3A1Hnw+IWL8wWg 5jxA== X-Forwarded-Encrypted: i=1; AJvYcCXnHoetOfbq60dMgi3aPpKIpo7ULYea9+xVgyaI1IEmnMlMFzI5PE2wnNS57NiIcS/Cr8MfLO+oO7ISXPatPEUTslZnYNRUmdqLJm/+xw== X-Gm-Message-State: AOJu0YwYB6hmqEoR9hAuJ7eU3EiH7yyjGy4EK5+haIx+OFBZcChwIxw6 /vzMuMCSapC0A/2j8VKhQsQAvymenyecZ6RDmU1Trhq5dzvXrx0R5mTPa5Ld2U0= X-Google-Smtp-Source: AGHT+IFNePKBHG9JpceEuNMrhp5ms+q4nwziDYVudYAAE2EIYWBHCuZo7vzBBRTi5aESxDL6rd8szA== X-Received: by 2002:a2e:3a13:0:b0:2ec:5019:bec3 with SMTP id 38308e7fff4ca-2ec593e0cd9mr61741411fa.21.1719388846249; Wed, 26 Jun 2024 01:00:46 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.50]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70676a2113csm6032019b3a.214.2024.06.26.01.00.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 01:00:45 -0700 (PDT) Date: Wed, 26 Jun 2024 10:00:23 +0200 From: Petr Mladek To: Jocelyn Falempe Subject: Re: [PATCH] printk: Add a short description string to kmsg_dump() Message-ID: References: <20240625123954.211184-1-jfalempe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240625123954.211184-1-jfalempe@redhat.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kefeng Wang , Vignesh Raghavendra , Kees Cook , Uros Bizjak , linux-hyperv@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mtd@lists.infradead.org, linux-hardening@vger.kernel.org, Miquel Raynal , "K. Y. Srinivasan" , David Airlie , Wei Liu , Sergey Senozhatsky , Dexuan Cui , Christophe Leroy , "Naveen N. Rao" , Thomas Zimmermann , John Ogness , Jani Nikula , Haiyang Zhang , Maarten Lankhorst , Maxime Ripard , Steven Rostedt , Thomas Gleixner , Tony Luck , Greg Kroah-Hartman , Nicholas Piggin , linux-kernel@vger.kernel.org, "Guilherme G. Piccoli" , Daniel Vetter , Richard Weinberger , Andrew Morton , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue 2024-06-25 14:39:29, Jocelyn Falempe wrote: > kmsg_dump doesn't forward the panic reason string to the kmsg_dumper > callback. > This patch adds a new parameter "const char *desc" to the kmsg_dumper > dump() callback, and update all drivers that are using it. > > To avoid updating all kmsg_dump() call, it adds a kmsg_dump_desc() > function and a macro for backward compatibility. > > I've written this for drm_panic, but it can be useful for other > kmsg_dumper. > It allows to see the panic reason, like "sysrq triggered crash" > or "VFS: Unable to mount root fs on xxxx" on the drm panic screen. > > Signed-off-by: Jocelyn Falempe > --- > arch/powerpc/kernel/nvram_64.c | 3 ++- > arch/powerpc/platforms/powernv/opal-kmsg.c | 3 ++- > drivers/gpu/drm/drm_panic.c | 3 ++- > drivers/hv/hv_common.c | 3 ++- > drivers/mtd/mtdoops.c | 3 ++- > fs/pstore/platform.c | 3 ++- > include/linux/kmsg_dump.h | 13 ++++++++++--- > kernel/panic.c | 2 +- > kernel/printk/printk.c | 8 +++++--- > 9 files changed, 28 insertions(+), 13 deletions(-) The parameter is added into all dumpers. I guess that it would be used only drm_panic() because it is graphics and might be "fancy". The others simply dump the log buffer and the reason is in the dumped log as well. Anyway, the passed buffer is static. Alternative solution would be to make it global and export it like, for example, panic_cpu. Best Regards, Petr