diff options
author | Bryan O'Donoghue <pure.logic@nexus-software.ie> | 2014-10-06 20:19:49 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-10-08 04:07:46 -0400 |
commit | aece118e487a744eafcdd0c77fe32b55ee2092a1 (patch) | |
tree | 7337537ec6b93cf6580711bd39520d8f5a37d9bb | |
parent | 2075244f9b871f18a007935c73d2ab49d4fb43e0 (diff) |
x86: Add cpu_detect_cache_sizes to init_intel() add Quark legacy_cache()
Intel processors which don't report cache information via cpuid(2)
or cpuid(4) need quirk code in the legacy_cache_size callback to
report this data. For Intel that callback is is intel_size_cache().
This patch enables calling of cpu_detect_cache_sizes() inside of
init_intel() and hence the calling of the legacy_cache callback in
intel_size_cache(). Adding this call will ensure that PIII Tualatin
currently in intel_size_cache() and Quark SoC X1000 being added to
intel_size_cache() in this patch will report their respective cache
sizes.
This model of calling cpu_detect_cache_sizes() is consistent with
AMD/Via/Cirix/Transmeta and Centaur.
Also added is a string to idenitfy the Quark as Quark SoC X1000
giving better and more descriptive output via /proc/cpuinfo
Adding cpu_detect_cache_sizes to init_intel() will enable calling
of intel_size_cache() on Intel processors which currently no code
can reach. Therefore this patch will also re-enable reporting
of PIII Tualatin cache size information as well as add
Quark SoC X1000 support.
Comment text and cache flow logic suggested by Thomas Gleixner
Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Cc: davej@redhat.com
Cc: hmh@hmh.eng.br
Link: http://lkml.kernel.org/r/1412641189-12415-3-git-send-email-pure.logic@nexus-software.ie
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/kernel/cpu/intel.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 50ce7519ccef..1ef456273172 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
@@ -397,6 +397,13 @@ static void init_intel(struct cpuinfo_x86 *c) | |||
397 | } | 397 | } |
398 | 398 | ||
399 | l2 = init_intel_cacheinfo(c); | 399 | l2 = init_intel_cacheinfo(c); |
400 | |||
401 | /* Detect legacy cache sizes if init_intel_cacheinfo did not */ | ||
402 | if (l2 == 0) { | ||
403 | cpu_detect_cache_sizes(c); | ||
404 | l2 = c->x86_cache_size; | ||
405 | } | ||
406 | |||
400 | if (c->cpuid_level > 9) { | 407 | if (c->cpuid_level > 9) { |
401 | unsigned eax = cpuid_eax(10); | 408 | unsigned eax = cpuid_eax(10); |
402 | /* Check for version and the number of counters */ | 409 | /* Check for version and the number of counters */ |
@@ -500,6 +507,13 @@ static unsigned int intel_size_cache(struct cpuinfo_x86 *c, unsigned int size) | |||
500 | */ | 507 | */ |
501 | if ((c->x86 == 6) && (c->x86_model == 11) && (size == 0)) | 508 | if ((c->x86 == 6) && (c->x86_model == 11) && (size == 0)) |
502 | size = 256; | 509 | size = 256; |
510 | |||
511 | /* | ||
512 | * Intel Quark SoC X1000 contains a 4-way set associative | ||
513 | * 16K cache with a 16 byte cache line and 256 lines per tag | ||
514 | */ | ||
515 | if ((c->x86 == 5) && (c->x86_model == 9)) | ||
516 | size = 16; | ||
503 | return size; | 517 | return size; |
504 | } | 518 | } |
505 | #endif | 519 | #endif |
@@ -701,7 +715,8 @@ static const struct cpu_dev intel_cpu_dev = { | |||
701 | [3] = "OverDrive PODP5V83", | 715 | [3] = "OverDrive PODP5V83", |
702 | [4] = "Pentium MMX", | 716 | [4] = "Pentium MMX", |
703 | [7] = "Mobile Pentium 75 - 200", | 717 | [7] = "Mobile Pentium 75 - 200", |
704 | [8] = "Mobile Pentium MMX" | 718 | [8] = "Mobile Pentium MMX", |
719 | [9] = "Quark SoC X1000", | ||
705 | } | 720 | } |
706 | }, | 721 | }, |
707 | { .family = 6, .model_names = | 722 | { .family = 6, .model_names = |