[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4uxkf5riuv66kdxa7zteubdfsjy4vac6td5z6cckilyiqjceft@zk3mzmfv3lgk>
Date: Thu, 3 Apr 2025 18:40:00 +0530
From: Naveen N Rao <naveen@...nel.org>
To: Borislav Petkov <bp@...en8.de>
Cc: linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>, Jonathan Corbet <corbet@....net>, x86@...nel.org
Subject: Re: [PATCH] Documentation/x86: Clarify naming of CPU features for
/proc/cpuinfo
On Thu, Apr 03, 2025 at 02:17:27PM +0200, Borislav Petkov wrote:
> On Thu, Apr 03, 2025 at 03:13:08PM +0530, Naveen N Rao (AMD) wrote:
> > Commit 78ce84b9e0a5 ("x86/cpufeatures: Flip the /proc/cpuinfo appearance
> > logic") changed how CPU feature names should be specified. Update
> > document to reflect the same.
> >
> > Signed-off-by: Naveen N Rao (AMD) <naveen@...nel.org>
> > ---
> > Documentation/arch/x86/cpuinfo.rst | 42 +++++++++---------------------
> > 1 file changed, 13 insertions(+), 29 deletions(-)
> >
> > diff --git a/Documentation/arch/x86/cpuinfo.rst b/Documentation/arch/x86/cpuinfo.rst
> > index 6ef426a52cdc..fecdc36e02a1 100644
> > --- a/Documentation/arch/x86/cpuinfo.rst
> > +++ b/Documentation/arch/x86/cpuinfo.rst
> > @@ -124,37 +124,21 @@ also defined in cpufeatures.h.
> > Naming of Flags
> > ===============
> >
> > -The script arch/x86/kernel/cpu/mkcapflags.sh processes the
> > -#define X86_FEATURE_<name> from cpufeatures.h and generates the
> > -x86_cap/bug_flags[] arrays in kernel/cpu/capflags.c. The names in the
>
> This is not the patch I saw in internal review. The script still processes
> cpufeatures.h
As far as I can tell, the script still processes cpufeatures.h but no
longer "generates" names. It simply picks names within double-quotes if
present. I don't think that is relevant for describing how the flags are
named anymore.
>
> Please go through all the text you're changing and verify you're *actually*
> doing the right thing.
I guess you missed that part of my response where I explicitly mentioned
that I have dropped the part describing the script for the above reason,
and also pasted how the section looks like.
Regardless, please take another look at this and let me know if you
think this still doesn't read right, or is missing anything (the script
part, in particular). For reference, here is how the flag naming section
looks like with this patch:
---
Naming of Flags
===============
If the comment on the line for the #define X86_FEATURE_* starts with a
double-quote character (""), the string inside the double-quote characters will
be the name of the flag. For example, the flag "sse4_1" comes from the comment
"sse4_1" following the X86_FEATURE_XMM4_1 definition. /proc/cpuinfo is a
userspace interface and must remain constant. If, for some reason, the naming
of X86_FEATURE_<name> changes, one shall retain the name already used in
/proc/cpuinfo.
If the comment on the line does not start with a double-quote character, then
it will be omitted from /proc/cpuinfo. This is desirable if it does not make
sense for the feature to be exposed to userspace. For example,
X86_FEATURE_ALWAYS is defined in cpufeatures.h but that flag is an internal
kernel feature used in the alternative runtime patching functionality. So, no
name is specified within double-quotes and its flag will not appear in
/proc/cpuinfo.
Thanks,
Naveen
Powered by blists - more mailing lists