Messages in this thread | | | Date | Wed, 19 Jul 2023 13:07:59 +0530 | Subject | Re: [PATCH 3/6] x86/cpuid: Add smp helper | From | Sandipan Das <> |
| |
On 7/19/2023 12:58 PM, Peter Zijlstra wrote: > On Wed, Jul 19, 2023 at 12:25:38PM +0530, Sandipan Das wrote: >> Depending on which CPU the CPUID instruction is executed, some leaves >> can report different values. There are cases where it may be required >> to know all possible values. >> >> E.g. for AMD Zen 4 processors, the ActiveUmcMask field from leaf >> 0x80000022 ECX, which provides a way to determine the active memory >> controllers, can have different masks on CPUs belonging to different >> sockets as each socket can follow a different DIMM population scheme. >> Each memory channel is assigned a memory controller (UMC) and if no >> DIMMs are attached to a channel, the corresponding memory controller >> is inactive. There are performance monitoring counters exclusive to >> each memory controller which need to be represented under separate >> PMUs. So, it will be necessary to know the active memory controllers >> on each socket during the initialization of the UMC PMUs irrespective >> of where the uncore driver's module init runs. >> >> Add a new helper that executes CPUID on a particular CPU and returns >> the EAX, EBX, ECX and EDX values. >> > > So I hate all this for multiple reasons: > > - the wohle foo_on_cpu() model generally leads to atrocious code that > does multiple IPIs, I've seen rdmsr_on_cpu() followed by > wrmsr_on_cpu() and worse things, just don't do this. > > - The whole CPUID thing is insane; we should read CPUID -- all of it -- > *ONCE* at bringup and thereafter never touch the instruction ever > again. It could be people are already working on patches to this > effect. > > - Different CPUID values for different CPUs is a pain :/
Thanks for the clarification. Will remove this.
- Sandipan
| |