Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp271338imn; Fri, 29 Jul 2022 06:28:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR6RLlNv7e+r/x9iKbqC6HJdznb6Vd2GwMI4qfvn1t9HcZc2E/XV+NInVx2SSQ/YlIkHK51g X-Received: by 2002:a17:90b:4a42:b0:1f2:b638:bc2e with SMTP id lb2-20020a17090b4a4200b001f2b638bc2emr4781788pjb.185.1659101301711; Fri, 29 Jul 2022 06:28:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659101301; cv=none; d=google.com; s=arc-20160816; b=ap09Z72zSYojeT/iYLsmdfQ61Vo4w18mRvyX4X3f1pKwT3nE6pvZavT++z1xDRp4It s9Dbt7LKtWNNJCxRSGJE4tsKOvXGXfcgxS0bp5ACF+EqnOw3ic9sADplyNWfX3OU7OMS HkX+cBpb7cAo6uokSHZGnv4ETwWbIsVb2gXfx8RDdar/NiCSKuet63mP0N7YEbFCcxJ2 a3meCdhe0CL2jqeL8ghbP7PW9VL4LIkTWPtkGzdvUynRjJeR4sKIn6LIBJU6bn5nhSni HozS67XsjiRRe1toiauxG/IEGJBhbzpHgrDmjHzXGAUBq+Lhtm6MLBcW/8g5JDg0P2PZ ++jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=hV0qYTC7OoJpAF9QtQK9rYxys2g6YEbLjVJJxSg9gbU=; b=MQLPnzRSaJD9c+f4OIGEgmAHlVnuuM6RZs0ytDvRM1zHWsUYiAl64+cbs1IgP8zd7T JDzkiBGFmqaWJa4SWq/0GOYxXCQ5P8cF+dWcSfUcL9a6lSWR4ua1rAIBDDD6/lyii2Ox bloNQzRaXJfnzM+YKhFHfD6K2ynLoY8KVEklMDhhOzwEIWpojTNZeEurQ9Ran5GEUHtk DSvyS/XkhIBB8XgH4txg8mOS+Prz1duqpdR7IaU7gEwQu95dVNmYN7dPDzYQJIruimv6 2gxCZ8NOjE17Zj8NOW5cbNv7Ytxgt4PJEVClNBtMWSG/q1zHk8+GBGw4xoa3my7UD8fE jVUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=IsWp5mXC; dkim=neutral (no key) header.i=@suse.cz; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x8-20020a17090a8a8800b001f061a4d77fsi7680018pjn.42.2022.07.29.06.28.05; Fri, 29 Jul 2022 06:28:21 -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=@suse.cz header.s=susede2_rsa header.b=IsWp5mXC; dkim=neutral (no key) header.i=@suse.cz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235045AbiG2Mvu (ORCPT + 99 others); Fri, 29 Jul 2022 08:51:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230438AbiG2Mvt (ORCPT ); Fri, 29 Jul 2022 08:51:49 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F0683ED75 for ; Fri, 29 Jul 2022 05:51:47 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9D19334798; Fri, 29 Jul 2022 12:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659099106; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=hV0qYTC7OoJpAF9QtQK9rYxys2g6YEbLjVJJxSg9gbU=; b=IsWp5mXCuaKwjUMBnUYkMEXBfugN1i6T20EH2hprYvy+Tdb9oxmeUD/ttpPVbeLfVU56A7 FZ1D5KGxcZbvwffE2Q/dg68sa4YSIGVs/mmXXbS75PSST3qgybQucSHNIFwQFQ/0hCz8of qa1YedXBFnXmWLXTZSB3XJjJEmdwhj4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659099106; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=hV0qYTC7OoJpAF9QtQK9rYxys2g6YEbLjVJJxSg9gbU=; b=bZ+McRZGRuYPgzjH834gFMp1Mg6Q+dT5zy7WDiEQzMRmwanxhawXI8G/qn+rlJCjxuawWx EcwZDwsj4ew6DcAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BBDB013A8E; Fri, 29 Jul 2022 12:51:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id dT3LK+HX42IPPQAAMHmgww (envelope-from ); Fri, 29 Jul 2022 12:51:45 +0000 From: Petr Vorel To: linux-kernel@vger.kernel.org Cc: Petr Vorel , Greg Kroah-Hartman , "Rafael J. Wysocki" , David Sterba Subject: [PATCH v2 1/1] drivers/base/cpu: Print kernel arch Date: Fri, 29 Jul 2022 14:51:41 +0200 Message-Id: <20220729125141.12786-1-pvorel@suse.cz> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Print the machine hardware name (UTS_MACHINE) in /proc/sys/kernel/arch. 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 --- Documentation/admin-guide/sysctl/kernel.rst | 5 +++++ kernel/utsname_sysctl.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst index ddccd1077462..70a0acf07101 100644 --- a/Documentation/admin-guide/sysctl/kernel.rst +++ b/Documentation/admin-guide/sysctl/kernel.rst @@ -65,6 +65,11 @@ combining the following values: 4 s3_beep = ======= +arch +==== + +The machine hardware name, the same output as ``uname -m`` +(e.g. ``x86_64`` or ``aarch64``). auto_msgmni =========== diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c index 4ca61d49885b..7ffdd2cd5ff9 100644 --- a/kernel/utsname_sysctl.c +++ b/kernel/utsname_sysctl.c @@ -73,6 +73,13 @@ static DEFINE_CTL_TABLE_POLL(hostname_poll); static DEFINE_CTL_TABLE_POLL(domainname_poll); static struct ctl_table uts_kern_table[] = { + { + .procname = "arch", + .data = init_uts_ns.name.machine, + .maxlen = sizeof(init_uts_ns.name.machine), + .mode = 0444, + .proc_handler = proc_do_uts_string, + }, { .procname = "ostype", .data = init_uts_ns.name.sysname, -- 2.37.1