Skip to content

Commit

Permalink
KVM: x86: X86_FEATURE_NRIPS is not scattered anymore
Browse files Browse the repository at this point in the history
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ář <rkrcmar@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Radim Krčmář authored and Paolo Bonzini committed Aug 7, 2017
1 parent 41ab937 commit c6bd180
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions arch/x86/kvm/cpuid.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,25 +160,13 @@ static inline bool guest_cpuid_has_rdtscp(struct kvm_vcpu *vcpu)
return best && (best->edx & bit(X86_FEATURE_RDTSCP));
}

/*
* NRIPS is provided through cpuidfn 0x8000000a.edx bit 3
*/
#define BIT_NRIPS 3

static inline bool guest_cpuid_has_nrips(struct kvm_vcpu *vcpu)
{
struct kvm_cpuid_entry2 *best;

best = kvm_find_cpuid_entry(vcpu, 0x8000000a, 0);

/*
* NRIPS is a scattered cpuid feature, so we can't use
* X86_FEATURE_NRIPS here (X86_FEATURE_NRIPS would be bit
* position 8, not 3).
*/
return best && (best->edx & bit(BIT_NRIPS));
return best && (best->edx & bit(X86_FEATURE_NRIPS));
}
#undef BIT_NRIPS

static inline int guest_cpuid_family(struct kvm_vcpu *vcpu)
{
Expand Down

0 comments on commit c6bd180

Please sign in to comment.