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 2422F5B1E8 for ; Wed, 3 Jul 2024 08:22:30 +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=1719994954; cv=none; b=S/yKAAxioEcObpP9s6CnFKsiYil0sM46UUrnZRV8gJaktO/sGpLrI7eNffaGsTiL6cC/Oj5EThHdFX3ddHw2dJPhg9eWnAaAmDWeXv5l2bHIcSajb+I+UUj7/ZvmtEy50EPoYGGMl4FPCwIiHdCNzfMkEhx+TJKunMX3pvI9pc0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719994954; c=relaxed/simple; bh=krucwHfZgcKYkNzvalwXTEzmuibTJbKcB/Iz0w38Tuw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aYWLm/6nIUYcqegptNgbg/G9BfFv9ngrhn0DwQgGQtFvaHCT/7gvr3fythGahogxh2s0ob8MJhLVqVWCtL6Fdghp1nnPhmSYBTHRlFKeKsWlxBwqeXprBEnRfpEGXYHPk9ryj4yLfcfHINucLfRLQ6PoV4LqBeSo6xpQ65LbOXw= 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=ZdHdlV5y; 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="ZdHdlV5y" Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2ee794ebffbso20305591fa.1 for ; Wed, 03 Jul 2024 01:22:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1719994949; x=1720599749; 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=TMQqT/Muz0iwxmBm/vQkZCAi7Byb2pCrA2WM9iHg1No=; b=ZdHdlV5yriZV5W2z0XZDrHuTq3pD9AFqc5tdA7R73oflre9CglUW5FnedqIcA9uSpG RZwf953EmV7IVt/uTuBUJO+zV1/ahsAwjdnBQ+w2FEs7IE9UWtQSDBq+l3wE4bypCg+c WI+LlQS8tE7i9IiOdlG5Znkg/lnEJRnT/BUuPFrVzFLvQP5iPzgf6xLMVwKV5ih0ti38 m5P2HxBECQN+OZHI0i0BXRnfC/O2xSL6prJhXn6kAEZB5/SHAx6UhUca1dJIDghDMU7f JOVSWWz01zDNwBPJ/9gTtYvUriuTEsggyAjJgeG6zagQoGDxAjbVIeW6kqmssI2Apb+E ZpBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719994949; x=1720599749; 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=TMQqT/Muz0iwxmBm/vQkZCAi7Byb2pCrA2WM9iHg1No=; b=uVERXMgqf1uHUujdwwANbbh/70iwjW4y8vP99wAsCe2ubrV0iNheBqtRP55hujkp/f r3jCaOK43oAptsZuBVQ62C03ndjK0jPprxzDu404wWP0ErzcfnmrPIfoyAx+EM+JTItZ QNdfWDVOsxJa5XJRIUw3qKOQT86UVXLuC9t2K05AcCNSvdy49AyPkNgJHMop1vNexEPD hCxzHne0JZWSNRBtrvMw4BOEPNqqAIiQWsVDDm6BMasI4SdQuT3U0mmR33yH3fvLZQog c+rRov0ik93ALVPYhDxXihtN2dZ/b9CFP+/XbPVntDR466DKs9TKI86S+EtQ7p/RSuve y27Q== X-Forwarded-Encrypted: i=1; AJvYcCVeOH38/CSH89tJ4/h/OhdiTo4WAdUb+RmW2ly91VjgaRhOIFxkZMURWaXDj2PdA6e1ZrCdEb3K5l8sBye7vPYkAZJAiIKT8/DsQBzj/ZeM X-Gm-Message-State: AOJu0Yx2d+dbRDVZS3jwbPcPqetUiiVq5J8+bmx0HDOdWsGQLJ3jqG2Y w/Nn4xVS7QAvmah4gJebshRNBdD/qmMzsoTaolznIiJKq97Vo2CKoZ0Wqb767Aw= X-Google-Smtp-Source: AGHT+IGgmL2y9QM4c4g0Wf6Xz0uaCMi9coDigbGLy4p0by/hZmKG4KPflaiBbCeCe+DcbaFV7kidJA== X-Received: by 2002:a2e:bc88:0:b0:2ee:7a54:3b14 with SMTP id 38308e7fff4ca-2ee7a543b8dmr26465461fa.7.1719994949278; Wed, 03 Jul 2024 01:22:29 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.50]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70802959d41sm10094847b3a.96.2024.07.03.01.22.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 01:22:28 -0700 (PDT) Date: Wed, 3 Jul 2024 10:22:11 +0200 From: Petr Mladek To: Jocelyn Falempe Cc: Kees Cook , 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 , 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 v2] printk: Add a short description string to kmsg_dump() Message-ID: References: <20240702122639.248110-1-jfalempe@redhat.com> <202407021326.E75B8EA@keescook> <10ea2ea1-e692-443e-8b48-ce9884e8b942@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: <10ea2ea1-e692-443e-8b48-ce9884e8b942@redhat.com> On Wed 2024-07-03 09:57:26, Jocelyn Falempe wrote: > > > On 02/07/2024 22:29, Kees Cook wrote: > > On Tue, Jul 02, 2024 at 02:26:04PM +0200, Jocelyn Falempe wrote: > > > kmsg_dump doesn't forward the panic reason string to the kmsg_dumper > > > callback. > > > This patch adds a new struct kmsg_dump_detail, that will hold the > > > reason and description, and pass it to the dump() callback. > > > > Thanks! I like this much better. :) > > > > > > > > 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. > > > > > > v2: > > > * Use a struct kmsg_dump_detail to hold the reason and description > > > pointer, for more flexibility if we want to add other parameters. > > > (Kees Cook) > > > * Fix powerpc/nvram_64 build, as I didn't update the forward > > > declaration of oops_to_nvram() > > > > The versioning history commonly goes after the "---". > > ok, I was not aware of this. > > > > > [...] > > > diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h > > > index 906521c2329c..65f5a47727bc 100644 > > > --- a/include/linux/kmsg_dump.h > > > +++ b/include/linux/kmsg_dump.h > > > @@ -39,6 +39,17 @@ struct kmsg_dump_iter { > > > u64 next_seq; > > > }; > > > +/** > > > + *struct kmsg_dump_detail - kernel crash detail > > > > Is kern-doc happy with this? I think there is supposed to be a space > > between the "*" and the first word: > > > > /** > > * struct kmsg... > > > > > Good catch, yes there is a space missing. > > I just checked with "make htmldocs", and in fact include/linux/kmsg_dump.h > is not indexed for kernel documentation. > And you can't find the definition of struct kmsg_dumper in the online doc. > https://www.kernel.org/doc/html/latest/search.html?q=kmsg_dumper > > > Otherwise looks good to me! > > > > Thanks. > > As this patch touches different subsystems, do you know on which tree it > should land ? Andrew usually takes patches against kernel/panic.c. Or you could take it via the DRM tree, especially if you already have the code using the string. Also I could take it via the printk tree. The only complication is that I am going to be away the following two weeks and would come back in the middle of the merge window. I do not expect much problems with this change but... 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 DC852C2BD09 for ; Wed, 3 Jul 2024 08:22:36 +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=/4LljJpJRh9QpzkGoI7puzW6KrfqW8KtAN3voF1Nimo=; b=caTr6WkLiZJSNE 57R0dDS1ggvs1pbLvxdglvgaDaRNy47JLRo+tWMjiFRq5p0sF6UXm04zrGdeDGz0PfTmeN1whDEz/ V66i812Xc3oficq3oRBmx1voK47UCbuL9/C7jHDcEto1YN6I9NYGYNTdFrmo3C5adJq1jNeyhV04u pPmovthmnilAPaKx/2r3EBE7zfna958F4XjGE2IMgxdcrdoTCJIvHrMk2jpyTorpOdmuMyhEDVTdK ffekg2IV2Jsxm/4xPHOHI4cAj8EqpUU2QSB2bhY9/XOERsYf4pii4dndoGLEv01ywb04uXuKYXP4r eHonx/XMdXtYex0AH/Bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOvG6-00000009Ppo-0G4Z; Wed, 03 Jul 2024 08:22:34 +0000 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOvG3-00000009Poa-1E8r for linux-mtd@lists.infradead.org; Wed, 03 Jul 2024 08:22:33 +0000 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2eaae2a6dc1so67727311fa.0 for ; Wed, 03 Jul 2024 01:22:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1719994949; x=1720599749; 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=TMQqT/Muz0iwxmBm/vQkZCAi7Byb2pCrA2WM9iHg1No=; b=a0bLBiPTozDqWAuNycFMJXkHUB8rq3YjIt8udc8kesCaRjSbrbAKz5CYntq4eBkUhI D+wKYX7RoP383WqKkQBemKp365JsGRzgp43IqXfOHhfEoGNRbnsewLiL9swya9fzfv9y CXJf5oExXSrBUjPq+CjOPtJbfHF/rHNI23ODarpvLLOSv/p660JmRaJT28OfUz5k27MK In7EIaHSVVVm6XXv1OEIxtmwPyGgblCgPA8yiOQwzm9ICZkOym6Tpt9zdgiphgYwddJ3 68XhTolbWRO0Ni/szk83DiFyFGg0NCxR7/7pkJFBcw2hj+ltzJoZQhZ48G/4JA31oqk4 LQWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719994949; x=1720599749; 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=TMQqT/Muz0iwxmBm/vQkZCAi7Byb2pCrA2WM9iHg1No=; b=wVF5NjWTS5MxMMumuf99EXiovb75eUvUrkki4J1UI/BVSNRCj8Ahokui+6Ydeft4un LiItDUJRU2+2AxTrEm3lzSH99ar8D+vQz8yY/ToE+ZtT/HSSA4H5e3s+psFvUYyoDZt3 n2B4qcAhOxcHsiR20e4kWFZdJzHH54ieSur430DR4kdqTQPyZPiCSIfrFPf/D4ogQw3s RgCU9484t5mEmRQYkfJdkOWVo5/UjrHi5kWoHli2/DOZKplUusWQO2pDrAfVNExfwG22 mdvt1aLX++82ViCDqkCxO0y6EYlZzoErMXaXV7mjE9Yrc7G4rYhfZldlX+vsHzBR5yEJ kMbQ== X-Forwarded-Encrypted: i=1; AJvYcCW1q3QZqw6kBkmZxYqE99NjJO5tL7XNb6TIybLGxpiJ9aKQhlgpTrLraLjpMUPX/bviYmn1FcP4Oxnb96MvXUn9U2hnq2QoAe1u9iHHeQ== X-Gm-Message-State: AOJu0YzsweutwtnJMoDv2RedrOPUL0VNFYLytE7O8N+9Y45vUt4T80LJ BMoyzch/QOEzGYLgEbo+vh1EhER3BvcaZIL/TGcgr6d0x2WdIvI63SOMHLb/Lts= X-Google-Smtp-Source: AGHT+IGgmL2y9QM4c4g0Wf6Xz0uaCMi9coDigbGLy4p0by/hZmKG4KPflaiBbCeCe+DcbaFV7kidJA== X-Received: by 2002:a2e:bc88:0:b0:2ee:7a54:3b14 with SMTP id 38308e7fff4ca-2ee7a543b8dmr26465461fa.7.1719994949278; Wed, 03 Jul 2024 01:22:29 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.50]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70802959d41sm10094847b3a.96.2024.07.03.01.22.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 01:22:28 -0700 (PDT) Date: Wed, 3 Jul 2024 10:22:11 +0200 From: Petr Mladek To: Jocelyn Falempe Cc: Kees Cook , 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 , 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 v2] printk: Add a short description string to kmsg_dump() Message-ID: References: <20240702122639.248110-1-jfalempe@redhat.com> <202407021326.E75B8EA@keescook> <10ea2ea1-e692-443e-8b48-ce9884e8b942@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <10ea2ea1-e692-443e-8b48-ce9884e8b942@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240703_012231_358049_F56D4516 X-CRM114-Status: GOOD ( 35.21 ) 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 Wed 2024-07-03 09:57:26, Jocelyn Falempe wrote: > > > On 02/07/2024 22:29, Kees Cook wrote: > > On Tue, Jul 02, 2024 at 02:26:04PM +0200, Jocelyn Falempe wrote: > > > kmsg_dump doesn't forward the panic reason string to the kmsg_dumper > > > callback. > > > This patch adds a new struct kmsg_dump_detail, that will hold the > > > reason and description, and pass it to the dump() callback. > > > > Thanks! I like this much better. :) > > > > > > > > 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. > > > > > > v2: > > > * Use a struct kmsg_dump_detail to hold the reason and description > > > pointer, for more flexibility if we want to add other parameters. > > > (Kees Cook) > > > * Fix powerpc/nvram_64 build, as I didn't update the forward > > > declaration of oops_to_nvram() > > > > The versioning history commonly goes after the "---". > > ok, I was not aware of this. > > > > > [...] > > > diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h > > > index 906521c2329c..65f5a47727bc 100644 > > > --- a/include/linux/kmsg_dump.h > > > +++ b/include/linux/kmsg_dump.h > > > @@ -39,6 +39,17 @@ struct kmsg_dump_iter { > > > u64 next_seq; > > > }; > > > +/** > > > + *struct kmsg_dump_detail - kernel crash detail > > > > Is kern-doc happy with this? I think there is supposed to be a space > > between the "*" and the first word: > > > > /** > > * struct kmsg... > > > > > Good catch, yes there is a space missing. > > I just checked with "make htmldocs", and in fact include/linux/kmsg_dump.h > is not indexed for kernel documentation. > And you can't find the definition of struct kmsg_dumper in the online doc. > https://www.kernel.org/doc/html/latest/search.html?q=kmsg_dumper > > > Otherwise looks good to me! > > > > Thanks. > > As this patch touches different subsystems, do you know on which tree it > should land ? Andrew usually takes patches against kernel/panic.c. Or you could take it via the DRM tree, especially if you already have the code using the string. Also I could take it via the printk tree. The only complication is that I am going to be away the following two weeks and would come back in the middle of the merge window. I do not expect much problems with this change but... 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 EEFCAC2BD09 for ; Wed, 3 Jul 2024 08:23:23 +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=UM2TWAmm; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4WDXpw4fZYz3cXG for ; Wed, 3 Jul 2024 18:23:20 +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=UM2TWAmm; 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::234; helo=mail-lj1-x234.google.com; envelope-from=pmladek@suse.com; receiver=lists.ozlabs.org) Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) (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 4WDXp13vksz2ysX for ; Wed, 3 Jul 2024 18:22:31 +1000 (AEST) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2ee75ffce77so20545941fa.3 for ; Wed, 03 Jul 2024 01:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1719994949; x=1720599749; 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=TMQqT/Muz0iwxmBm/vQkZCAi7Byb2pCrA2WM9iHg1No=; b=UM2TWAmm+yP1X9wa1Kt8sRhuf7q1zkgZLzF8P8IpEFGY8p8Jav68aJK7HoQkAZLmel lqOeuM9O64zl0x6P/c1dzxiDdBprrVnBjeQaYHBYjsuPB2Ak0vLxvMXYUZtdIRhOZFAD U0DJnLauRhG6Dfl9DG3ivt7R4U5AMWAVKPCFAVTR4HShalCEF6xX6mGL0WPNVGu2NVxP my7S94y264D86Tzk/KSDhsVQo6oOkTB8L3zBWv9tgq8ZOkAYPIjgB5tyBonZ5+qDNwPM 3nREW0oX0al7kvgWMCpnuENJJU4GX330FqAIVE4LgQpNfFvWBgKAZh/j2vYJuPLFFFUG lUGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719994949; x=1720599749; 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=TMQqT/Muz0iwxmBm/vQkZCAi7Byb2pCrA2WM9iHg1No=; b=gaCCN9dVayy62Nll1BBL6pY4n9iAIKMN55iztFEwGx2lIMr669wGnteMxQdobhCP7n A2+bjRB8vKu4FU1qDu0lur7EBxhxN0jiljP/PFo1kGZ+ukrrIsWH/Bck+r/LUOCWC6p9 Z4m5HbQsAo8wBDKkZ5u5O2BdgHCp84TqUR/B68goZi9T0ydDc5Hrn1NFgmhoCqB+tK6R K7hf34gIMCUQf+cTKvekPCSTc7yd2Msoo5fith868PBgW31eppiBf/TDC+Q6Xl+O0oE3 L6H5hFJs+CUU2heKJPIUZAMAhJGjzGIyWD/W8pxMUs7RmQ5Zz4lLGRES+UTzl+vlHyLN L0GA== X-Forwarded-Encrypted: i=1; AJvYcCXcaidz+mWMIdMQP+lP6i9hEHtn3y5Tu8OKoDt5sZFfDHX6MBg0aZs2owvWQ7a3dNwq1axuK/rDaNWQwldsFEvRDCz62KOJN0/nKvqnZw== X-Gm-Message-State: AOJu0YysQwxYEVGozDCgyqQz8EBhym0+qcF5WsD9WvFaqvF5UqyvBn4o XVDmh5eP/FU6OydtL8LN7cll7v9aSVbv9DlheCokEAYqS3zIGgHDwBvkHMNnokc= X-Google-Smtp-Source: AGHT+IGgmL2y9QM4c4g0Wf6Xz0uaCMi9coDigbGLy4p0by/hZmKG4KPflaiBbCeCe+DcbaFV7kidJA== X-Received: by 2002:a2e:bc88:0:b0:2ee:7a54:3b14 with SMTP id 38308e7fff4ca-2ee7a543b8dmr26465461fa.7.1719994949278; Wed, 03 Jul 2024 01:22:29 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.50]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70802959d41sm10094847b3a.96.2024.07.03.01.22.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 01:22:28 -0700 (PDT) Date: Wed, 3 Jul 2024 10:22:11 +0200 From: Petr Mladek To: Jocelyn Falempe Subject: Re: [PATCH v2] printk: Add a short description string to kmsg_dump() Message-ID: References: <20240702122639.248110-1-jfalempe@redhat.com> <202407021326.E75B8EA@keescook> <10ea2ea1-e692-443e-8b48-ce9884e8b942@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10ea2ea1-e692-443e-8b48-ce9884e8b942@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 Wed 2024-07-03 09:57:26, Jocelyn Falempe wrote: > > > On 02/07/2024 22:29, Kees Cook wrote: > > On Tue, Jul 02, 2024 at 02:26:04PM +0200, Jocelyn Falempe wrote: > > > kmsg_dump doesn't forward the panic reason string to the kmsg_dumper > > > callback. > > > This patch adds a new struct kmsg_dump_detail, that will hold the > > > reason and description, and pass it to the dump() callback. > > > > Thanks! I like this much better. :) > > > > > > > > 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. > > > > > > v2: > > > * Use a struct kmsg_dump_detail to hold the reason and description > > > pointer, for more flexibility if we want to add other parameters. > > > (Kees Cook) > > > * Fix powerpc/nvram_64 build, as I didn't update the forward > > > declaration of oops_to_nvram() > > > > The versioning history commonly goes after the "---". > > ok, I was not aware of this. > > > > > [...] > > > diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h > > > index 906521c2329c..65f5a47727bc 100644 > > > --- a/include/linux/kmsg_dump.h > > > +++ b/include/linux/kmsg_dump.h > > > @@ -39,6 +39,17 @@ struct kmsg_dump_iter { > > > u64 next_seq; > > > }; > > > +/** > > > + *struct kmsg_dump_detail - kernel crash detail > > > > Is kern-doc happy with this? I think there is supposed to be a space > > between the "*" and the first word: > > > > /** > > * struct kmsg... > > > > > Good catch, yes there is a space missing. > > I just checked with "make htmldocs", and in fact include/linux/kmsg_dump.h > is not indexed for kernel documentation. > And you can't find the definition of struct kmsg_dumper in the online doc. > https://www.kernel.org/doc/html/latest/search.html?q=kmsg_dumper > > > Otherwise looks good to me! > > > > Thanks. > > As this patch touches different subsystems, do you know on which tree it > should land ? Andrew usually takes patches against kernel/panic.c. Or you could take it via the DRM tree, especially if you already have the code using the string. Also I could take it via the printk tree. The only complication is that I am going to be away the following two weeks and would come back in the middle of the merge window. I do not expect much problems with this change but... Best Regards, Petr