From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59F5822A4EE for ; Mon, 23 Feb 2026 13:55:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771854909; cv=none; b=bQhXue+dau3dOIaFIBpn0rgAYX8Wx+jXuYCDDV0Gy+HmDxHmkUjI6QXx7RkOkAYOz/l1NaaFLEvnnjetjOTgJau4mQfP32/XYv7Sgmlfv4ZTFeeuq66S8YgU9++tlaKJIIePrN+cQUPFfintngaUtghFgjyU3yEyHjTnTM1DGvQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771854909; c=relaxed/simple; bh=zN/YCbw7jRh0kcFgdwH5mZSPIoFyQIVS3IGNnJdeP+Q=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=q2a4P8GkKI9NfAUNLNzUnUY9ftMzCPE8xe8Bobtz8nyjICHojeptzZs/p4lf2/9HBbBrfrS5OiB/ai3jKAlyDdfI8qTR5Xi/+IBrRgUGuKU6gYEBTXLW8eZeEg6XpiysOFalvT7foaI/3qsuEE0bYvmm+zz6qL2v/jJKZgYHW58= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=WF4xodv2; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=RV+6ARdX; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="WF4xodv2"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="RV+6ARdX" From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1771854906; 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: in-reply-to:in-reply-to:references:references; bh=hNtTe7FyAICmfK+5oLyCtUf7TkjugGgwrcTUyWKq6is=; b=WF4xodv2+3JHzw9T+ByCsrXPQi8PEaD9kU0FGCExuhbiKg5ub9UCTY6xpEx0401JMKF+tx RBUAjzrOSd73XikeSe+hn+6tU2YyPWR3LAUfn6HMn0pQaai7gPnmYhhVJJK+OoHp3/PSAu MBy217Fny9yy3eAt/0Dvg+nUcBWFBRntE9ZP9rT4yny7vuxP7SqRRCwbCkirTM0f1K++KS D4VJk71I1AYtYuRWiLB/TPNu4pQp22Gg1veoRflX+ibulqd2BmXmV4omCYjiRIYFdqXw1v Q+X4cO7t3qZJoOFW4ofGkNUEWlkhea61UD9PW40QT3kI4sjlNaACIiCGaPxjuQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1771854906; 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: in-reply-to:in-reply-to:references:references; bh=hNtTe7FyAICmfK+5oLyCtUf7TkjugGgwrcTUyWKq6is=; b=RV+6ARdXmB8Pmex7IAPFtnvBXB8RR4jJwD1Pf9is4sDz+p1X3zWJVG9OjWQtTG4mlITv3I DgpCm7wAZ6uLcaBA== To: Richard Weinberger , linux-kernel@vger.kernel.org Cc: bhe@redhat.com, sourabhjain@linux.ibm.com, akpm@linux-foundation.org, senozhatsky@chromium.org, rostedt@goodmis.org, pmladek@suse.com, gregkh@linuxfoundation.org, upstream+linux@sigma-star.at, Richard Weinberger Subject: Re: [PATCH] ksysfs: Expose hardware name In-Reply-To: <20260223133448.411343-1-richard@nod.at> References: <20260223133448.411343-1-richard@nod.at> Date: Mon, 23 Feb 2026 15:01:05 +0106 Message-ID: <87cy1va7k6.fsf@jogness.linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Hi Richard, On 2026-02-23, Richard Weinberger wrote: > Userspace tools often require a short, descriptive name of the hardware > platform. Currently, this information is fragmented: Device Tree-based > platforms typically use /proc/device-tree/model, while x86 platforms > combine multiple values from /sys/class/dmi/id/. There is no uniform, > platform-agnostic way to retrieve this string. > > The kernel already maintains dump_stack_arch_desc_str[], which contains > the model name or DMI values used for the "Hardware name:" field in > stack traces. > > Expose dump_stack_arch_desc_str[] at /sys/kernel/hardware_name to > provide userspace with a consistent interface for identifying the > underlying hardware. > > Signed-off-by: Richard Weinberger > --- > .../ABI/testing/sysfs-kernel-hardware_name | 8 ++++++++ > include/linux/printk.h | 1 + > kernel/ksysfs.c | 13 +++++++++++++ > lib/dump_stack.c | 2 +- > 4 files changed, 23 insertions(+), 1 deletion(-) > create mode 100644 Documentation/ABI/testing/sysfs-kernel-hardware_name > > diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c > index a9e6354d9e25..af7265754183 100644 > --- a/kernel/ksysfs.c > +++ b/kernel/ksysfs.c > @@ -176,6 +176,16 @@ static ssize_t rcu_normal_store(struct kobject *kobj, > KERNEL_ATTR_RW(rcu_normal); > #endif /* #ifndef CONFIG_TINY_RCU */ > > +#ifdef CONFIG_PRINTK > +/* hardware name */ > +static ssize_t hardware_name_show(struct kobject *kobj, > + struct kobj_attribute *attr, char *buf) > +{ > + return sysfs_emit(buf, "%s\n", dump_stack_arch_desc_str); > +} > +KERNEL_ATTR_RO(hardware_name); > +#endif It seems a bit odd to make this a dependency of CONFIG_PRINTK. Perhaps @dump_stack_arch_desc_str and dump_stack_set_arch_desc() should move out of lib/dump_stack.c if this new sysfs attribute is accepted? John Ogness