aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2008-11-24 01:32:51 -0500
committerAvi Kivity <avi@redhat.com>2008-12-31 09:55:01 -0500
commit4f906c19ae29397409bedabf7bbe5cb42ad90332 (patch)
treebbe53d39fa8be58d714a87acf1e6f14366890092 /virt/kvm/kvm_main.c
parent00e3ed39e2e25ffb3417ce1bec8f4b78ed4b85e7 (diff)
KVM: Replace irq_requested with more generic irq_requested_type
Separate guest irq type and host irq type, for we can support guest using INTx with host using MSI (but not opposite combination). Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r--virt/kvm/kvm_main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index ef2f03cf42c0..638de47e167d 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -140,7 +140,7 @@ static void kvm_free_assigned_device(struct kvm *kvm,
140 struct kvm_assigned_dev_kernel 140 struct kvm_assigned_dev_kernel
141 *assigned_dev) 141 *assigned_dev)
142{ 142{
143 if (irqchip_in_kernel(kvm) && assigned_dev->irq_requested) 143 if (irqchip_in_kernel(kvm) && assigned_dev->irq_requested_type)
144 free_irq(assigned_dev->host_irq, (void *)assigned_dev); 144 free_irq(assigned_dev->host_irq, (void *)assigned_dev);
145 145
146 kvm_unregister_irq_ack_notifier(&assigned_dev->ack_notifier); 146 kvm_unregister_irq_ack_notifier(&assigned_dev->ack_notifier);
@@ -180,7 +180,7 @@ static int assigned_device_update_intx(struct kvm *kvm,
180 struct kvm_assigned_dev_kernel *adev, 180 struct kvm_assigned_dev_kernel *adev,
181 struct kvm_assigned_irq *airq) 181 struct kvm_assigned_irq *airq)
182{ 182{
183 if (adev->irq_requested) { 183 if (adev->irq_requested_type & KVM_ASSIGNED_DEV_GUEST_INTX) {
184 adev->guest_irq = airq->guest_irq; 184 adev->guest_irq = airq->guest_irq;
185 adev->ack_notifier.gsi = airq->guest_irq; 185 adev->ack_notifier.gsi = airq->guest_irq;
186 return 0; 186 return 0;
@@ -207,7 +207,8 @@ static int assigned_device_update_intx(struct kvm *kvm,
207 return -EIO; 207 return -EIO;
208 } 208 }
209 209
210 adev->irq_requested = true; 210 adev->irq_requested_type = KVM_ASSIGNED_DEV_GUEST_INTX |
211 KVM_ASSIGNED_DEV_HOST_INTX;
211 return 0; 212 return 0;
212} 213}
213 214
@@ -227,7 +228,7 @@ static int kvm_vm_ioctl_assign_irq(struct kvm *kvm,
227 return -EINVAL; 228 return -EINVAL;
228 } 229 }
229 230
230 if (!match->irq_requested) { 231 if (!match->irq_requested_type) {
231 INIT_WORK(&match->interrupt_work, 232 INIT_WORK(&match->interrupt_work,
232 kvm_assigned_dev_interrupt_work_handler); 233 kvm_assigned_dev_interrupt_work_handler);
233 if (irqchip_in_kernel(kvm)) { 234 if (irqchip_in_kernel(kvm)) {