aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatalina Mocanu <catalina.mocanu@gmail.com>2014-10-24 02:09:55 +0300
committerJosh Triplett <josh@joshtriplett.org>2014-10-29 16:50:58 -0700
commit466f883656c8abbb72dcbaa96d2cb98535f40ddd (patch)
tree7be4758348d09c965e7ca6c5a35d252ada172e51
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
downloadlinux-tiny/no-legacy-cpu-model-names.tar.gz
arch: x86: Introduce new config for CPU legacy model namestiny/no-legacy-cpu-model-names
Add a new config X86_MODEL_TABLE to compile out the legacy model tables for 32bit systems in order to save space. The new config depends on X86_32 and PROC_FS. Model names tables for CPUs that do not have the brand-string CPUIDs (0x80000002-0x80000004) are kept in field legacy_model in struct cpu_dev. Previously, this field was wrapped inside ifdef CONFIG_X86_32. This patch moves this field inside ifdef CONFIG_X86_MODEL_TABLE so that it can be compiled out on x86-32 systems too. bloat-o-meter output: add/remove: 0/0 grow/shrink: 0/9 up/down: 0/-2780 (-2780) function old new delta identify_cpu 777 717 -60 umc_cpu_dev 380 40 -340 transmeta_cpu_dev 380 40 -340 nsc_cpu_dev 380 40 -340 intel_cpu_dev 380 40 -340 default_cpu 380 40 -340 cyrix_cpu_dev 380 40 -340 centaur_cpu_dev 380 40 -340 amd_cpu_dev 380 40 -340 Signed-off-by: Catalina Mocanu <catalina.mocanu@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Josh Triplett <josh@joshtriplett.org>
-rw-r--r--arch/x86/Kconfig10
-rw-r--r--arch/x86/kernel/cpu/amd.c4
-rw-r--r--arch/x86/kernel/cpu/common.c2
-rw-r--r--arch/x86/kernel/cpu/cpu.h3
-rw-r--r--arch/x86/kernel/cpu/intel.c4
-rw-r--r--arch/x86/kernel/cpu/umc.c2
6 files changed, 21 insertions, 4 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index f2327e88e07cc6..72ed8c2dc3fcb6 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -314,6 +314,16 @@ config SMP
If you don't know what to do here, say N.
+config X86_MODEL_TABLE
+ bool "Enable X86 CPU model names table for 32bit systems"
+ depends on X86_32 && PROC_FS
+ default y
+ help
+ This option provides tables of model names for CPUs that do
+ not have the brand-string CPUIDs (0x80000002 through 0x80000004).
+
+ If you want to save space on a 32bit system, set this option to n.
+
config X86_FEATURE_NAMES
bool "Processor feature human-readable names" if EMBEDDED
default y
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 813d29d00a175c..1e8f9ab21d2bdb 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -783,7 +783,7 @@ static void cpu_detect_tlb_amd(struct cpuinfo_x86 *c)
static const struct cpu_dev amd_cpu_dev = {
.c_vendor = "AMD",
.c_ident = { "AuthenticAMD" },
-#ifdef CONFIG_X86_32
+#ifdef CONFIG_X86_MODEL_TABLE
.legacy_models = {
{ .family = 4, .model_names =
{
@@ -796,6 +796,8 @@ static const struct cpu_dev amd_cpu_dev = {
}
},
},
+#endif
+#ifdef CONFIG_X86_32
.legacy_cache_size = amd_size_cache,
#endif
.c_early_init = early_init_amd,
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 4b4f78c9ba1902..b770c5428560cb 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -361,7 +361,7 @@ static void filter_cpuid_features(struct cpuinfo_x86 *c, bool warn)
/* Look up CPU names by table lookup. */
static const char *table_lookup_model(struct cpuinfo_x86 *c)
{
-#ifdef CONFIG_X86_32
+#ifdef CONFIG_X86_MODEL_TABLE
const struct legacy_cpu_model_info *info;
if (c->x86_model >= 16)
diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h
index c37dc37e8317f1..ff2a55ea132d8c 100644
--- a/arch/x86/kernel/cpu/cpu.h
+++ b/arch/x86/kernel/cpu/cpu.h
@@ -18,7 +18,8 @@ struct cpu_dev {
/* Optional vendor specific routine to obtain the cache size. */
unsigned int (*legacy_cache_size)(struct cpuinfo_x86 *,
unsigned int);
-
+#endif
+#ifdef CONFIG_X86_MODEL_TABLE
/* Family/stepping-based lookup table for model names. */
struct legacy_cpu_model_info {
int family;
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 1ef456273172c8..06d90efd75f3ea 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -692,7 +692,7 @@ static void intel_detect_tlb(struct cpuinfo_x86 *c)
static const struct cpu_dev intel_cpu_dev = {
.c_vendor = "Intel",
.c_ident = { "GenuineIntel" },
-#ifdef CONFIG_X86_32
+#ifdef CONFIG_X86_MODEL_TABLE
.legacy_models = {
{ .family = 4, .model_names =
{
@@ -743,6 +743,8 @@ static const struct cpu_dev intel_cpu_dev = {
}
},
},
+#endif
+#ifdef CONFIG_X86_32
.legacy_cache_size = intel_size_cache,
#endif
.c_detect_tlb = intel_detect_tlb,
diff --git a/arch/x86/kernel/cpu/umc.c b/arch/x86/kernel/cpu/umc.c
index ef9c2a0078bd66..b9ecbbfa51222a 100644
--- a/arch/x86/kernel/cpu/umc.c
+++ b/arch/x86/kernel/cpu/umc.c
@@ -10,6 +10,7 @@
static const struct cpu_dev umc_cpu_dev = {
.c_vendor = "UMC",
.c_ident = { "UMC UMC UMC" },
+#ifdef CONFIG_X86_MODEL_TABLE
.legacy_models = {
{ .family = 4, .model_names =
{
@@ -18,6 +19,7 @@ static const struct cpu_dev umc_cpu_dev = {
}
},
},
+#endif
.c_x86_vendor = X86_VENDOR_UMC,
};