x86/amd-iommu: Add per IOMMU reference counting
[linux/fpc-iii.git] / arch / x86 / kvm / x86.h
blob5eadea585d2a2084ef3adc91e7575e54b27aff21
1 #ifndef ARCH_X86_KVM_X86_H
2 #define ARCH_X86_KVM_X86_H
4 #include <linux/kvm_host.h>
6 static inline void kvm_clear_exception_queue(struct kvm_vcpu *vcpu)
8 vcpu->arch.exception.pending = false;
11 static inline void kvm_queue_interrupt(struct kvm_vcpu *vcpu, u8 vector,
12 bool soft)
14 vcpu->arch.interrupt.pending = true;
15 vcpu->arch.interrupt.soft = soft;
16 vcpu->arch.interrupt.nr = vector;
19 static inline void kvm_clear_interrupt_queue(struct kvm_vcpu *vcpu)
21 vcpu->arch.interrupt.pending = false;
24 static inline bool kvm_event_needs_reinjection(struct kvm_vcpu *vcpu)
26 return vcpu->arch.exception.pending || vcpu->arch.interrupt.pending ||
27 vcpu->arch.nmi_injected;
30 static inline bool kvm_exception_is_soft(unsigned int nr)
32 return (nr == BP_VECTOR) || (nr == OF_VECTOR);
35 struct kvm_cpuid_entry2 *kvm_find_cpuid_entry(struct kvm_vcpu *vcpu,
36 u32 function, u32 index);
38 #endif