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 55CFEC2BD09 for ; Wed, 3 Jul 2024 07:58:19 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ZSCDTgzm; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ZSCDTgzm; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4WDXG1476sz3cXw for ; Wed, 3 Jul 2024 17:58:17 +1000 (AEST) 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=ZSCDTgzm; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ZSCDTgzm; 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=jfalempe@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 4WDXFC6DS3z3bbW for ; Wed, 3 Jul 2024 17:57:35 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719993452; 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=ATgbDzJNw/2oGwBMOiWIjN3Qn1UCklmeTzoV2zYR45Y=; b=ZSCDTgzmwcKNnRCXqxzpar9YXzsbTba24KdaKM5AGvWEx8A06kRiY50ryfM2Z/2pS255hn u9zYzMP7nuAoGdOYcYzZWG98J7XlH6e2ZWPXgpuXdR1lwBZbnd8sL1oR7p8+eFd/dN2VYF lNH21Q7xA1nB1OizOLEkGl+hZfi2SHI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719993452; 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=ATgbDzJNw/2oGwBMOiWIjN3Qn1UCklmeTzoV2zYR45Y=; b=ZSCDTgzmwcKNnRCXqxzpar9YXzsbTba24KdaKM5AGvWEx8A06kRiY50ryfM2Z/2pS255hn u9zYzMP7nuAoGdOYcYzZWG98J7XlH6e2ZWPXgpuXdR1lwBZbnd8sL1oR7p8+eFd/dN2VYF lNH21Q7xA1nB1OizOLEkGl+hZfi2SHI= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-587-NTnuMcksMf6wX-e_KObCVg-1; Wed, 03 Jul 2024 03:57:30 -0400 X-MC-Unique: NTnuMcksMf6wX-e_KObCVg-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-36248c176c4so3236216f8f.1 for ; Wed, 03 Jul 2024 00:57:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719993449; x=1720598249; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ATgbDzJNw/2oGwBMOiWIjN3Qn1UCklmeTzoV2zYR45Y=; b=nLppt1NAFIByFgx616PS2LeIpqClYKx2mzJgFle0wFHMDdJ9X2FmW+RVjc4iFqtRFo jTbKrLdwwNTy2BH/f3OH3bRtRlPbRaqXi5kEKLG9IkxNOn0RwrcFEO7wbrU4XZBAkdBe 5eCymReTeLTL2iSOqh271wTOJEW0Im1qwO1Hpke2OuBvT0Ep5L7rYVw37Q6fho9CDf5T ZpN6JQDn6CtJQJqfltcUqm7xB/y4vR55x+RjRYR+6aR+T/885EoefnmU6CZpzNhXXEL1 J7nbjJeFEUrxOJy7vzrVGaMOZP/a7a3/KXnfITVRg7S9ObjIB1ntr+YBrk6wtYymE+B8 18zw== X-Forwarded-Encrypted: i=1; AJvYcCUWVd80tBvExf8lwbPDTF9qcC+eEwKOAkamStZqAeNruDJRLySbkd/8toDDoxHd3OAo/JpELurqL5QpbX2stWZAKMfAt0NOJNkeTQtRIA== X-Gm-Message-State: AOJu0YzLZ5HJbI6F3hSNRC8SRqdjzyjx46+ASRJ6Uae1VlWR/feK4JYr LKd88Bf0Ua8R7DPAGoERl/B8NeK4zU3nBCt+Yiy73whX5IzaYBy9PeBmr1D3RaqITIOcUlLlIF4 aEzSEgVCHKHXCrQ5LRln4RNojI03EIzt4uQeoH5fT9vEdkybdfGHg8UphUoZd5Og= X-Received: by 2002:a05:6000:400d:b0:366:e685:d0cb with SMTP id ffacd0b85a97d-3677569762bmr7597304f8f.6.1719993449011; Wed, 03 Jul 2024 00:57:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEgd9U2eqDjR78JXH16dEWMefFhv6oCfwMwNT/hPSpZD56c2ut2zLCAdpneI7XMTfA346aUUg== X-Received: by 2002:a05:6000:400d:b0:366:e685:d0cb with SMTP id ffacd0b85a97d-3677569762bmr7597268f8f.6.1719993448595; Wed, 03 Jul 2024 00:57:28 -0700 (PDT) Received: from ?IPV6:2a01:e0a:d5:a000:680e:9bf4:b6a9:959b? ([2a01:e0a:d5:a000:680e:9bf4:b6a9:959b]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0cd623sm15223623f8f.16.2024.07.03.00.57.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Jul 2024 00:57:28 -0700 (PDT) Message-ID: <10ea2ea1-e692-443e-8b48-ce9884e8b942@redhat.com> Date: Wed, 3 Jul 2024 09:57:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] printk: Add a short description string to kmsg_dump() To: Kees Cook References: <20240702122639.248110-1-jfalempe@redhat.com> <202407021326.E75B8EA@keescook> From: Jocelyn Falempe In-Reply-To: <202407021326.E75B8EA@keescook> 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: 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 , 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 , "Guilherme G. Piccoli" , Dexuan Cui , Christophe Leroy , "Naveen N. Rao" , Petr Mladek , 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, Sergey Senozhatsky , 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 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 ? -- Jocelyn