diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-07-23 06:22:45 (GMT) |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-07-23 06:22:45 (GMT) |
commit | 41dbc6bcd9722bba8f09256655d060af30c63d34 (patch) | |
tree | 3de1f317633917da3fd57e98406eb73f42458dbc /arch/x86/kvm/x86.h | |
parent | 3e5d2fdceda172554e681b68c853bf5d08205bbf (diff) | |
download | linux-41dbc6bcd9722bba8f09256655d060af30c63d34.tar.xz |
KVM: x86: introduce kvm_check_has_quirk
The logic of the disabled_quirks field usually results in a double
negation. Wrap it in a simple function that checks the bit and
negates it.
Based on a patch from Xiao Guangrong.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.h')
-rw-r--r-- | arch/x86/kvm/x86.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h index edc8cdc..0ca2f3e 100644 --- a/arch/x86/kvm/x86.h +++ b/arch/x86/kvm/x86.h @@ -147,6 +147,11 @@ static inline void kvm_register_writel(struct kvm_vcpu *vcpu, return kvm_register_write(vcpu, reg, val); } +static inline bool kvm_check_has_quirk(struct kvm *kvm, u64 quirk) +{ + return !(kvm->arch.disabled_quirks & quirk); +} + void kvm_before_handle_nmi(struct kvm_vcpu *vcpu); void kvm_after_handle_nmi(struct kvm_vcpu *vcpu); void kvm_set_pending_timer(struct kvm_vcpu *vcpu); |