aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/cpuid-deps.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/cpu/cpuid-deps.c')
-rw-r--r--arch/x86/kernel/cpu/cpuid-deps.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/arch/x86/kernel/cpu/cpuid-deps.c b/arch/x86/kernel/cpu/cpuid-deps.c
index c21f22d836ad..904b0a3c4e53 100644
--- a/arch/x86/kernel/cpu/cpuid-deps.c
+++ b/arch/x86/kernel/cpu/cpuid-deps.c
@@ -62,23 +62,19 @@ const static struct cpuid_dep cpuid_deps[] = {
62 {} 62 {}
63}; 63};
64 64
65static inline void __clear_cpu_cap(struct cpuinfo_x86 *c, unsigned int bit)
66{
67 clear_bit32(bit, c->x86_capability);
68}
69
70static inline void __setup_clear_cpu_cap(unsigned int bit)
71{
72 clear_cpu_cap(&boot_cpu_data, bit);
73 set_bit32(bit, cpu_caps_cleared);
74}
75
76static inline void clear_feature(struct cpuinfo_x86 *c, unsigned int feature) 65static inline void clear_feature(struct cpuinfo_x86 *c, unsigned int feature)
77{ 66{
78 if (!c) 67 /*
79 __setup_clear_cpu_cap(feature); 68 * Note: This could use the non atomic __*_bit() variants, but the
80 else 69 * rest of the cpufeature code uses atomics as well, so keep it for
81 __clear_cpu_cap(c, feature); 70 * consistency. Cleanup all of it separately.
71 */
72 if (!c) {
73 clear_cpu_cap(&boot_cpu_data, feature);
74 set_bit(feature, (unsigned long *)cpu_caps_cleared);
75 } else {
76 clear_bit(feature, (unsigned long *)c->x86_capability);
77 }
82} 78}
83 79
84/* Take the capabilities and the BUG bits into account */ 80/* Take the capabilities and the BUG bits into account */