Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1427910 > unrolled thread
| Started by | Andi Kleen <andi@firstfloor.org> |
|---|---|
| First post | 2016-06-21 18:10 +0200 |
| Last post | 2016-06-22 14:00 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] x86: Report Intel platform_id in /proc/cpuinfo Andi Kleen <andi@firstfloor.org> - 2016-06-21 18:10 +0200
Re: [PATCH] x86: Report Intel platform_id in /proc/cpuinfo Henrique de Moraes Holschuh <hmh@hmh.eng.br> - 2016-06-22 14:00 +0200
| From | Andi Kleen <andi@firstfloor.org> |
|---|---|
| Date | 2016-06-21 18:10 +0200 |
| Subject | Re: [PATCH] x86: Report Intel platform_id in /proc/cpuinfo |
| Message-ID | <rMwpr-853-7@gated-at.bofh.it> |
Andi Kleen <andi@firstfloor.org> writes:
Ping! Any comments on this patch?
> From: Andi Kleen <ak@linux.intel.com>
>
> We have a need to distinguish systems based on their platform ID.
> For example this is useful to distinguish systems with L4 cache
> versus ones without.
>
> There is a 3 bit identifier (also called processor flags) in
> the IA32_PLATFORM_ID MSR that can give a more fine grained
> identification of the CPU than just the model number/stepping.
>
> IA32_PLATFORM_ID is architectural.
>
> The processor flags are already used in the microcode driver.
> The MSR can be also accessed through /dev/cpu/*/msr, but that
> requires root and is awkward.
>
> This patch just exports the value retrieved by the microcode
> driver in /proc/cpuinfo. If the microcode driver is disabled
> it won't be shown, but that seems reasonable.
>
> v2: Handle 0 platform_id. Fix commit message.
> Cc: hmh@hmh.eng.br
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
> arch/x86/include/asm/processor.h | 2 ++
> arch/x86/kernel/cpu/microcode/intel.c | 2 ++
> arch/x86/kernel/cpu/proc.c | 2 ++
> 3 files changed, 6 insertions(+)
>
> diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
> index 20c11d1..270209c 100644
> --- a/arch/x86/include/asm/processor.h
> +++ b/arch/x86/include/asm/processor.h
> @@ -136,6 +136,8 @@ struct cpuinfo_x86 {
> /* Index into per_cpu list: */
> u16 cpu_index;
> u32 microcode;
> + u32 platform_id;
> + u8 has_platform_id;
> };
>
> #define X86_VENDOR_INTEL 0
> diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
> index ee81c54..bcd3f59 100644
> --- a/arch/x86/kernel/cpu/microcode/intel.c
> +++ b/arch/x86/kernel/cpu/microcode/intel.c
> @@ -812,6 +812,8 @@ static int collect_cpu_info(int cpu_num, struct cpu_signature *csig)
> /* get processor flags from MSR 0x17 */
> rdmsr(MSR_IA32_PLATFORM_ID, val[0], val[1]);
> csig->pf = 1 << ((val[1] >> 18) & 7);
> + cpu_data(cpu_num).platform_id = (val[1] >> 18) & 7;
> + cpu_data(cpu_num).has_platform_id = true;
> }
>
> csig->rev = c->microcode;
> diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
> index 18ca99f..5345d50 100644
> --- a/arch/x86/kernel/cpu/proc.c
> +++ b/arch/x86/kernel/cpu/proc.c
> @@ -76,6 +76,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
> seq_puts(m, "stepping\t: unknown\n");
> if (c->microcode)
> seq_printf(m, "microcode\t: 0x%x\n", c->microcode);
> + if (c->has_platform_id)
> + seq_printf(m, "platform_id\t: %d\n", c->platform_id);
>
> if (cpu_has(c, X86_FEATURE_TSC)) {
> unsigned int freq = cpufreq_quick_get(cpu);
--
ak@linux.intel.com -- Speaking for myself only
[toc] | [next] | [standalone]
| From | Henrique de Moraes Holschuh <hmh@hmh.eng.br> |
|---|---|
| Date | 2016-06-22 14:00 +0200 |
| Message-ID | <rMOZ3-2Tm-1@gated-at.bofh.it> |
| In reply to | #1427910 |
On Tue, Jun 21, 2016, at 13:05, Andi Kleen wrote: > Andi Kleen <andi@firstfloor.org> writes: > > Ping! Any comments on this patch? Well, FWIW, it looks good enough to me. -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web