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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 B70C0C3DA42 for ; Wed, 17 Jul 2024 11:14:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 02B4010EA61; Wed, 17 Jul 2024 11:14:16 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="UgjV6d58"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4025910EA6E for ; Wed, 17 Jul 2024 11:14:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721214853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RAGmeywEZ/JgSZ6hAqPsmz089vwWWyWA+lKvknqNmtE=; b=UgjV6d58WHZ+iXXAQqz1v624TIG6JOH+tHEBAebi7Q9voIpUFCEL7HkgVMoutyHFgv0nfr w/OECfpBrrUEf1lIt0tCFfVop/5ytVFZwt9f7A+fMTFU6nxfL4a7STAhjWxdAFfhwwQLuI +uzHAFYZPhy4QLJI1MRIoIE+wPp/Je0= 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-689-fFqmkug_P9-TrfJs8hIyDA-1; Wed, 17 Jul 2024 07:14:11 -0400 X-MC-Unique: fFqmkug_P9-TrfJs8hIyDA-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-36805bfd95aso3551290f8f.3 for ; Wed, 17 Jul 2024 04:14:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721214850; x=1721819650; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RAGmeywEZ/JgSZ6hAqPsmz089vwWWyWA+lKvknqNmtE=; b=CHJUIFZNH/+xHyycpK5ycSU2uj7FD0NNUx8gAOlqn+MDAlHQ2FfJW2EoyfnQSO9V+N Eg/l+H+yU4YevWN+wgPH/4aS0+tdsGiRDCQHTQp1vK3wdZNy/EHdAFnrRoe3AJG+qSEg +SSIwgzrsnLj25CL7i3LYxrG71PAmGf5MKPR5HfMvDxxknXcU1COMO9+fPfJpE+6NzyJ 2AlkLyJRlSF6XtCK/wXpV5HPkOTw716yUkX3YZ0H2oMwbkYoi5b4ffYsyaOSm3FgG7NO CP8fVGseOmJVc4I8mKl68VRDtLy9Tda9K6q48j77I97jGkf/JfHgPQqim3+fZrx7CVH8 UlHQ== X-Forwarded-Encrypted: i=1; AJvYcCVsaE7ukfRd8rvgEOwF56NVFQrOTlasMXpmkS3GSFQUz9DFq5bnC06OVm4ECxFvEaY7wWIf5AJXIA9CASX+bGac0c/jQFgD5oOW853Obb/I X-Gm-Message-State: AOJu0YzL/6/7IKRj6skIbywc0JvfwaZy406x+dzIvWtahDn1aIZMXo/C P5wlZCHHXujaa3EjDp/wG3f6FtD+C0EuksZ+PuEXKurEgWsJLTPzWoh5b3pmmI2GnNe5zNdwQL2 4+ueMQtEYewiOOHDmdtifH3Xo8HOeDxgW2Dr9ymSbI4xtzKJzCSOA5CJ+s1xIo1Mvyw== X-Received: by 2002:a5d:5f8c:0:b0:367:943e:f436 with SMTP id ffacd0b85a97d-36831652b7cmr1395232f8f.30.1721214850115; Wed, 17 Jul 2024 04:14:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHkv5VJxD9qI1kB5PB9WhCMM3ozFKBNBC+x5bcWuyaH6WTwCYKMg89QMw7W+wtEnk2KMCsWzg== X-Received: by 2002:a5d:5f8c:0:b0:367:943e:f436 with SMTP id ffacd0b85a97d-36831652b7cmr1395208f8f.30.1721214849630; Wed, 17 Jul 2024 04:14:09 -0700 (PDT) Received: from ?IPV6:2a01:e0a:c:37e0:ced3:55bd:f454:e722? ([2a01:e0a:c:37e0:ced3:55bd:f454:e722]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3680dafbec3sm11450684f8f.85.2024.07.17.04.14.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Jul 2024 04:14:09 -0700 (PDT) Message-ID: Date: Wed, 17 Jul 2024 13:14:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] printk: Add a short description string to kmsg_dump() To: 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" , Petr Mladek , 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 References: <20240702122639.248110-1-jfalempe@redhat.com> From: Jocelyn Falempe In-Reply-To: <20240702122639.248110-1-jfalempe@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US, fr Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 02/07/2024 14:26, 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. > > 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() > > Signed-off-by: Jocelyn Falempe > --- > arch/powerpc/kernel/nvram_64.c | 8 ++++---- > arch/powerpc/platforms/powernv/opal-kmsg.c | 4 ++-- > arch/um/kernel/kmsg_dump.c | 2 +- > drivers/gpu/drm/drm_panic.c | 4 ++-- > drivers/hv/hv_common.c | 4 ++-- > drivers/mtd/mtdoops.c | 2 +- > fs/pstore/platform.c | 10 +++++----- > include/linux/kmsg_dump.h | 22 +++++++++++++++++++--- > kernel/panic.c | 2 +- > kernel/printk/printk.c | 11 ++++++++--- > 10 files changed, 45 insertions(+), 24 deletions(-) > [...] I pushed it to drm-misc-next, with the whitespace change in kmsg_dump.h Thanks all for your reviews and comments. Best regards, -- Jocelyn