From: Gleb Natapov <gleb@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: mtosatti@redhat.com, avi@redhat.com, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, mst@redhat.com
Subject: Re: [PATCH] kvm: ioapic: conditionally delay irq delivery during eoi broadcast
Date: Mon, 12 Mar 2012 12:22:25 +0200 [thread overview]
Message-ID: <20120312102225.GW17882@redhat.com> (raw)
In-Reply-To: <4F5DC560.4050103@redhat.com>
On Mon, Mar 12, 2012 at 05:44:00PM +0800, Jason Wang wrote:
> On 03/12/2012 05:23 PM, Gleb Natapov wrote:
> >On Mon, Mar 12, 2012 at 05:07:35PM +0800, Jason Wang wrote:
> >>> Currently, we call ioapic_service() immediately when we find the irq is still
> >>> active during eoi broadcast. But for real hardware, there's some dealy between
> >>> the EOI writing and irq delivery (system bus latency?). So we need to emulate
> >>> this behavior. Otherwise, for a guest who haven't register a proper irq handler
> >>> , it would stay in the interrupt routine as this irq would be re-injected
> >>> immediately after guest enables interrupt. This would lead guest can't move
> >>> forward and may miss the possibility to get proper irq handler registered (one
> >>> example is windows guest resuming from hibernation).
> >>>
> >Yes, I saw this behaviour with Windows NICs, but it looks like the
> >guest bug. Does this happen with other kind of devices too? Because
> >if it does not then the correct hack would be to add a delay between
> >Windows enabling PHY and sending first interrupt to a guest. This will
> >model what happens on real HW. NIC does not start receiving packets at
> >the same moment PHY is enabled. Some time is spent bring up the link.
> >
>
> Looks common for any unhandled level irq but I haven't tried. What
> I've tested is running a similar test program by hacking the card
> driver and let it run in both real physical machine and a kvm guest,
> and see what happens if there's no irq handled:
>
> - In real hardware, there's a gap between two successive irqs
> injected by eoi broadcast, and OS can move forward.
> - In a kvm guest, no gap, guest can't move forward and would always
> stay in the irq context forever.
This is not something an OS should rely on. So lets do the Windows
hack in QEMU NIC devices.
--
Gleb.
next prev parent reply other threads:[~2012-03-12 10:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-12 9:07 [PATCH] kvm: ioapic: conditionally delay irq delivery during eoi broadcast Jason Wang
2012-03-12 9:23 ` Gleb Natapov
2012-03-12 9:44 ` Jason Wang
2012-03-12 10:22 ` Gleb Natapov [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-09-10 12:32 Zhang Haoyu
2014-09-10 12:52 ` Zhang Haoyu
2014-09-11 5:06 Zhang Haoyu
2014-09-11 6:01 ` 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=20120312102225.GW17882@redhat.com \
--to=gleb@redhat.com \
--cc=avi@redhat.com \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.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.