Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp394557rwb; Thu, 11 Aug 2022 03:36:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR70nL3oZ7ZUI1YyeYRNoqq7YvPAW+iV0zKvlFxxGdFDurcQaJNf6F3VpUkTBZUQTgDwLIp8 X-Received: by 2002:a05:6402:424d:b0:43e:95d8:eb46 with SMTP id g13-20020a056402424d00b0043e95d8eb46mr30187790edb.306.1660214199940; Thu, 11 Aug 2022 03:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660214199; cv=none; d=google.com; s=arc-20160816; b=DG45T+56NOd5jB6D8pm9gf/5dXAVGWzLdU3bAjm/FWiah/lwEXAwB/XVpuvOPOljRf i5+3qDDcTue8X7ZiqFpDhLSb2Sb19fiv4WfzzRRS18Jv7pnxtH8nP8cWe+qUxhar95Ep inJVr8/+sMuKSnvaY3G2fVAGt6QIVMcOLuOw/WI4S1YfJXVFWXOz8M8cPAly7GW7XsUo MzyqSAELCJg/r4aaXqYtsEETrRhqdVyVa7/cVBWvPwe7placsdUzqXWOmQW9yksObnPh 5IvZr4CR1Q749+BTg1D1odKp2VNd8JRgTCV98xATb803ydVZXVa1QLqDf873MA8kaLSm yHRw== 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:feedback-id :dkim-signature:dkim-signature; bh=GAIaaeg6VUZ/HXdTZ6n0jyzFEcMotm8n/nJvYfvgRGs=; b=pVT9qu/exN4b0XmDXsyNjcniDGgh95SrHEjqtY/jbJkHOSUdK/5NVNJ/fptZjmE5Cy KWc5g8eKJgB9hsq8aHFy1f0DSxQtfNcq8umcSwBsEeN9RF4flsbMPaNtR/omwxHVPpE5 datvr2CHeNDIZny5dzpUjgC7vdz4NkWGmK6Eruw4Pps08Qp+151WTkyMqjSIuE/jX38q TZGoju3RIXaVlGjM516Pa67cUi3V+eZA9iQkkN2XXIVfxMa+cQbFMM3jvIGryBkTZxVi JBwnNJk60X/TJEeuUbqoaRw87T2zLpZq0bKPOP/uMlu+LHozx58Ej9G7oq2NwN9eGAr2 h5WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kroah.com header.s=fm1 header.b=ApZ9bWg9; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=sJyotw8J; 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 i23-20020a50fc17000000b0043d62064bc8si12433644edr.231.2022.08.11.03.36.13; Thu, 11 Aug 2022 03:36:39 -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=@kroah.com header.s=fm1 header.b=ApZ9bWg9; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=sJyotw8J; 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 S234138AbiHKKWo (ORCPT + 99 others); Thu, 11 Aug 2022 06:22:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbiHKKWl (ORCPT ); Thu, 11 Aug 2022 06:22:41 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AD2F255BA; Thu, 11 Aug 2022 03:22:40 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 9E25A5C00CD; Thu, 11 Aug 2022 06:22:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 11 Aug 2022 06:22:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1660213359; x=1660299759; bh=GAIaaeg6VU Z/HXdTZ6n0jyzFEcMotm8n/nJvYfvgRGs=; b=ApZ9bWg9SsWMwb+ozmshqklWe5 EtEq/cDUXJzHItlBUFWTcmJPwzS03MY9kQi+WsalA6LhRBAeiBMrpnsOsOpyuAE6 rxpRDN/uLLT3aBsAvas20kNQCbWeEsGrKrZe/Zp9EqePp6XjnGYaYZG3DQzq5YdX 6fBd6yjC398elBuUMc/DJf+XGfVHdD4mrLv3v9k1BBjt2C5GRZCQu7ddrO116KFr 3/1ZWvF4YpEghcvfk1KLMUKDxSNA7QXEFdjnNO4oxXbwccEJFgzepKGELMBlaCnH tOp+vCgHOUZpQrAlD0sX9x63KT38ouAEnXmUZQCntNhSENgSXa8YIcqUxp/g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1660213359; x=1660299759; bh=GAIaaeg6VUZ/HXdTZ6n0jyzFEcMo tm8n/nJvYfvgRGs=; b=sJyotw8JmJlrtW+CAOb/FezZH6j8Z3QxeAgAk3rgWf4g NkJfr+p+n5RF92SAB2K4BpxCdmaCF+Ci7TLveIGbaNhNyCxotl0RWxPZ0lXusrdW sVDBbc6j10r3UrhJi2nWA8XFxx03ZEGOzQXGl/l23aOzOlIlprzbQOxuBdL4kRdk S+sWa4WA67CrceVrsv9mpGhclB/XUW8h0QF8NOrriEKpDHowiz51LCqM58zjPYeX 4iXO3zsoAOHVINRx+oi07xxg4QAFXJ1hexIsI6DexTsieY0vR5Xx8dkyQJxVYooB 7DOUpER1Su7AMUSzir4VvIKEwju6ra5z8Uq5XtQ7kA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeggedgvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepifhrvghg ucfmjfcuoehgrhgvgheskhhrohgrhhdrtghomheqnecuggftrfgrthhtvghrnhepheegvd evvdeljeeugfdtudduhfekledtiefhveejkeejuefhtdeufefhgfehkeetnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorg hhrdgtohhm X-ME-Proxy: Feedback-ID: i787e41f1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Aug 2022 06:22:38 -0400 (EDT) Date: Thu, 11 Aug 2022 12:22:37 +0200 From: Greg KH To: Jiaxun Yang Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, linux-api@vger.kernel.org Subject: Re: [PATCH v2] MIPS: Expose prid and globalnumber to sysfs Message-ID: References: <20220811101236.1925-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220811101236.1925-1-jiaxun.yang@flygoat.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Thu, Aug 11, 2022 at 10:12:36AM +0000, Jiaxun Yang wrote: > Some application would like to know precise model and rev of processor > to do errata workaround or optimization. > > Expose them in sysfs as: > /sys/devices/system/cpu/cpuX/regs/identification/prid > /sys/devices/system/cpu/cpuX/regs/identification/globalnumber > > Reusing AArch64 CPU registers directory. > > Signed-off-by: Jiaxun Yang > --- > v2: Drop static qualifier for kobj (gregkh) > --- > .../ABI/testing/sysfs-devices-system-cpu | 11 +++ > arch/mips/kernel/topology.c | 96 +++++++++++++++++++ > 2 files changed, 107 insertions(+) > > diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu > index 5bf61881f012..adf855e7bb9b 100644 > --- a/Documentation/ABI/testing/sysfs-devices-system-cpu > +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu > @@ -512,6 +512,17 @@ Description: information about CPUs heterogeneity. > > cpu_capacity: capacity of cpuX. > > +What: /sys/devices/system/cpu/cpuX/regs/ > + /sys/devices/system/cpu/cpuX/regs/identification/ > + /sys/devices/system/cpu/cpuX/regs/identification/prid > + /sys/devices/system/cpu/cpuX/regs/identification/globalnumber > +Date: Augest 2022 > +Contact: Linux MIPS Kernel Mailing list > +Description: MIPS CPU registers > + > + 'identification' directory exposes the Processor ID and Global Number > + registers for identifying model and revision of the CPU. You do not document that this is only for MIPS processors. Actually, why not do this for all chip types? Why is this only for MIPS chips? > + > What: /sys/devices/system/cpu/vulnerabilities > /sys/devices/system/cpu/vulnerabilities/meltdown > /sys/devices/system/cpu/vulnerabilities/spectre_v1 > diff --git a/arch/mips/kernel/topology.c b/arch/mips/kernel/topology.c > index 9429d85a4703..0e3730f3c00f 100644 > --- a/arch/mips/kernel/topology.c > +++ b/arch/mips/kernel/topology.c > @@ -5,6 +5,8 @@ > #include > #include > #include > +#include > +#include > > static DEFINE_PER_CPU(struct cpu, cpu_devices); > > @@ -26,3 +28,97 @@ static int __init topology_init(void) > } > > subsys_initcall(topology_init); > + > +static struct kobj_type cpuregs_kobj_type = { > + .sysfs_ops = &kobj_sysfs_ops, > +}; > + > +struct cpureg { > + struct kobject kobj; > + struct cpuinfo_mips *info; > +}; > +DEFINE_PER_CPU(struct cpureg, cpuregs); You still have static kobjects here, nothing changed from your previous submission :(