diff options
author | Jan Beulich <JBeulich@suse.com> | 2013-10-21 04:35:20 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-10-26 07:34:39 -0400 |
commit | 09dc68d958c67c76cf672ec78b7391af453010f8 (patch) | |
tree | 945770f406cb85bc080b37463a75ab30e6f38c88 /arch/x86/kernel/cpu/intel.c | |
parent | 88829dfe4b6ea0c1c24d415668b3bfa78e5a5b16 (diff) |
x86/cpu: Track legacy CPU model data only on 32-bit kernels
struct cpu_dev's c_models is only ever set inside CONFIG_X86_32
conditionals (or code that's being built for 32-bit only), so
there's no use of reserving the (empty) space for the model
names in a 64-bit kernel.
Similarly, c_size_cache is only used in the #else of a
CONFIG_X86_64 conditional, so reserving space for (and in one
case even initializing) that field is pointless for 64-bit
kernels too.
While moving both fields to the end of the structure, I also
noticed that:
- the c_models array size was one too small, potentially causing
table_lookup_model() to return garbage on Intel CPUs (intel.c's
instance was lacking the sentinel with family being zero), so the
patch bumps that by one,
- c_models' vendor sub-field was unused (and anyway redundant
with the base structure's c_x86_vendor field), so the patch deletes it.
Also rename the legacy fields so that their legacy nature stands out
and comment their declarations.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Link: http://lkml.kernel.org/r/5265036802000078000FC4DB@nat28.tlf.novell.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu/intel.c')
-rw-r--r-- | arch/x86/kernel/cpu/intel.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index ec7299566f79..dc1ec0dff939 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
@@ -665,8 +665,8 @@ static const struct cpu_dev intel_cpu_dev = { | |||
665 | .c_vendor = "Intel", | 665 | .c_vendor = "Intel", |
666 | .c_ident = { "GenuineIntel" }, | 666 | .c_ident = { "GenuineIntel" }, |
667 | #ifdef CONFIG_X86_32 | 667 | #ifdef CONFIG_X86_32 |
668 | .c_models = { | 668 | .legacy_models = { |
669 | { .vendor = X86_VENDOR_INTEL, .family = 4, .model_names = | 669 | { .family = 4, .model_names = |
670 | { | 670 | { |
671 | [0] = "486 DX-25/33", | 671 | [0] = "486 DX-25/33", |
672 | [1] = "486 DX-50", | 672 | [1] = "486 DX-50", |
@@ -679,7 +679,7 @@ static const struct cpu_dev intel_cpu_dev = { | |||
679 | [9] = "486 DX/4-WB" | 679 | [9] = "486 DX/4-WB" |
680 | } | 680 | } |
681 | }, | 681 | }, |
682 | { .vendor = X86_VENDOR_INTEL, .family = 5, .model_names = | 682 | { .family = 5, .model_names = |
683 | { | 683 | { |
684 | [0] = "Pentium 60/66 A-step", | 684 | [0] = "Pentium 60/66 A-step", |
685 | [1] = "Pentium 60/66", | 685 | [1] = "Pentium 60/66", |
@@ -690,7 +690,7 @@ static const struct cpu_dev intel_cpu_dev = { | |||
690 | [8] = "Mobile Pentium MMX" | 690 | [8] = "Mobile Pentium MMX" |
691 | } | 691 | } |
692 | }, | 692 | }, |
693 | { .vendor = X86_VENDOR_INTEL, .family = 6, .model_names = | 693 | { .family = 6, .model_names = |
694 | { | 694 | { |
695 | [0] = "Pentium Pro A-step", | 695 | [0] = "Pentium Pro A-step", |
696 | [1] = "Pentium Pro", | 696 | [1] = "Pentium Pro", |
@@ -704,7 +704,7 @@ static const struct cpu_dev intel_cpu_dev = { | |||
704 | [11] = "Pentium III (Tualatin)", | 704 | [11] = "Pentium III (Tualatin)", |
705 | } | 705 | } |
706 | }, | 706 | }, |
707 | { .vendor = X86_VENDOR_INTEL, .family = 15, .model_names = | 707 | { .family = 15, .model_names = |
708 | { | 708 | { |
709 | [0] = "Pentium 4 (Unknown)", | 709 | [0] = "Pentium 4 (Unknown)", |
710 | [1] = "Pentium 4 (Willamette)", | 710 | [1] = "Pentium 4 (Willamette)", |
@@ -714,7 +714,7 @@ static const struct cpu_dev intel_cpu_dev = { | |||
714 | } | 714 | } |
715 | }, | 715 | }, |
716 | }, | 716 | }, |
717 | .c_size_cache = intel_size_cache, | 717 | .legacy_cache_size = intel_size_cache, |
718 | #endif | 718 | #endif |
719 | .c_detect_tlb = intel_detect_tlb, | 719 | .c_detect_tlb = intel_detect_tlb, |
720 | .c_early_init = early_init_intel, | 720 | .c_early_init = early_init_intel, |