From: Paolo Bonzini Date: Tue, 7 Apr 2015 16:09:20 +0000 (+0200) Subject: Merge tag 'kvm-arm-for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm... X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bf0fb67cf957fc8ecfaaa2819b7d6a0f795e2ef2;p=linux-beck.git Merge tag 'kvm-arm-for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into 'kvm-next' KVM/ARM changes for v4.1: - fixes for live migration - irqfd support - kvm-io-bus & vgic rework to enable ioeventfd - page ageing for stage-2 translation - various cleanups --- bf0fb67cf957fc8ecfaaa2819b7d6a0f795e2ef2 diff --cc virt/kvm/arm/vgic.c index c9f60f524588,b70174e74868..8d550ff14700 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@@ -955,6 -1095,25 +1101,26 @@@ static void vgic_retire_disabled_irqs(s } } + static void vgic_queue_irq_to_lr(struct kvm_vcpu *vcpu, int irq, + int lr_nr, struct vgic_lr vlr) + { + if (vgic_irq_is_active(vcpu, irq)) { + vlr.state |= LR_STATE_ACTIVE; + kvm_debug("Set active, clear distributor: 0x%x\n", vlr.state); + vgic_irq_clear_active(vcpu, irq); + vgic_update_state(vcpu->kvm); + } else if (vgic_dist_irq_is_pending(vcpu, irq)) { + vlr.state |= LR_STATE_PENDING; + kvm_debug("Set pending: 0x%x\n", vlr.state); + } + + if (!vgic_irq_is_edge(vcpu, irq)) + vlr.state |= LR_EOI_INT; + + vgic_set_lr(vcpu, lr_nr, vlr); ++ vgic_sync_lr_elrsr(vcpu, lr_nr, vlr); + } + /* * Queue an interrupt to a CPU virtual interface. Return true on success, * or false if it wasn't possible to queue it.