Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp486743imn; Wed, 27 Jul 2022 11:33:02 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vZFmMY9kk2JcVoD2Cct8YYI1iD6birXZh4+9qxyLx2tWO+FC5N+YqT3k+xz6kgIpabdH7a X-Received: by 2002:a05:6402:42cb:b0:43b:e8eb:cbc1 with SMTP id i11-20020a05640242cb00b0043be8ebcbc1mr19137724edc.414.1658946782025; Wed, 27 Jul 2022 11:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658946782; cv=none; d=google.com; s=arc-20160816; b=ESOylskde778Sz4JUKMIpdqpQ0ttXP2/QqgbRudwrjFqgAA06xlijhArME7OmiP8hq HWU2QY56T0WIINM99so3ZpV3Z0zk58kK18nAGt9tzS2ykdCAPgHsFN4Z/mR04RDpouR5 cadOYtpXIwf5rlmCglPeQDxFzM4pLpoHmkzNYbOcwYAca1Ck1DPGPuZ0bjwiMfYWCMDp ylNoa2SFvmMLrnrLN7aqa2SFx28nRcuMEoeUkAB9wrJGdOZLrmiXeXyxaIZfxIG1LYmy X9U9/Lk3t/ORojscUmk4mYwNNVgeoM0/ORzi75+WH/BFHCv/0TTSc7x98VUB/fuI6/BN auxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oeoQ0tUlQpVcuHsSM21TvhZJWvxB06CYqPkkdqAYYEY=; b=VfxXFkIvJc+r0pGApgfhHrUOwDsVHNbg/oknnmER7Q6BJavv0skKV6MuklhaPK8B4+ 0XVmc56Ly9uazh70+v9m/+usAQauioT9DqfU9D4GlUCn7/TYkCM6RsYsbwwrc6Bk48bW tk7gi9qlw2Q1Q2ycPEPpYHkWLTvzqnwAJ9ac+Arpxt8/Dl/zHmYOp8IjktGMgKrCqpyM oIapUumZlxX9RiZ1JMsMmFqP0dgPn6J4nhjXRiNJpdxU9R1ibtXkYMgqVlfIaPGBl5vC d6CDBAotq6mWPo90zZlnMWoEvwSV0IGqDs9pvDyj/7JxDdF9YWMhcyNeT2smOi0TnocT MrAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xgobuzaz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l21-20020aa7c3d5000000b0043cdfddce21si56328edr.344.2022.07.27.11.32.36; Wed, 27 Jul 2022 11:33:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xgobuzaz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242940AbiG0RyD (ORCPT + 99 others); Wed, 27 Jul 2022 13:54:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242993AbiG0Rxs (ORCPT ); Wed, 27 Jul 2022 13:53:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A969698204 for ; Wed, 27 Jul 2022 09:58:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 608FDB821D8 for ; Wed, 27 Jul 2022 16:58:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 864E8C433D6; Wed, 27 Jul 2022 16:58:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658941092; bh=ilVcgb+qn9Ak0Tbt2ws0tO3d/fETMN6Hy8UtFrfFk2s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xgobuzazZCLtLbhApozobUvtqyg+OhVThqnZY45gHnQ2I9bDvMnT0Ld8D+g1W2Kle ok6VhW6/cy+5GwJjt5zyCBFEyf7Efx4jZn7XGjTT9C3m1UY7uE6thEkn4YRQEYPJ1N KRvxUwhvGEL+5VT2bjZZYikCEarZ+RBY225F46Ek= Date: Wed, 27 Jul 2022 18:40:39 +0200 From: Greg Kroah-Hartman To: Petr Vorel Cc: linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , David Sterba Subject: Re: [PATCH 1/1] drivers/base/cpu: Print kernel arch Message-ID: References: <20220727161135.24531-1-pvorel@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220727161135.24531-1-pvorel@suse.cz> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 27, 2022 at 06:11:35PM +0200, Petr Vorel wrote: > Print kernel architecture in /sys/devices/system/cpu/arch > using UTS_MACHINE, i.e. member of struct uts_namespace.machine. > > This helps people who debug kernel with initramfs with minimal > environment (i.e. without coreutils or even busybox) or allow to open > sysfs file instead of run uname -m in high level languages. > > Signed-off-by: Petr Vorel > --- > drivers/base/cpu.c | 9 +++++++++ > 1 file changed, 9 insertions(+) You can't add a new sysfs file without a Documentation/ABI/ update as well. Please fix that up. > > diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c > index 4c98849577d4..7c8032e3ff10 100644 > --- a/drivers/base/cpu.c > +++ b/drivers/base/cpu.c > @@ -3,6 +3,7 @@ > * CPU subsystem support > */ > > +#include > #include > #include > #include > @@ -232,6 +233,13 @@ static ssize_t print_cpus_kernel_max(struct device *dev, > } > static DEVICE_ATTR(kernel_max, 0444, print_cpus_kernel_max, NULL); > > +static ssize_t print_cpus_arch(struct device *dev, > + struct device_attribute *attr, char *buf) > +{ > + return sysfs_emit(buf, "%s\n", UTS_MACHINE); > +} > +static DEVICE_ATTR(arch, 0444, print_cpus_arch, NULL); why just UTS_MACHINE? Doesn't 'uname' show this already? And I thought this was in /proc/cpuinfo but odd, it isn't... Also what about the other things in compile.h? thanks, greg k-h