Commit 9f958c11 authored by Christoffer Dall's avatar Christoffer Dall

KVM: arm/arm64: vgic: Trust the LR state for HW IRQs

We were probing the physial distributor state for the active state of a
HW virtual IRQ, because we had seen evidence that the LR state was not
cleared when the guest deactivated a virtual interrupted.

However, this issue turned out to be a software bug in the GIC, which
was solved by: 84aab5e68c2a5e1e18d81ae8308c3ce25d501b29
(KVM: arm/arm64: arch_timer: Preserve physical dist. active
state on LR.active, 2015-11-24)

Therefore, get rid of the complexities and just look at the LR.
Reviewed-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
parent 0e3dfda9
...@@ -1417,25 +1417,13 @@ static bool vgic_process_maintenance(struct kvm_vcpu *vcpu) ...@@ -1417,25 +1417,13 @@ static bool vgic_process_maintenance(struct kvm_vcpu *vcpu)
static bool vgic_sync_hwirq(struct kvm_vcpu *vcpu, int lr, struct vgic_lr vlr) static bool vgic_sync_hwirq(struct kvm_vcpu *vcpu, int lr, struct vgic_lr vlr)
{ {
struct vgic_dist *dist = &vcpu->kvm->arch.vgic; struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
struct irq_phys_map *map;
bool phys_active;
bool level_pending; bool level_pending;
int ret;
if (!(vlr.state & LR_HW)) if (!(vlr.state & LR_HW))
return false; return false;
map = vgic_irq_map_search(vcpu, vlr.irq); if (vlr.state & LR_STATE_ACTIVE)
BUG_ON(!map); return false;
ret = irq_get_irqchip_state(map->irq,
IRQCHIP_STATE_ACTIVE,
&phys_active);
WARN_ON(ret);
if (phys_active)
return 0;
spin_lock(&dist->lock); spin_lock(&dist->lock);
level_pending = process_queued_irq(vcpu, lr, vlr); level_pending = process_queued_irq(vcpu, lr, vlr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment