All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Report Intel platform_id in /proc/cpuinfo
@ 2016-09-23 18:02 Andi Kleen
  0 siblings, 0 replies; 13+ messages in thread
From: Andi Kleen @ 2016-09-23 18:02 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, Andi Kleen, hmh

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 MSR can be also accessed through /dev/cpu/*/msr, but that
requires root and is awkward.

The patch moves the reading of PLATFORM_INFO from the
(late) microcode driver code into the main intel CPU initialization
path and then also prints it in /proc/cpuinfo

v2: Handle 0 platform_id. Fix commit message.
v3: Move some code to cpu/intel.c
v4: Update description too.
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/intel.c           | 9 +++++++++
 arch/x86/kernel/cpu/microcode/intel.c | 8 ++------
 arch/x86/kernel/cpu/proc.c            | 2 ++
 4 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 63def9537a2d..c1313b3f3e59 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -135,6 +135,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/intel.c b/arch/x86/kernel/cpu/intel.c
index fcd484d2bb03..b9f139716636 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -210,6 +210,15 @@ static void early_init_intel(struct cpuinfo_x86 *c)
 			c->x86_coreid_bits = get_count_order((ebx >> 16) & 0xff);
 	}
 
+	if ((c->x86_model >= 5) || (c->x86 > 6)) {
+		unsigned val[2];
+
+		/* get processor flags from MSR 0x17 */
+		rdmsr(MSR_IA32_PLATFORM_ID, val[0], val[1]);
+		c->platform_id = (val[1] >> 18) & 7;
+		c->has_platform_id = true;
+	}
+
 	check_mpx_erratum(c);
 }
 
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index cdc0deab00c9..fab07e49192e 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -855,17 +855,13 @@ static int collect_cpu_info(int cpu_num, struct cpu_signature *csig)
 {
 	static struct cpu_signature prev;
 	struct cpuinfo_x86 *c = &cpu_data(cpu_num);
-	unsigned int val[2];
 
 	memset(csig, 0, sizeof(*csig));
 
 	csig->sig = cpuid_eax(0x00000001);
 
-	if ((c->x86_model >= 5) || (c->x86 > 6)) {
-		/* get processor flags from MSR 0x17 */
-		rdmsr(MSR_IA32_PLATFORM_ID, val[0], val[1]);
-		csig->pf = 1 << ((val[1] >> 18) & 7);
-	}
+	if (c->has_platform_id)
+		csig->pf = 1 << c->platform_id;
 
 	csig->rev = c->microcode;
 
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index 18ca99f2798b..5345d50ed709 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);
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 13+ messages in thread
* [PATCH] x86: Report Intel platform_id in /proc/cpuinfo
@ 2016-10-18 23:23 Andi Kleen
  0 siblings, 0 replies; 13+ messages in thread
From: Andi Kleen @ 2016-10-18 23:23 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, Andi Kleen, hmh

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 MSR can be also accessed through /dev/cpu/*/msr, but that
requires root and is awkward.

The patch moves the reading of PLATFORM_INFO from the
(late) microcode driver code into the main intel CPU initialization
path and then also prints it in /proc/cpuinfo

v2: Handle 0 platform_id. Fix commit message.
v3: Move some code to cpu/intel.c
v4: Update description too.
v5: Move msr probe code out of line to workaround potential gcc 6 bug.
This fixes booting on all 0day systems.
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/intel.c           | 15 +++++++++++++++
 arch/x86/kernel/cpu/microcode/intel.c |  8 ++------
 arch/x86/kernel/cpu/proc.c            |  2 ++
 4 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 63def9537a2d..c1313b3f3e59 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -135,6 +135,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/intel.c b/arch/x86/kernel/cpu/intel.c
index fcd484d2bb03..7da7f008cee0 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -61,6 +61,19 @@ void check_mpx_erratum(struct cpuinfo_x86 *c)
 	}
 }
 
+/* noinline to work around problem with gcc 6.2 */
+static noinline void probe_platformid(struct cpuinfo_x86 *c)
+{
+	if ((c->x86_model >= 5) || (c->x86 > 6)) {
+		unsigned val[2];
+
+		/* get processor flags from MSR 0x17 */
+		rdmsr(MSR_IA32_PLATFORM_ID, val[0], val[1]);
+		c->platform_id = (val[1] >> 18) & 7;
+		c->has_platform_id = true;
+	}
+}
+
 static void early_init_intel(struct cpuinfo_x86 *c)
 {
 	u64 misc_enable;
@@ -211,6 +224,8 @@ static void early_init_intel(struct cpuinfo_x86 *c)
 	}
 
 	check_mpx_erratum(c);
+
+	probe_platformid(c);
 }
 
 #ifdef CONFIG_X86_32
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index cdc0deab00c9..fab07e49192e 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -855,17 +855,13 @@ static int collect_cpu_info(int cpu_num, struct cpu_signature *csig)
 {
 	static struct cpu_signature prev;
 	struct cpuinfo_x86 *c = &cpu_data(cpu_num);
-	unsigned int val[2];
 
 	memset(csig, 0, sizeof(*csig));
 
 	csig->sig = cpuid_eax(0x00000001);
 
-	if ((c->x86_model >= 5) || (c->x86 > 6)) {
-		/* get processor flags from MSR 0x17 */
-		rdmsr(MSR_IA32_PLATFORM_ID, val[0], val[1]);
-		csig->pf = 1 << ((val[1] >> 18) & 7);
-	}
+	if (c->has_platform_id)
+		csig->pf = 1 << c->platform_id;
 
 	csig->rev = c->microcode;
 
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index 18ca99f2798b..5345d50ed709 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);
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 13+ messages in thread
* [PATCH] x86: Report Intel platform_id in /proc/cpuinfo
@ 2016-09-23  0:48 Andi Kleen
  2016-09-23  8:12 ` Thomas Gleixner
  0 siblings, 1 reply; 13+ messages in thread
From: Andi Kleen @ 2016-09-23  0:48 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, Andi Kleen, hmh

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.
v3: Move some code to cpu/intel.c
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/intel.c           | 9 +++++++++
 arch/x86/kernel/cpu/microcode/intel.c | 8 ++------
 arch/x86/kernel/cpu/proc.c            | 2 ++
 4 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 63def9537a2d..c1313b3f3e59 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -135,6 +135,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/intel.c b/arch/x86/kernel/cpu/intel.c
index fcd484d2bb03..b9f139716636 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -210,6 +210,15 @@ static void early_init_intel(struct cpuinfo_x86 *c)
 			c->x86_coreid_bits = get_count_order((ebx >> 16) & 0xff);
 	}
 
+	if ((c->x86_model >= 5) || (c->x86 > 6)) {
+		unsigned val[2];
+
+		/* get processor flags from MSR 0x17 */
+		rdmsr(MSR_IA32_PLATFORM_ID, val[0], val[1]);
+		c->platform_id = (val[1] >> 18) & 7;
+		c->has_platform_id = true;
+	}
+
 	check_mpx_erratum(c);
 }
 
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index cdc0deab00c9..fab07e49192e 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -855,17 +855,13 @@ static int collect_cpu_info(int cpu_num, struct cpu_signature *csig)
 {
 	static struct cpu_signature prev;
 	struct cpuinfo_x86 *c = &cpu_data(cpu_num);
-	unsigned int val[2];
 
 	memset(csig, 0, sizeof(*csig));
 
 	csig->sig = cpuid_eax(0x00000001);
 
-	if ((c->x86_model >= 5) || (c->x86 > 6)) {
-		/* get processor flags from MSR 0x17 */
-		rdmsr(MSR_IA32_PLATFORM_ID, val[0], val[1]);
-		csig->pf = 1 << ((val[1] >> 18) & 7);
-	}
+	if (c->has_platform_id)
+		csig->pf = 1 << c->platform_id;
 
 	csig->rev = c->microcode;
 
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index 18ca99f2798b..5345d50ed709 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);
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 13+ messages in thread
* [PATCH] x86: Report Intel platform_id in /proc/cpuinfo
@ 2016-06-02 15:51 Andi Kleen
  2016-06-21 16:05 ` Andi Kleen
  2016-09-21 12:30 ` Thomas Gleixner
  0 siblings, 2 replies; 13+ messages in thread
From: Andi Kleen @ 2016-06-02 15:51 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, Andi Kleen, hmh

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);
-- 
2.8.3

^ permalink raw reply related	[flat|nested] 13+ messages in thread
* [PATCH] x86: Report Intel platform_id in /proc/cpuinfo
@ 2016-05-31 21:24 Andi Kleen
  2016-06-02 18:27 ` Henrique de Moraes Holschuh
  0 siblings, 1 reply; 13+ messages in thread
From: Andi Kleen @ 2016-05-31 21:24 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, Andi Kleen

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 5 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.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/include/asm/processor.h      | 1 +
 arch/x86/kernel/cpu/microcode/intel.c | 1 +
 arch/x86/kernel/cpu/proc.c            | 2 ++
 3 files changed, 4 insertions(+)

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 20c11d1..bc4b0ef 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -136,6 +136,7 @@ struct cpuinfo_x86 {
 	/* Index into per_cpu list: */
 	u16			cpu_index;
 	u32			microcode;
+	u32			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..6244a88 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -812,6 +812,7 @@ 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;
 	}
 
 	csig->rev = c->microcode;
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index 18ca99f..1c4e4f5 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->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);
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread
* [PATCH] x86: Report Intel platform_id in /proc/cpuinfo
@ 2016-05-05 10:12 Andi Kleen
  2016-05-06 12:42 ` Henrique de Moraes Holschuh
  0 siblings, 1 reply; 13+ messages in thread
From: Andi Kleen @ 2016-05-05 10:12 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel, Andi Kleen

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 5 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.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/include/asm/processor.h      | 1 +
 arch/x86/kernel/cpu/microcode/intel.c | 1 +
 arch/x86/kernel/cpu/proc.c            | 2 ++
 3 files changed, 4 insertions(+)

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 20c11d1..bc4b0ef 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -136,6 +136,7 @@ struct cpuinfo_x86 {
 	/* Index into per_cpu list: */
 	u16			cpu_index;
 	u32			microcode;
+	u32			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..6244a88 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -812,6 +812,7 @@ 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;
 	}
 
 	csig->rev = c->microcode;
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index 18ca99f..1c4e4f5 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->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);
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-10-18 23:23 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-23 18:02 [PATCH] x86: Report Intel platform_id in /proc/cpuinfo Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2016-10-18 23:23 Andi Kleen
2016-09-23  0:48 Andi Kleen
2016-09-23  8:12 ` Thomas Gleixner
2016-06-02 15:51 Andi Kleen
2016-06-21 16:05 ` Andi Kleen
2016-06-22 11:54   ` Henrique de Moraes Holschuh
2016-09-21 12:30 ` Thomas Gleixner
2016-05-31 21:24 Andi Kleen
2016-06-02 18:27 ` Henrique de Moraes Holschuh
2016-06-02 22:54   ` Andi Kleen
2016-05-05 10:12 Andi Kleen
2016-05-06 12:42 ` Henrique de Moraes Holschuh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.