(I discard irq_fifo and change a method to fix this problem) We can reused the field "state" later.
Signed-off-by: Sheng Yang <[email protected]> --- include/linux/kvm_host.h | 3 ++- virt/kvm/kvm_main.c | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index fbf102c..58e4b7e 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -311,13 +311,14 @@ struct kvm_assigned_dev_kernel { int host_busnr; int host_devfn; int host_irq; - bool host_irq_disabled; int guest_irq; #define KVM_ASSIGNED_DEV_GUEST_INTX (1 << 0) #define KVM_ASSIGNED_DEV_GUEST_MSI (1 << 1) #define KVM_ASSIGNED_DEV_HOST_INTX (1 << 8) #define KVM_ASSIGNED_DEV_HOST_MSI (1 << 9) unsigned long irq_requested_type; +#define KVM_ASSIGNED_DEV_HOST_IRQ_DISABLED (1 << 0) + unsigned long state; int irq_source_id; struct pci_dev *dev; struct kvm *kvm; diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index a51e630..065af2d 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -114,7 +114,7 @@ static void kvm_assigned_dev_interrupt_work_handler(struct work_struct *work) if (assigned_dev->irq_requested_type & KVM_ASSIGNED_DEV_GUEST_MSI) { enable_irq(assigned_dev->host_irq); - assigned_dev->host_irq_disabled = false; + assigned_dev->state &= ~KVM_ASSIGNED_DEV_HOST_IRQ_DISABLED; } mutex_unlock(&assigned_dev->kvm->lock); @@ -131,7 +131,7 @@ static irqreturn_t kvm_assigned_dev_intr(int irq, void *dev_id) schedule_work(&assigned_dev->interrupt_work); disable_irq_nosync(irq); - assigned_dev->host_irq_disabled = true; + assigned_dev->state |= KVM_ASSIGNED_DEV_HOST_IRQ_DISABLED; return IRQ_HANDLED; } @@ -152,9 +152,9 @@ static void kvm_assigned_dev_ack_irq(struct kvm_irq_ack_notifier *kian) /* The guest irq may be shared so this ack may be * from another device. */ - if (dev->host_irq_disabled) { + if (dev->state & KVM_ASSIGNED_DEV_HOST_IRQ_DISABLED) { enable_irq(dev->host_irq); - dev->host_irq_disabled = false; + dev->state &= ~KVM_ASSIGNED_DEV_HOST_IRQ_DISABLED; } } -- 1.5.4.5 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
