public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -tip] x86: cpu/proc.c grouping of cpuid in /proc/cpuinfo
@ 2009-05-10  7:40 Jaswinder Singh Rajput
  2009-05-11  4:18 ` H. Peter Anvin
  0 siblings, 1 reply; 3+ messages in thread
From: Jaswinder Singh Rajput @ 2009-05-10  7:40 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin, x86 maintainers, LKML

Unification of cpuid_level.
Also added extended_cpuid_level to make it complete.

So cpuid* and cpufeature flag come in same group and /proc/cpuinfo
looks like on AMD box:

cpuid level     : 1
ext cpuid level : 0x8000001a
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow constant_tsc rep_good nonstop_tsc pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy 3dnowprefetch osvw skinit

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
 arch/x86/kernel/cpu/proc.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index 523bf39..f63e968 100644
--- a/arch/x86/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
@@ -38,7 +38,6 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
 		   "coma_bug\t: %s\n"
 		   "fpu\t\t: %s\n"
 		   "fpu_exception\t: %s\n"
-		   "cpuid level\t: %d\n"
 		   "wp\t\t: %s\n",
 		   c->fdiv_bug ? "yes" : "no",
 		   c->hlt_works_ok ? "no" : "yes",
@@ -46,7 +45,6 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
 		   c->coma_bug ? "yes" : "no",
 		   c->hard_math ? "yes" : "no",
 		   fpu_exception ? "yes" : "no",
-		   c->cpuid_level,
 		   c->wp_works_ok ? "yes" : "no");
 }
 #else
@@ -55,9 +53,7 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
 	seq_printf(m,
 		   "fpu\t\t: yes\n"
 		   "fpu_exception\t: yes\n"
-		   "cpuid level\t: %d\n"
-		   "wp\t\t: yes\n",
-		   c->cpuid_level);
+		   "wp\t\t: yes\n");
 }
 #endif
 
@@ -102,7 +98,11 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 	show_cpuinfo_core(m, c, cpu);
 	show_cpuinfo_misc(m, c);
 
-	seq_printf(m, "flags\t\t:");
+	seq_printf(m, "cpuid level\t: %d\n"
+		   "ext cpuid level\t: 0x%x\n"
+		   "flags\t\t:",
+		   c->cpuid_level,
+		   c->extended_cpuid_level);
 	for (i = 0; i < 32*NCAPINTS; i++)
 		if (cpu_has(c, i) && x86_cap_flags[i] != NULL)
 			seq_printf(m, " %s", x86_cap_flags[i]);
-- 
1.6.0.6




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

* Re: [PATCH -tip] x86: cpu/proc.c grouping of cpuid in /proc/cpuinfo
  2009-05-10  7:40 [PATCH -tip] x86: cpu/proc.c grouping of cpuid in /proc/cpuinfo Jaswinder Singh Rajput
@ 2009-05-11  4:18 ` H. Peter Anvin
  2009-05-11  6:27   ` Jaswinder Singh Rajput
  0 siblings, 1 reply; 3+ messages in thread
From: H. Peter Anvin @ 2009-05-11  4:18 UTC (permalink / raw)
  To: Jaswinder Singh Rajput; +Cc: Ingo Molnar, x86 maintainers, LKML

Jaswinder Singh Rajput wrote:
> Unification of cpuid_level.
> Also added extended_cpuid_level to make it complete.
> 
> So cpuid* and cpufeature flag come in same group and /proc/cpuinfo
> looks like on AMD box:
> 
> cpuid level     : 1
> ext cpuid level : 0x8000001a
> flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow constant_tsc rep_good nonstop_tsc pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy 3dnowprefetch osvw skinit
> 
> Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>

Jaswinder,

/proc/cpuinfo is a userspace API.  You CANNOT change the format of it
without breaking applications.

Therefore, any change which moves flags between fields or removes fields
is unacceptable.  Adding new fields is possible, however.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


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

* Re: [PATCH -tip] x86: cpu/proc.c grouping of cpuid in /proc/cpuinfo
  2009-05-11  4:18 ` H. Peter Anvin
@ 2009-05-11  6:27   ` Jaswinder Singh Rajput
  0 siblings, 0 replies; 3+ messages in thread
From: Jaswinder Singh Rajput @ 2009-05-11  6:27 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Ingo Molnar, x86 maintainers, LKML

On Sun, 2009-05-10 at 21:18 -0700, H. Peter Anvin wrote:
> Jaswinder Singh Rajput wrote:
> > Unification of cpuid_level.
> > Also added extended_cpuid_level to make it complete.
> > 
> > So cpuid* and cpufeature flag come in same group and /proc/cpuinfo
> > looks like on AMD box:
> > 
> > cpuid level     : 1
> > ext cpuid level : 0x8000001a
> > flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow constant_tsc rep_good nonstop_tsc pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy 3dnowprefetch osvw skinit
> > 
> > Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
> 
> Jaswinder,
> 
> /proc/cpuinfo is a userspace API.  You CANNOT change the format of it
> without breaking applications.
> 
> Therefore, any change which moves flags between fields or removes fields
> is unacceptable.  Adding new fields is possible, however.
> 

Here are 2 patches for adding new field extended_cpuid_level, please
choose PATCH whichever is more appropriate:

PATCH 1:
Subject: [PATCH] x86: cpu/proc.c adding extended_cpuid_level for /proc/cpuinfo

extended_cpuid_level also gives useful information like cpuid_level
and very useful for AMD processors.

Adding extended_cpuid_level in /proc/cpuinfo completes cpuid_level info.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
 arch/x86/kernel/cpu/proc.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index 523bf39..1279e16 100644
--- a/arch/x86/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
@@ -39,6 +39,7 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
 		   "fpu\t\t: %s\n"
 		   "fpu_exception\t: %s\n"
 		   "cpuid level\t: %d\n"
+		   "ext cpuid level\t: 0x%x\n"
 		   "wp\t\t: %s\n",
 		   c->fdiv_bug ? "yes" : "no",
 		   c->hlt_works_ok ? "no" : "yes",
@@ -47,6 +48,7 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
 		   c->hard_math ? "yes" : "no",
 		   fpu_exception ? "yes" : "no",
 		   c->cpuid_level,
+		   c->extended_cpuid_level,
 		   c->wp_works_ok ? "yes" : "no");
 }
 #else
@@ -56,8 +58,10 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
 		   "fpu\t\t: yes\n"
 		   "fpu_exception\t: yes\n"
 		   "cpuid level\t: %d\n"
+		   "ext cpuid level\t: 0x%x\n"
 		   "wp\t\t: yes\n",
-		   c->cpuid_level);
+		   c->cpuid_level,
+		   c->extended_cpuid_level);
 }
 #endif
 
-- 
1.6.0.6


OR

PATCH 2:
Subject: [PATCH] x86: cpu/proc.c adding extended_cpuid_level for /proc/cpuinfo

extended_cpuid_level also gives useful information like cpuid_level
and very useful for AMD processors.

Adding extended_cpuid_level in /proc/cpuinfo completes cpuid_level info.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
 arch/x86/kernel/cpu/proc.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index 523bf39..a965bf7 100644
--- a/arch/x86/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
@@ -102,7 +102,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 	show_cpuinfo_core(m, c, cpu);
 	show_cpuinfo_misc(m, c);
 
-	seq_printf(m, "flags\t\t:");
+	seq_printf(m, "ext cpuid level\t: 0x%x\n"
+		   "flags\t\t:",
+		   c->extended_cpuid_level);
 	for (i = 0; i < 32*NCAPINTS; i++)
 		if (cpu_has(c, i) && x86_cap_flags[i] != NULL)
 			seq_printf(m, " %s", x86_cap_flags[i]);
-- 
1.6.0.6




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

end of thread, other threads:[~2009-05-11  6:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-10  7:40 [PATCH -tip] x86: cpu/proc.c grouping of cpuid in /proc/cpuinfo Jaswinder Singh Rajput
2009-05-11  4:18 ` H. Peter Anvin
2009-05-11  6:27   ` Jaswinder Singh Rajput

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox