diff options
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r-- | arch/x86/kernel/cpu/intel_cacheinfo.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index c105c533ed9..0bf12644aa7 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
@@ -747,6 +747,23 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c) | |||
747 | static DEFINE_PER_CPU(struct _cpuid4_info *, ici_cpuid4_info); | 747 | static DEFINE_PER_CPU(struct _cpuid4_info *, ici_cpuid4_info); |
748 | #define CPUID4_INFO_IDX(x, y) (&((per_cpu(ici_cpuid4_info, x))[y])) | 748 | #define CPUID4_INFO_IDX(x, y) (&((per_cpu(ici_cpuid4_info, x))[y])) |
749 | 749 | ||
750 | /* returns CPUs that share the index cache with cpu */ | ||
751 | int get_shared_cpu_map(cpumask_var_t mask, unsigned int cpu, int index) | ||
752 | { | ||
753 | int ret = 0; | ||
754 | struct _cpuid4_info *this_leaf; | ||
755 | |||
756 | if (index >= num_cache_leaves) { | ||
757 | index = num_cache_leaves - 1; | ||
758 | ret = index; | ||
759 | } | ||
760 | |||
761 | this_leaf = CPUID4_INFO_IDX(cpu,index); | ||
762 | cpumask_copy(mask, to_cpumask(this_leaf->shared_cpu_map)); | ||
763 | |||
764 | return ret; | ||
765 | } | ||
766 | |||
750 | #ifdef CONFIG_SMP | 767 | #ifdef CONFIG_SMP |
751 | static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) | 768 | static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) |
752 | { | 769 | { |