From: Jocelyn Falempe <jfalempe@redhat.com>
To: Kees Cook <kees@kernel.org>, Petr Mladek <pmladek@suse.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
"K. Y. Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Tony Luck <tony.luck@intel.com>,
"Guilherme G. Piccoli" <gpiccoli@igalia.com>,
Steven Rostedt <rostedt@goodmis.org>,
John Ogness <john.ogness@linutronix.de>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Andrew Morton <akpm@linux-foundation.org>,
Jani Nikula <jani.nikula@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kefeng Wang <wangkefeng.wang@huawei.com>,
Thomas Gleixner <tglx@linutronix.de>,
Uros Bizjak <ubizjak@gmail.com>,
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()
Date: Wed, 3 Jul 2024 18:40:12 +0200 [thread overview]
Message-ID: <9e7023f4-775c-4371-ade5-1ed860545aaa@redhat.com> (raw)
In-Reply-To: <202407030926.D5DA9B901D@keescook>
On 03/07/2024 18:27, Kees Cook wrote:
> On Wed, Jul 03, 2024 at 10:22:11AM +0200, Petr Mladek wrote:
>> 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.
If it's not taken in Andrew's tree next week, I will see if I can push
it to the drm-misc tree. I think there is a very low chance of conflicts.
>>
>> 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...
>
> If DRM doesn't want to carry it, I can put it in through the pstore
> tree. Let me know! :)
>
Thanks for the proposition, I will see how it goes, it would be nice to
have it in time for the v6.11 merge window.
Best regards,
--
Jocelyn
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2024-07-03 16:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-02 12:26 [PATCH v2] printk: Add a short description string to kmsg_dump() Jocelyn Falempe
2024-07-02 20:29 ` Kees Cook
2024-07-03 7:57 ` Jocelyn Falempe
2024-07-03 8:22 ` Petr Mladek
2024-07-03 16:27 ` Kees Cook
2024-07-03 16:40 ` Jocelyn Falempe [this message]
2024-07-03 8:12 ` Petr Mladek
2024-07-12 9:59 ` Jocelyn Falempe
2024-07-12 12:26 ` Michael Ellerman
2024-07-12 13:34 ` Kees Cook
2024-07-12 14:11 ` Jocelyn Falempe
2024-07-12 12:26 ` Michael Ellerman
2024-07-17 11:14 ` Jocelyn Falempe
2024-07-17 18:19 ` Nuno Das Neves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9e7023f4-775c-4371-ade5-1ed860545aaa@redhat.com \
--to=jfalempe@redhat.com \
--cc=airlied@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=christophe.leroy@csgroup.eu \
--cc=daniel@ffwll.ch \
--cc=decui@microsoft.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gpiccoli@igalia.com \
--cc=gregkh@linuxfoundation.org \
--cc=haiyangz@microsoft.com \
--cc=jani.nikula@intel.com \
--cc=john.ogness@linutronix.de \
--cc=kees@kernel.org \
--cc=kys@microsoft.com \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=miquel.raynal@bootlin.com \
--cc=mpe@ellerman.id.au \
--cc=mripard@kernel.org \
--cc=naveen.n.rao@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=pmladek@suse.com \
--cc=richard@nod.at \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=tzimmermann@suse.de \
--cc=ubizjak@gmail.com \
--cc=vigneshr@ti.com \
--cc=wangkefeng.wang@huawei.com \
--cc=wei.liu@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox