Re: [PATCH] KVM: arm/arm64: BUG: Fix losing level-sensitive interrupts

2015-08-26 Thread Marc Zyngier
On Wed, 26 Aug 2015 09:46:03 +0300 Pavel Fedin p.fe...@samsung.com wrote: Hi Pavel, Commit 71760950bf3dc796e5e53ea3300dec724a09f593 (arm/arm64: KVM: add a common vgic_queue_irq_to_lr fn) introduced vgic_queue_irq_to_lr() function which checks vgic_dist_irq_is_pending() before setting

RE: [PATCH] KVM: arm/arm64: BUG: Fix losing level-sensitive interrupts

2015-08-26 Thread Pavel Fedin
Hello! As for v4.1 not having that problem, the pl011 driver has gone though a lot if rework lately, and I wouldn't be surprised if it now exhibited a different behaviour thanks to the broken userspace behaviour. Sorry, you misunderstood me. Or i wrote badly. I meant that _KVM_ did not have

RE: [PATCH] KVM: arm/arm64: BUG: Fix losing level-sensitive interrupts

2015-08-26 Thread Pavel Fedin
Hello! So userspace drops the line to 0 *before* the guest had a chance to do anything? Well, this is not the expected behaviour for a level triggered interrupt I know. But, still... Imagine that we have misconfigured the HW for some reason. The device pulses an IRQ line, but we think

Re: [PATCH] KVM: arm/arm64: BUG: Fix losing level-sensitive interrupts

2015-08-26 Thread Marc Zyngier
On 26/08/15 11:58, Pavel Fedin wrote: Hello! So userspace drops the line to 0 *before* the guest had a chance to do anything? Well, this is not the expected behaviour for a level triggered interrupt I know. But, still... Imagine that we have misconfigured the HW for some reason. The

RE: [PATCH] KVM: arm/arm64: BUG: Fix losing level-sensitive interrupts

2015-08-26 Thread Pavel Fedin
Hello! Hmm, there is definitely an inconsistency in the vgic code by getting here, but this is the wrong fix. I think you want something more along the lines of the following (completely untested, not even compile tested): Thank you very much. I also tried to propose an alternate solution

Re: [PATCH] KVM: arm/arm64: BUG: Fix losing level-sensitive interrupts

2015-08-26 Thread Christoffer Dall
On Wed, Aug 26, 2015 at 09:27:21AM +0100, Marc Zyngier wrote: On Wed, 26 Aug 2015 09:46:03 +0300 Pavel Fedin p.fe...@samsung.com wrote: Hi Pavel, Commit 71760950bf3dc796e5e53ea3300dec724a09f593 (arm/arm64: KVM: add a common vgic_queue_irq_to_lr fn) introduced vgic_queue_irq_to_lr()

RE: [PATCH] KVM: arm/arm64: BUG: Fix losing level-sensitive interrupts

2015-08-26 Thread Pavel Fedin
Hello! Sorry, but I don't really want to introduce another bug in the VGIC code (we have too many already). And what you're suggesting is to actually introduce a bug. Another, alternate idea... So far, we have a situation when empty LR, containing only LR_INT_EOI bit, is queued. Can we

Re: [PATCH] KVM: arm/arm64: BUG: Fix losing level-sensitive interrupts

2015-08-26 Thread Christoffer Dall
On Wed, Aug 26, 2015 at 09:46:03AM +0300, Pavel Fedin wrote: Commit 71760950bf3dc796e5e53ea3300dec724a09f593 (arm/arm64: KVM: add a common vgic_queue_irq_to_lr fn) introduced vgic_queue_irq_to_lr() function which checks vgic_dist_irq_is_pending() before setting LR_STATE_PENDING bit. However,