Lines Matching refs:x86_feature
76 unsigned int x86_feature)
78 const struct cpuid_reg cpuid = x86_feature_cpuid(x86_feature);
89 unsigned int x86_feature)
93 reg = guest_cpuid_get_register(vcpu, x86_feature);
97 return *reg & __feature_bit(x86_feature);
101 unsigned int x86_feature)
105 reg = guest_cpuid_get_register(vcpu, x86_feature);
107 *reg &= ~__feature_bit(x86_feature);
191 static __always_inline void kvm_cpu_cap_clear(unsigned int x86_feature)
193 unsigned int x86_leaf = __feature_leaf(x86_feature);
196 kvm_cpu_caps[x86_leaf] &= ~__feature_bit(x86_feature);
199 static __always_inline void kvm_cpu_cap_set(unsigned int x86_feature)
201 unsigned int x86_leaf = __feature_leaf(x86_feature);
204 kvm_cpu_caps[x86_leaf] |= __feature_bit(x86_feature);
207 static __always_inline u32 kvm_cpu_cap_get(unsigned int x86_feature)
209 unsigned int x86_leaf = __feature_leaf(x86_feature);
212 return kvm_cpu_caps[x86_leaf] & __feature_bit(x86_feature);
215 static __always_inline bool kvm_cpu_cap_has(unsigned int x86_feature)
217 return !!kvm_cpu_cap_get(x86_feature);
220 static __always_inline void kvm_cpu_cap_check_and_set(unsigned int x86_feature)
222 if (boot_cpu_has(x86_feature))
223 kvm_cpu_cap_set(x86_feature);
241 static __always_inline int kvm_governed_feature_index(unsigned int x86_feature)
243 switch (x86_feature) {
251 static __always_inline bool kvm_is_governed_feature(unsigned int x86_feature)
253 return kvm_governed_feature_index(x86_feature) >= 0;
257 unsigned int x86_feature)
259 BUILD_BUG_ON(!kvm_is_governed_feature(x86_feature));
261 __set_bit(kvm_governed_feature_index(x86_feature),
266 unsigned int x86_feature)
268 if (kvm_cpu_cap_has(x86_feature) && guest_cpuid_has(vcpu, x86_feature))
269 kvm_governed_feature_set(vcpu, x86_feature);
273 unsigned int x86_feature)
275 BUILD_BUG_ON(!kvm_is_governed_feature(x86_feature));
277 return test_bit(kvm_governed_feature_index(x86_feature),