summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/ioapic.h
diff options
context:
space:
mode:
authorRadim Krčmář <rkrcmar@redhat.com>2015-03-19 21:52:41 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2015-03-23 21:20:52 -0300
commita123374ff3c6850e1340b6da010bb43668d710e1 (patch)
treec5af16a84cac8c0f0418a8192b8d5c2aba95d41b /arch/x86/kvm/ioapic.h
parentbbf4aef89df1e8d982912f04d9a2b466750188d3 (diff)
KVM: x86: inline kvm_ioapic_handles_vector()
An overhead from function call is not appropriate for its size and frequency of execution. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/ioapic.h')
-rw-r--r--arch/x86/kvm/ioapic.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/x86/kvm/ioapic.h b/arch/x86/kvm/ioapic.h
index 38d8402ea65c..6e265cfcd86a 100644
--- a/arch/x86/kvm/ioapic.h
+++ b/arch/x86/kvm/ioapic.h
@@ -98,13 +98,19 @@ static inline struct kvm_ioapic *ioapic_irqchip(struct kvm *kvm)
return kvm->arch.vioapic;
}
+static inline bool kvm_ioapic_handles_vector(struct kvm *kvm, int vector)
+{
+ struct kvm_ioapic *ioapic = kvm->arch.vioapic;
+ smp_rmb();
+ return test_bit(vector, ioapic->handled_vectors);
+}
+
void kvm_rtc_eoi_tracking_restore_one(struct kvm_vcpu *vcpu);
bool kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
int short_hand, unsigned int dest, int dest_mode);
int kvm_apic_compare_prio(struct kvm_vcpu *vcpu1, struct kvm_vcpu *vcpu2);
void kvm_ioapic_update_eoi(struct kvm_vcpu *vcpu, int vector,
int trigger_mode);
-bool kvm_ioapic_handles_vector(struct kvm *kvm, int vector);
int kvm_ioapic_init(struct kvm *kvm);
void kvm_ioapic_destroy(struct kvm *kvm);
int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int irq_source_id,