From: Pavel Fedin <p.fedin@samsung.com>
To: 'Marc Zyngier' <marc.zyngier@arm.com>
Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
"'Christoffer Dall'" <christoffer.dall@linaro.org>,
"'Alex Bennée'" <alex.bennee@linaro.org>
Subject: RE: [PATCH] KVM: arm/arm64: BUG: Fix losing level-sensitive interrupts
Date: Wed, 26 Aug 2015 13:58:47 +0300 [thread overview]
Message-ID: <00d701d0dfee$2f464810$8dd2d830$@samsung.com> (raw)
In-Reply-To: <20150826092721.43e8cbfd@arm.com>
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 it's a level IRQ. What will happen in a real hardware? Not much, the interrupt will still be
sampled.
So, for better modelling the hardware, shouldn't we improve KVM's behavior here? Especially if
before v4.1 it actually did not have this problem.
> This really feels like a userspace bug to me (I vaguely remember some
> QEMU issues regarding this a while ago, but my memory is a bit hazy).
You know, may be it's really qemu's problem, to tell the truth i'm lazy to read the whole PL011
spec, but qemu appears to pulse the line without PL011 interrupt servicing at all. I know this
because my kernel is patched, it uses software emulation of vCPU interface, because vGIC is broken
on ThunderX. And LR state change and all the maintenance is done upon EOIR write (which is trapped).
With this change consequences of losing an interrupt are much more severe, the IRQ line get stuck
and stops working at all. Subsequent injections are blocked by vgic_can_sample_irq(), which returns
false because vgic_irq_is_queued() returns true. Because vgic_irq_clear_queued() is called during
maintenance procedure, which in this case never happens, because the interrupt is never EOIed,
because it was never made PENDING in the LR. Actually that's how i found this.
So, here is why i am describing these unrelated things here: with IRQ line processing completely
locked up, line switches between 1 and 0 is still injected (vgic_update_irq_pending() is called with
both values, i added some debug output in order to see this). The guest successfully boots up to a
login prompt, everything is fine, just i cannot type anything on the console because serial port's
interrupt is locked up. I suppose that this pulsing has to do with output FIFO. Could this be some
bug in kernel's pl011 driver itself, which does something wrong and does not handle interrupts in a
proper way during output?
Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia
next prev parent reply other threads:[~2015-08-26 10:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-26 6:46 [PATCH] KVM: arm/arm64: BUG: Fix losing level-sensitive interrupts Pavel Fedin
2015-08-26 8:27 ` Marc Zyngier
2015-08-26 10:58 ` Pavel Fedin [this message]
2015-08-26 11:13 ` Marc Zyngier
2015-08-26 11:33 ` Pavel Fedin
2015-08-26 13:11 ` Pavel Fedin
2015-08-26 14:03 ` Christoffer Dall
2015-08-26 14:02 ` Christoffer Dall
2015-08-26 14:26 ` Pavel Fedin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='00d701d0dfee$2f464810$8dd2d830$@samsung.com' \
--to=p.fedin@samsung.com \
--cc=alex.bennee@linaro.org \
--cc=christoffer.dall@linaro.org \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=marc.zyngier@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.