[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z9iVyrlDbFyI9Rqi@gmail.com>
Date: Mon, 17 Mar 2025 22:36:10 +0100
From: Ingo Molnar <mingo@...nel.org>
To: "Ahmed S. Darwish" <darwi@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>,
Andrew Cooper <andrew.cooper3@...rix.com>,
"H. Peter Anvin" <hpa@...or.com>,
John Ogness <john.ogness@...utronix.de>, x86@...nel.org,
x86-cpuid@...ts.linux.dev, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 03/29] x86/cpu: Remove leaf 0x2 parsing loop and add
helpers
* Ahmed S. Darwish <darwi@...utronix.de> wrote:
> Leaf 0x2 output includes a "query count" byte where it was supposed to
> specify the number of repeated CPUID leaf 0x2 subleaf 0 queries needed
> to extract all of the hardware's cache and TLB descriptors.
>
> Per current Intel manuals, all CPUs supporting this leaf "will always"
> return an iteration count of 1.
>
> Remove the leaf 0x2 query count loop and just query the hardware once.
> Parse the output with C99 bitfields instead of ugly bitwise operations.
>
> Provide leaf 0x2 parsing helpers with all the above. Use such helpers
> at x86/cpu intel.c. Further commits will use them for x86/cacheinfo.
>
> Suggested-by: Thomas Gleixner <tglx@...utronix.de>
> Signed-off-by: Ahmed S. Darwish <darwi@...utronix.de>
> ---
> arch/x86/include/asm/cpuid.h | 1 +
> arch/x86/include/asm/cpuid/leaf_0x2_api.h | 65 +++++++++++++++++++++++
> arch/x86/include/asm/cpuid/types.h | 16 ++++++
> arch/x86/kernel/cpu/intel.c | 24 +++------
> 4 files changed, 88 insertions(+), 18 deletions(-)
> create mode 100644 arch/x86/include/asm/cpuid/leaf_0x2_api.h
Could you please turn this into at least two patches:
- One does the functional change - this patch should be as small as
possible. This patch turns a piece of 'Intel documents' property
into 'actual code' that differs from the previous code, which may
or may not regress in practice.
- The other does the factoring out and the introduction of
<asm/cpuid/leaf_0x2_api.h>.
Thanks,
Ingo
Powered by blists - more mailing lists