diff options
Diffstat (limited to 'arch/x86/kernel/cpu/intel_cacheinfo.c')
-rw-r--r-- | arch/x86/kernel/cpu/intel_cacheinfo.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index 0c06bca2a1d..fc6c8ef92dc 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
@@ -507,18 +507,19 @@ static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) | |||
507 | { | 507 | { |
508 | struct _cpuid4_info *this_leaf, *sibling_leaf; | 508 | struct _cpuid4_info *this_leaf, *sibling_leaf; |
509 | unsigned long num_threads_sharing; | 509 | unsigned long num_threads_sharing; |
510 | int index_msb, i; | 510 | int index_msb, i, sibling; |
511 | struct cpuinfo_x86 *c = &cpu_data(cpu); | 511 | struct cpuinfo_x86 *c = &cpu_data(cpu); |
512 | 512 | ||
513 | if ((index == 3) && (c->x86_vendor == X86_VENDOR_AMD)) { | 513 | if ((index == 3) && (c->x86_vendor == X86_VENDOR_AMD)) { |
514 | struct cpuinfo_x86 *d; | 514 | for_each_cpu(i, c->llc_shared_map) { |
515 | for_each_online_cpu(i) { | ||
516 | if (!per_cpu(ici_cpuid4_info, i)) | 515 | if (!per_cpu(ici_cpuid4_info, i)) |
517 | continue; | 516 | continue; |
518 | d = &cpu_data(i); | ||
519 | this_leaf = CPUID4_INFO_IDX(i, index); | 517 | this_leaf = CPUID4_INFO_IDX(i, index); |
520 | cpumask_copy(to_cpumask(this_leaf->shared_cpu_map), | 518 | for_each_cpu(sibling, c->llc_shared_map) { |
521 | d->llc_shared_map); | 519 | if (!cpu_online(sibling)) |
520 | continue; | ||
521 | set_bit(sibling, this_leaf->shared_cpu_map); | ||
522 | } | ||
522 | } | 523 | } |
523 | return; | 524 | return; |
524 | } | 525 | } |