aboutsummaryrefslogtreecommitdiffstats
path: root/virt/lib/irqbypass.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-05-19 14:27:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-19 14:27:09 -0400
commit7beaa24ba49717419e24d1f6321e8b3c265a719c (patch)
treea5c5433d3c7bfc4c23e67174463ccf519c8406f0 /virt/lib/irqbypass.c
parent07b75260ebc2c789724c594d7eaf0194fa47b3be (diff)
parent9842df62004f366b9fed2423e24df10542ee0dc5 (diff)
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull KVM updates from Paolo Bonzini: "Small release overall. x86: - miscellaneous fixes - AVIC support (local APIC virtualization, AMD version) s390: - polling for interrupts after a VCPU goes to halted state is now enabled for s390 - use hardware provided information about facility bits that do not need any hypervisor activity, and other fixes for cpu models and facilities - improve perf output - floating interrupt controller improvements. MIPS: - miscellaneous fixes PPC: - bugfixes only ARM: - 16K page size support - generic firmware probing layer for timer and GIC Christoffer Dall (KVM-ARM maintainer) says: "There are a few changes in this pull request touching things outside KVM, but they should all carry the necessary acks and it made the merge process much easier to do it this way." though actually the irqchip maintainers' acks didn't make it into the patches. Marc Zyngier, who is both irqchip and KVM-ARM maintainer, later acked at http://mid.gmane.org/573351D1.4060303@arm.com ('more formally and for documentation purposes')" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (82 commits) KVM: MTRR: remove MSR 0x2f8 KVM: x86: make hwapic_isr_update and hwapic_irr_update look the same svm: Manage vcpu load/unload when enable AVIC svm: Do not intercept CR8 when enable AVIC svm: Do not expose x2APIC when enable AVIC KVM: x86: Introducing kvm_x86_ops.apicv_post_state_restore svm: Add VMEXIT handlers for AVIC svm: Add interrupt injection via AVIC KVM: x86: Detect and Initialize AVIC support svm: Introduce new AVIC VMCB registers KVM: split kvm_vcpu_wake_up from kvm_vcpu_kick KVM: x86: Introducing kvm_x86_ops VCPU blocking/unblocking hooks KVM: x86: Introducing kvm_x86_ops VM init/destroy hooks KVM: x86: Rename kvm_apic_get_reg to kvm_lapic_get_reg KVM: x86: Misc LAPIC changes to expose helper functions KVM: shrink halt polling even more for invalid wakeups KVM: s390: set halt polling to 80 microseconds KVM: halt_polling: provide a way to qualify wakeups during poll KVM: PPC: Book3S HV: Re-enable XICS fast path for irqfd-generated interrupts kvm: Conditionally register IRQ bypass consumer ...
Diffstat (limited to 'virt/lib/irqbypass.c')
-rw-r--r--virt/lib/irqbypass.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/virt/lib/irqbypass.c b/virt/lib/irqbypass.c
index 09a03b5a21ff..52abac4bb6a2 100644
--- a/virt/lib/irqbypass.c
+++ b/virt/lib/irqbypass.c
@@ -89,6 +89,9 @@ int irq_bypass_register_producer(struct irq_bypass_producer *producer)
89 struct irq_bypass_producer *tmp; 89 struct irq_bypass_producer *tmp;
90 struct irq_bypass_consumer *consumer; 90 struct irq_bypass_consumer *consumer;
91 91
92 if (!producer->token)
93 return -EINVAL;
94
92 might_sleep(); 95 might_sleep();
93 96
94 if (!try_module_get(THIS_MODULE)) 97 if (!try_module_get(THIS_MODULE))
@@ -136,6 +139,9 @@ void irq_bypass_unregister_producer(struct irq_bypass_producer *producer)
136 struct irq_bypass_producer *tmp; 139 struct irq_bypass_producer *tmp;
137 struct irq_bypass_consumer *consumer; 140 struct irq_bypass_consumer *consumer;
138 141
142 if (!producer->token)
143 return;
144
139 might_sleep(); 145 might_sleep();
140 146
141 if (!try_module_get(THIS_MODULE)) 147 if (!try_module_get(THIS_MODULE))
@@ -177,7 +183,8 @@ int irq_bypass_register_consumer(struct irq_bypass_consumer *consumer)
177 struct irq_bypass_consumer *tmp; 183 struct irq_bypass_consumer *tmp;
178 struct irq_bypass_producer *producer; 184 struct irq_bypass_producer *producer;
179 185
180 if (!consumer->add_producer || !consumer->del_producer) 186 if (!consumer->token ||
187 !consumer->add_producer || !consumer->del_producer)
181 return -EINVAL; 188 return -EINVAL;
182 189
183 might_sleep(); 190 might_sleep();
@@ -227,6 +234,9 @@ void irq_bypass_unregister_consumer(struct irq_bypass_consumer *consumer)
227 struct irq_bypass_consumer *tmp; 234 struct irq_bypass_consumer *tmp;
228 struct irq_bypass_producer *producer; 235 struct irq_bypass_producer *producer;
229 236
237 if (!consumer->token)
238 return;
239
230 might_sleep(); 240 might_sleep();
231 241
232 if (!try_module_get(THIS_MODULE)) 242 if (!try_module_get(THIS_MODULE))