From: "Ahmed S. Darwish" <darwi@linutronix.de>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
mingo@kernel.org, linux-kernel@vger.kernel.org,
Juergen Gross <jgross@suse.com>,
Stefano Stabellini <sstabellini@kernel.org>,
John Ogness <john.ogness@linutronix.de>,
Linus Torvalds <torvalds@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Borislav Petkov <bp@alien8.de>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 4/5] x86/cpuid: Standardize on u32 in <asm/cpuid/api.h>
Date: Wed, 19 Mar 2025 09:16:21 +0100 [thread overview]
Message-ID: <Z9p9VcQ3CO7Mrubl@lx-t490> (raw)
In-Reply-To: <57505261-45EA-48B6-824E-49AF2203C094@zytor.com>
On Tue, 18 Mar 2025, H. Peter Anvin wrote:
>
> tglx has suggested that we should cache or even preload the cpuid data
> (the latter would have the potential advantage of making the memory
> data structures a little easier to manage, given the very large
> potential space.)
>
This is indeed in the patch queue that I plan to send after this leaf
cleanups one gets merged. We have a data model and CPUIDs are cached on
early boot. The cache is also refreshed during machine state changes
where the CPUIDs can change; e.g. a microcode update, PSN disable, etc.
Call sites then just do:
a = cpudata_cpuid(c, 0x0)->max_std_leaf;
b = cpudata_cpuid(c, 0x80000000)->max_ext_leaf;
struct leaf_0x1_0 *l1 = cpudata_cpuid(c, 0x1);
x = l0->cpu_vendorid_0;
y = l0->cpu_vendorid_1;
z = l0->cpu_vendorid_2;
and all the data is retrieved auto-magically from the cached tables.
The struct leaf_0xM_N C99 bitfield listings are auto generated by
x86-cpuid-db of course, just like in tools/arch/x86/kcpuid/cpuid.csv.
Thanks,
--
Ahmed S. Darwish
Linutronix GmbH
next prev parent reply other threads:[~2025-03-19 8:16 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 22:30 [PATCH 0/5] x86/cpu: Introduce <asm/cpuid/types.h> and <asm/cpuid/api.h> and clean them up mingo
2025-03-17 22:30 ` [PATCH 1/5] x86/cpuid: Refactor <asm/cpuid.h> mingo
2025-03-17 22:30 ` [PATCH 2/5] x86/cpuid: Clean up <asm/cpuid/types.h> mingo
2025-03-17 22:30 ` [PATCH 3/5] x86/cpuid: Clean up <asm/cpuid/api.h> mingo
2025-03-17 22:30 ` [PATCH 4/5] x86/cpuid: Standardize on u32 in <asm/cpuid/api.h> mingo
2025-03-18 18:48 ` H. Peter Anvin
2025-03-18 19:08 ` H. Peter Anvin
2025-03-18 19:09 ` Andrew Cooper
2025-03-18 19:25 ` H. Peter Anvin
2025-03-18 19:44 ` Andrew Cooper
2025-03-19 8:16 ` Ahmed S. Darwish [this message]
2025-03-17 22:30 ` [PATCH 5/5] x86/cpuid: Use u32 in instead of uint32_t " mingo
2025-03-17 22:49 ` [PATCH 0/5] x86/cpu: Introduce <asm/cpuid/types.h> and <asm/cpuid/api.h> and clean them up Linus Torvalds
2025-03-17 23:00 ` Ingo Molnar
2025-03-18 11:39 ` Ahmed S. Darwish
2025-03-18 11:55 ` Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2025-03-17 22:18 Ingo Molnar
2025-03-17 22:18 ` [PATCH 4/5] x86/cpuid: Standardize on u32 in <asm/cpuid/api.h> Ingo Molnar
2025-03-18 5:59 ` Xin Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z9p9VcQ3CO7Mrubl@lx-t490 \
--to=darwi@linutronix.de \
--cc=andrew.cooper3@citrix.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=sstabellini@kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®