aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/irq.h
diff options
context:
space:
mode:
authorSteve Rutherford <srutherford@google.com>2015-07-30 02:21:40 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2015-10-01 09:06:26 -0400
commit49df6397edfc5a8ba8ca813b51fb9729d8e94b40 (patch)
treeb5cb29a28fff01c9c85c4f02961164532fa241b2 /arch/x86/kvm/irq.h
parent4ca7dd8ce4b24e18f94eed90e80c6eb80fb48c9a (diff)
KVM: x86: Split the APIC from the rest of IRQCHIP.
First patch in a series which enables the relocation of the PIC/IOAPIC to userspace. Adds capability KVM_CAP_SPLIT_IRQCHIP; KVM_CAP_SPLIT_IRQCHIP enables the construction of LAPICs without the rest of the irqchip. Compile tested for x86. Signed-off-by: Steve Rutherford <srutherford@google.com> Suggested-by: Andrew Honig <ahonig@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/irq.h')
-rw-r--r--arch/x86/kvm/irq.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h
index 9e6e7e04de98..2f9703dcd913 100644
--- a/arch/x86/kvm/irq.h
+++ b/arch/x86/kvm/irq.h
@@ -83,13 +83,22 @@ static inline struct kvm_pic *pic_irqchip(struct kvm *kvm)
83 return kvm->arch.vpic; 83 return kvm->arch.vpic;
84} 84}
85 85
86static inline int irqchip_split(struct kvm *kvm)
87{
88 return kvm->arch.irqchip_split;
89}
90
86static inline int irqchip_in_kernel(struct kvm *kvm) 91static inline int irqchip_in_kernel(struct kvm *kvm)
87{ 92{
88 struct kvm_pic *vpic = pic_irqchip(kvm); 93 struct kvm_pic *vpic = pic_irqchip(kvm);
94 bool ret;
95
96 ret = (vpic != NULL);
97 ret |= irqchip_split(kvm);
89 98
90 /* Read vpic before kvm->irq_routing. */ 99 /* Read vpic before kvm->irq_routing. */
91 smp_rmb(); 100 smp_rmb();
92 return vpic != NULL; 101 return ret;
93} 102}
94 103
95static inline int lapic_in_kernel(struct kvm_vcpu *vcpu) 104static inline int lapic_in_kernel(struct kvm_vcpu *vcpu)