From: Peter Maydell <peter.maydell@linaro.org>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: kvm@vger.kernel.org, patches@linaro.org,
Marc Zyngier <marc.zyngier@arm.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
qemu-devel@nongnu.org, Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] kvm-all.c: Move init of irqchip_inject_ioctl out of kvm_irqchip_create()
Date: Tue, 14 Aug 2012 14:10:17 +0100 [thread overview]
Message-ID: <CAFEAcA99sPKXxdSBeLjDsh5S6nutmqDbrvg-utOTvM0ZCJGuJQ@mail.gmail.com> (raw)
In-Reply-To: <502A07A8.4080704@web.de>
On 14 August 2012 09:09, Jan Kiszka <jan.kiszka@web.de> wrote:
> On 2012-08-14 09:52, Peter Maydell wrote:
>> Well, you appear to know what this variant ioctl does and why it's
>> better than KVM_IRQ_LINE, whereas I don't. I just want to deliver
>> an interrupt, KVM_IRQ_LINE lets me deliver an interrupt, why
>> do I need anything more? (What would I do with the status return, for
>> instance? I have to assert the incoming irq line, there's nothing for
>> me to do if the kernel says "sorry, can't do that" except abort qemu.)
>
> Not sure how timekeeping of all your guests will work, but a classic
> scenario on x86 is that some timer is programmed to deliver periodic
> ticks (or one-shot ticks that also generates a virtual periodic timer)
> and that those ticks will then be used to derive the system time of the
> guest. Now, if the guest was unable to process the past tick completely
> (due to host load) and we inject already another tick event, that one
> will get lost. Some guests (older Linuxes but also many proprietary
> OSes) are not prepared for such tick loss and will suffer from drifting
> wall clocks.
So, for ARM the overwhelmingly common case will be that we use the in
kernel architectural timer for doing periodic / one-shot ticks. That's
all in the kernel anyway (both timer and VGIC interrupt controller).
The less plausible case uses the in-kernel interrupt controller but an
out of kernel timer device. The only link between the two is a qemu_irq line,
so we have (a) no way to tell if this interrupt line into the GIC is a timer
or not and (b) no back-channel to the timer device to report things anyway.
The really unlikely case (in that there is theoretically code to handle it
but in practice QEMU will refuse to configure itself this way) has an out
of kernel GIC. In this case the interrupts we deliver to the kernel are
pre-coalesced into a single IRQ line, and there's definitely not a lot
we could do with the status report.
Marc Z tells me we could make the kernel return the 'did this coalesce?'
status without too much difficulty, but unless it's actually possible
to do something useful with it in userspace I'm not sure I see the point.
-- PMM
next prev parent reply other threads:[~2012-08-14 13:10 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-06 17:05 [Qemu-devel] [PATCH] kvm-all.c: Move init of irqchip_inject_ioctl out of kvm_irqchip_create() Peter Maydell
2012-08-12 13:13 ` Peter Maydell
2012-08-13 20:45 ` Marcelo Tosatti
2012-08-13 21:40 ` Peter Maydell
2012-08-14 7:33 ` Jan Kiszka
2012-08-14 7:40 ` Peter Maydell
2012-08-14 7:42 ` Jan Kiszka
2012-08-14 7:52 ` Peter Maydell
2012-08-14 8:09 ` Jan Kiszka
2012-08-14 13:10 ` Peter Maydell [this message]
2012-08-14 13:27 ` Jan Kiszka
2012-08-14 11:01 ` Avi Kivity
2012-08-14 11:05 ` Jan Kiszka
2012-08-14 13:14 ` Avi Kivity
2012-08-14 13:36 ` Jan Kiszka
2012-08-14 7:36 ` Jan Kiszka
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=CAFEAcA99sPKXxdSBeLjDsh5S6nutmqDbrvg-utOTvM0ZCJGuJQ@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=avi@redhat.com \
--cc=jan.kiszka@web.de \
--cc=kvm@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=mtosatti@redhat.com \
--cc=patches@linaro.org \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).