mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86, cpu: mv display_cacheinfo -> cpu_detect_cache_sizes
@ 2009-11-21 10:18 Borislav Petkov
  2009-11-21 12:05 ` Rakib Mullick
  0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2009-11-21 10:18 UTC (permalink / raw)
  To: mingo; +Cc: x86, linux-kernel

display_cacheinfo() doesn't display anything anymore and it is solely
used to detect CPU cache sizes for /proc/cpuinfo. Rename it accordingly.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
 arch/x86/kernel/cpu/amd.c       |    2 +-
 arch/x86/kernel/cpu/centaur.c   |    2 +-
 arch/x86/kernel/cpu/common.c    |    4 ++--
 arch/x86/kernel/cpu/cpu.h       |    2 +-
 arch/x86/kernel/cpu/cyrix.c     |    2 +-
 arch/x86/kernel/cpu/transmeta.c |    2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index c910a71..7128b37 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -535,7 +535,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
 		}
 	}
 
-	display_cacheinfo(c);
+	cpu_detect_cache_sizes(c);
 
 	/* Multi core CPU? */
 	if (c->extended_cpuid_level >= 0x80000008) {
diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c
index c95e831..e58d978 100644
--- a/arch/x86/kernel/cpu/centaur.c
+++ b/arch/x86/kernel/cpu/centaur.c
@@ -294,7 +294,7 @@ static void __cpuinit init_c3(struct cpuinfo_x86 *c)
 		set_cpu_cap(c, X86_FEATURE_REP_GOOD);
 	}
 
-	display_cacheinfo(c);
+	cpu_detect_cache_sizes(c);
 }
 
 enum {
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 61242a5..9bf845d 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -61,7 +61,7 @@ void __init setup_cpu_local_masks(void)
 static void __cpuinit default_init(struct cpuinfo_x86 *c)
 {
 #ifdef CONFIG_X86_64
-	display_cacheinfo(c);
+	cpu_detect_cache_sizes(c);
 #else
 	/* Not much we can do here... */
 	/* Check if at least it has cpuid */
@@ -383,7 +383,7 @@ static void __cpuinit get_model_name(struct cpuinfo_x86 *c)
 	}
 }
 
-void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c)
+void __cpuinit cpu_detect_cache_sizes(struct cpuinfo_x86 *c)
 {
 	unsigned int n, dummy, ebx, ecx, edx, l2size;
 
diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h
index 6de9a90..3624e8a 100644
--- a/arch/x86/kernel/cpu/cpu.h
+++ b/arch/x86/kernel/cpu/cpu.h
@@ -32,6 +32,6 @@ struct cpu_dev {
 extern const struct cpu_dev *const __x86_cpu_dev_start[],
 			    *const __x86_cpu_dev_end[];
 
-extern void display_cacheinfo(struct cpuinfo_x86 *c);
+extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
 
 #endif
diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
index 19807b8..4fbd384 100644
--- a/arch/x86/kernel/cpu/cyrix.c
+++ b/arch/x86/kernel/cpu/cyrix.c
@@ -373,7 +373,7 @@ static void __cpuinit init_nsc(struct cpuinfo_x86 *c)
 	/* Handle the GX (Formally known as the GX2) */
 
 	if (c->x86 == 5 && c->x86_model == 5)
-		display_cacheinfo(c);
+		cpu_detect_cache_sizes(c);
 	else
 		init_cyrix(c);
 }
diff --git a/arch/x86/kernel/cpu/transmeta.c b/arch/x86/kernel/cpu/transmeta.c
index bb62b3e..2800074 100644
--- a/arch/x86/kernel/cpu/transmeta.c
+++ b/arch/x86/kernel/cpu/transmeta.c
@@ -26,7 +26,7 @@ static void __cpuinit init_transmeta(struct cpuinfo_x86 *c)
 
 	early_init_transmeta(c);
 
-	display_cacheinfo(c);
+	cpu_detect_cache_sizes(c);
 
 	/* Print CMS and CPU revision */
 	max = cpuid_eax(0x80860000);
-- 
1.6.5


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

* Re: [PATCH] x86, cpu: mv display_cacheinfo -> cpu_detect_cache_sizes
  2009-11-21 10:18 [PATCH] x86, cpu: mv display_cacheinfo -> cpu_detect_cache_sizes Borislav Petkov
@ 2009-11-21 12:05 ` Rakib Mullick
  2009-11-21 13:01   ` Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Rakib Mullick @ 2009-11-21 12:05 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: mingo, x86, linux-kernel

On 11/21/09, Borislav Petkov <petkovbb@googlemail.com> wrote:
> display_cacheinfo() doesn't display anything anymore and it is solely
>  used to detect CPU cache sizes for /proc/cpuinfo. Rename it accordingly.
>
Hi Borislav,

If it is only displays cache sizes for /proc/cpuinfo, then we need to check
#ifdef CONFIG_PROC_FS , isn't it?

>  Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
>  ---
>   arch/x86/kernel/cpu/amd.c       |    2 +-
>   arch/x86/kernel/cpu/centaur.c   |    2 +-
>   arch/x86/kernel/cpu/common.c    |    4 ++--
>   arch/x86/kernel/cpu/cpu.h       |    2 +-
>   arch/x86/kernel/cpu/cyrix.c     |    2 +-
>   arch/x86/kernel/cpu/transmeta.c |    2 +-
>   6 files changed, 7 insertions(+), 7 deletions(-)
>
>  diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
>  index c910a71..7128b37 100644
>  --- a/arch/x86/kernel/cpu/amd.c
>  +++ b/arch/x86/kernel/cpu/amd.c
>  @@ -535,7 +535,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
>                 }
>         }
>
>  -       display_cacheinfo(c);
>  +       cpu_detect_cache_sizes(c);
>
>         /* Multi core CPU? */
>         if (c->extended_cpuid_level >= 0x80000008) {
>  diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c
>  index c95e831..e58d978 100644
>  --- a/arch/x86/kernel/cpu/centaur.c
>  +++ b/arch/x86/kernel/cpu/centaur.c
>  @@ -294,7 +294,7 @@ static void __cpuinit init_c3(struct cpuinfo_x86 *c)
>                 set_cpu_cap(c, X86_FEATURE_REP_GOOD);
>         }
>
>  -       display_cacheinfo(c);
>  +       cpu_detect_cache_sizes(c);
>   }
>
>   enum {
>  diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
>  index 61242a5..9bf845d 100644
>  --- a/arch/x86/kernel/cpu/common.c
>  +++ b/arch/x86/kernel/cpu/common.c
>  @@ -61,7 +61,7 @@ void __init setup_cpu_local_masks(void)
>   static void __cpuinit default_init(struct cpuinfo_x86 *c)
>   {
>   #ifdef CONFIG_X86_64
>  -       display_cacheinfo(c);
>  +       cpu_detect_cache_sizes(c);
>   #else
>         /* Not much we can do here... */
>         /* Check if at least it has cpuid */
>  @@ -383,7 +383,7 @@ static void __cpuinit get_model_name(struct cpuinfo_x86 *c)
>         }
>   }
>
>  -void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c)
>  +void __cpuinit cpu_detect_cache_sizes(struct cpuinfo_x86 *c)
>   {
>         unsigned int n, dummy, ebx, ecx, edx, l2size;
>
>  diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h
>  index 6de9a90..3624e8a 100644
>  --- a/arch/x86/kernel/cpu/cpu.h
>  +++ b/arch/x86/kernel/cpu/cpu.h
>  @@ -32,6 +32,6 @@ struct cpu_dev {
>   extern const struct cpu_dev *const __x86_cpu_dev_start[],
>                             *const __x86_cpu_dev_end[];
>
>  -extern void display_cacheinfo(struct cpuinfo_x86 *c);
>  +extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
>
>   #endif
>  diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
>  index 19807b8..4fbd384 100644
>  --- a/arch/x86/kernel/cpu/cyrix.c
>  +++ b/arch/x86/kernel/cpu/cyrix.c
>  @@ -373,7 +373,7 @@ static void __cpuinit init_nsc(struct cpuinfo_x86 *c)
>         /* Handle the GX (Formally known as the GX2) */
>
>         if (c->x86 == 5 && c->x86_model == 5)
>  -               display_cacheinfo(c);
>  +               cpu_detect_cache_sizes(c);
>         else
>                 init_cyrix(c);
>   }
>  diff --git a/arch/x86/kernel/cpu/transmeta.c b/arch/x86/kernel/cpu/transmeta.c
>  index bb62b3e..2800074 100644
>  --- a/arch/x86/kernel/cpu/transmeta.c
>  +++ b/arch/x86/kernel/cpu/transmeta.c
>  @@ -26,7 +26,7 @@ static void __cpuinit init_transmeta(struct cpuinfo_x86 *c)
>
>         early_init_transmeta(c);
>
>  -       display_cacheinfo(c);
>  +       cpu_detect_cache_sizes(c);
>
>         /* Print CMS and CPU revision */
>         max = cpuid_eax(0x80860000);
>  --
>  1.6.5
>
>
>  --
>  To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>  the body of a message to majordomo@vger.kernel.org
>  More majordomo info at  http://vger.kernel.org/majordomo-info.html
>  Please read the FAQ at  http://www.tux.org/lkml/
>

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

* Re: [PATCH] x86, cpu: mv display_cacheinfo -> cpu_detect_cache_sizes
  2009-11-21 12:05 ` Rakib Mullick
@ 2009-11-21 13:01   ` Borislav Petkov
  2009-11-23 20:06     ` [tip:x86/debug] " tip-bot for Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2009-11-21 13:01 UTC (permalink / raw)
  To: Rakib Mullick; +Cc: mingo, x86, linux-kernel

Hi Rakib,

On Sat, Nov 21, 2009 at 06:05:52PM +0600, Rakib Mullick wrote:
> > display_cacheinfo() doesn't display anything anymore and it is solely
> >  used to detect CPU cache sizes for /proc/cpuinfo. Rename it accordingly.
> If it is only displays cache sizes for /proc/cpuinfo, then we need to check
> #ifdef CONFIG_PROC_FS , isn't it?

well, I was grepping for all the places where c->x86_cache_size
and c->x86_tlbsize are being used and have missed the location
arch/x86/kernel/cpu/intel_cacheinfo.c:amd_cpuid4() where
current_cpu_data.x86_cache_size is being read so we can't make it
dependent on PROC_FS.

Sorry for misleading you, here's a corrected version:

--
From: Borislav Petkov <petkovbb@gmail.com>
Date: Wed, 18 Nov 2009 19:01:28 +0100
Subject: [PATCH] x86, cpu: mv display_cacheinfo -> cpu_detect_cache_sizes

display_cacheinfo() doesn't display anything anymore and it is used to
detect CPU cache sizes. Rename it accordingly.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
 arch/x86/kernel/cpu/amd.c       |    2 +-
 arch/x86/kernel/cpu/centaur.c   |    2 +-
 arch/x86/kernel/cpu/common.c    |    4 ++--
 arch/x86/kernel/cpu/cpu.h       |    2 +-
 arch/x86/kernel/cpu/cyrix.c     |    2 +-
 arch/x86/kernel/cpu/transmeta.c |    2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index c910a71..7128b37 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -535,7 +535,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
 		}
 	}
 
-	display_cacheinfo(c);
+	cpu_detect_cache_sizes(c);
 
 	/* Multi core CPU? */
 	if (c->extended_cpuid_level >= 0x80000008) {
diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c
index c95e831..e58d978 100644
--- a/arch/x86/kernel/cpu/centaur.c
+++ b/arch/x86/kernel/cpu/centaur.c
@@ -294,7 +294,7 @@ static void __cpuinit init_c3(struct cpuinfo_x86 *c)
 		set_cpu_cap(c, X86_FEATURE_REP_GOOD);
 	}
 
-	display_cacheinfo(c);
+	cpu_detect_cache_sizes(c);
 }
 
 enum {
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 61242a5..9bf845d 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -61,7 +61,7 @@ void __init setup_cpu_local_masks(void)
 static void __cpuinit default_init(struct cpuinfo_x86 *c)
 {
 #ifdef CONFIG_X86_64
-	display_cacheinfo(c);
+	cpu_detect_cache_sizes(c);
 #else
 	/* Not much we can do here... */
 	/* Check if at least it has cpuid */
@@ -383,7 +383,7 @@ static void __cpuinit get_model_name(struct cpuinfo_x86 *c)
 	}
 }
 
-void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c)
+void __cpuinit cpu_detect_cache_sizes(struct cpuinfo_x86 *c)
 {
 	unsigned int n, dummy, ebx, ecx, edx, l2size;
 
diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h
index 6de9a90..3624e8a 100644
--- a/arch/x86/kernel/cpu/cpu.h
+++ b/arch/x86/kernel/cpu/cpu.h
@@ -32,6 +32,6 @@ struct cpu_dev {
 extern const struct cpu_dev *const __x86_cpu_dev_start[],
 			    *const __x86_cpu_dev_end[];
 
-extern void display_cacheinfo(struct cpuinfo_x86 *c);
+extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
 
 #endif
diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
index 19807b8..4fbd384 100644
--- a/arch/x86/kernel/cpu/cyrix.c
+++ b/arch/x86/kernel/cpu/cyrix.c
@@ -373,7 +373,7 @@ static void __cpuinit init_nsc(struct cpuinfo_x86 *c)
 	/* Handle the GX (Formally known as the GX2) */
 
 	if (c->x86 == 5 && c->x86_model == 5)
-		display_cacheinfo(c);
+		cpu_detect_cache_sizes(c);
 	else
 		init_cyrix(c);
 }
diff --git a/arch/x86/kernel/cpu/transmeta.c b/arch/x86/kernel/cpu/transmeta.c
index bb62b3e..2800074 100644
--- a/arch/x86/kernel/cpu/transmeta.c
+++ b/arch/x86/kernel/cpu/transmeta.c
@@ -26,7 +26,7 @@ static void __cpuinit init_transmeta(struct cpuinfo_x86 *c)
 
 	early_init_transmeta(c);
 
-	display_cacheinfo(c);
+	cpu_detect_cache_sizes(c);
 
 	/* Print CMS and CPU revision */
 	max = cpuid_eax(0x80860000);
-- 
1.6.5

-- 
Regards/Gruss,
    Boris.

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

* [tip:x86/debug] x86, cpu: mv display_cacheinfo -> cpu_detect_cache_sizes
  2009-11-21 13:01   ` Borislav Petkov
@ 2009-11-23 20:06     ` tip-bot for Borislav Petkov
  0 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Borislav Petkov @ 2009-11-23 20:06 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, petkovbb, tglx, petkovbb

Commit-ID:  27c13ecec4d8856687b50b959e1146845b478f95
Gitweb:     http://git.kernel.org/tip/27c13ecec4d8856687b50b959e1146845b478f95
Author:     Borislav Petkov <petkovbb@googlemail.com>
AuthorDate: Sat, 21 Nov 2009 14:01:45 +0100
Committer:  H. Peter Anvin <hpa@zytor.com>
CommitDate: Mon, 23 Nov 2009 11:59:53 -0800

x86, cpu: mv display_cacheinfo -> cpu_detect_cache_sizes

display_cacheinfo() doesn't display anything anymore and it is used to
detect CPU cache sizes. Rename it accordingly.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
LKML-Reference: <20091121130145.GA31357@liondog.tnic>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
 arch/x86/kernel/cpu/amd.c       |    2 +-
 arch/x86/kernel/cpu/centaur.c   |    2 +-
 arch/x86/kernel/cpu/common.c    |    4 ++--
 arch/x86/kernel/cpu/cpu.h       |    2 +-
 arch/x86/kernel/cpu/cyrix.c     |    2 +-
 arch/x86/kernel/cpu/transmeta.c |    2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index c910a71..7128b37 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -535,7 +535,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
 		}
 	}
 
-	display_cacheinfo(c);
+	cpu_detect_cache_sizes(c);
 
 	/* Multi core CPU? */
 	if (c->extended_cpuid_level >= 0x80000008) {
diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c
index c95e831..e58d978 100644
--- a/arch/x86/kernel/cpu/centaur.c
+++ b/arch/x86/kernel/cpu/centaur.c
@@ -294,7 +294,7 @@ static void __cpuinit init_c3(struct cpuinfo_x86 *c)
 		set_cpu_cap(c, X86_FEATURE_REP_GOOD);
 	}
 
-	display_cacheinfo(c);
+	cpu_detect_cache_sizes(c);
 }
 
 enum {
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 61242a5..9bf845d 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -61,7 +61,7 @@ void __init setup_cpu_local_masks(void)
 static void __cpuinit default_init(struct cpuinfo_x86 *c)
 {
 #ifdef CONFIG_X86_64
-	display_cacheinfo(c);
+	cpu_detect_cache_sizes(c);
 #else
 	/* Not much we can do here... */
 	/* Check if at least it has cpuid */
@@ -383,7 +383,7 @@ static void __cpuinit get_model_name(struct cpuinfo_x86 *c)
 	}
 }
 
-void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c)
+void __cpuinit cpu_detect_cache_sizes(struct cpuinfo_x86 *c)
 {
 	unsigned int n, dummy, ebx, ecx, edx, l2size;
 
diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h
index 6de9a90..3624e8a 100644
--- a/arch/x86/kernel/cpu/cpu.h
+++ b/arch/x86/kernel/cpu/cpu.h
@@ -32,6 +32,6 @@ struct cpu_dev {
 extern const struct cpu_dev *const __x86_cpu_dev_start[],
 			    *const __x86_cpu_dev_end[];
 
-extern void display_cacheinfo(struct cpuinfo_x86 *c);
+extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
 
 #endif
diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
index 19807b8..4fbd384 100644
--- a/arch/x86/kernel/cpu/cyrix.c
+++ b/arch/x86/kernel/cpu/cyrix.c
@@ -373,7 +373,7 @@ static void __cpuinit init_nsc(struct cpuinfo_x86 *c)
 	/* Handle the GX (Formally known as the GX2) */
 
 	if (c->x86 == 5 && c->x86_model == 5)
-		display_cacheinfo(c);
+		cpu_detect_cache_sizes(c);
 	else
 		init_cyrix(c);
 }
diff --git a/arch/x86/kernel/cpu/transmeta.c b/arch/x86/kernel/cpu/transmeta.c
index bb62b3e..2800074 100644
--- a/arch/x86/kernel/cpu/transmeta.c
+++ b/arch/x86/kernel/cpu/transmeta.c
@@ -26,7 +26,7 @@ static void __cpuinit init_transmeta(struct cpuinfo_x86 *c)
 
 	early_init_transmeta(c);
 
-	display_cacheinfo(c);
+	cpu_detect_cache_sizes(c);
 
 	/* Print CMS and CPU revision */
 	max = cpuid_eax(0x80860000);

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

end of thread, other threads:[~2009-11-23 20:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-21 10:18 [PATCH] x86, cpu: mv display_cacheinfo -> cpu_detect_cache_sizes Borislav Petkov
2009-11-21 12:05 ` Rakib Mullick
2009-11-21 13:01   ` Borislav Petkov
2009-11-23 20:06     ` [tip:x86/debug] " tip-bot for Borislav Petkov

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®