Skip to content

Commit c6bd180

Browse files
rkrcmarbonzini
authored andcommitted
KVM: x86: X86_FEATURE_NRIPS is not scattered anymore
bit(X86_FEATURE_NRIPS) is 3 since 2ccd71f ("x86/cpufeature: Move some of the scattered feature bits to x86_capability"), so we can simplify the code. Signed-off-by: Radim Krčmář <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 41ab937 commit c6bd180

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

arch/x86/kvm/cpuid.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -160,25 +160,13 @@ static inline bool guest_cpuid_has_rdtscp(struct kvm_vcpu *vcpu)
160160
return best && (best->edx & bit(X86_FEATURE_RDTSCP));
161161
}
162162

163-
/*
164-
* NRIPS is provided through cpuidfn 0x8000000a.edx bit 3
165-
*/
166-
#define BIT_NRIPS 3
167-
168163
static inline bool guest_cpuid_has_nrips(struct kvm_vcpu *vcpu)
169164
{
170165
struct kvm_cpuid_entry2 *best;
171166

172167
best = kvm_find_cpuid_entry(vcpu, 0x8000000a, 0);
173-
174-
/*
175-
* NRIPS is a scattered cpuid feature, so we can't use
176-
* X86_FEATURE_NRIPS here (X86_FEATURE_NRIPS would be bit
177-
* position 8, not 3).
178-
*/
179-
return best && (best->edx & bit(BIT_NRIPS));
168+
return best && (best->edx & bit(X86_FEATURE_NRIPS));
180169
}
181-
#undef BIT_NRIPS
182170

183171
static inline int guest_cpuid_family(struct kvm_vcpu *vcpu)
184172
{

0 commit comments

Comments
 (0)