kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yang, Sheng" <sheng.yang@intel.com>
To: Avi Kivity <avi@redhat.com>
Cc: "Tian, Kevin" <kevin.tian@intel.com>,
	"Han, Weidong" <weidong.han@intel.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Amit Shah <amit.shah@redhat.com>,
	"benami@il.ibm.com" <benami@il.ibm.com>,
	"muli@il.ibm.com" <muli@il.ibm.com>,
	"Kay, Allen M" <allen.m.kay@intel.com>,
	"Zhang, Xiantao" <xiantao.zhang@intel.com>,
	Eddie Dong <eddie.dong@intel.com>
Subject: Re: Remaining passthrough/VT-d tasks list
Date: Sun, 28 Sep 2008 13:54:55 +0800	[thread overview]
Message-ID: <200809281354.56553.sheng.yang@intel.com> (raw)
In-Reply-To: <48DF1046.1050102@redhat.com>

On Sunday 28 September 2008 13:04:06 Avi Kivity wrote:
> Tian, Kevin wrote:
> >> No. Maybe the Neocleus polarity trick (which also reduces performance).
> >
> > To my knowledge, Neocleus polarity trick can't solve this isolation
> > issue, which just provides one effecient way to track
> > assertion/deassertion transition on the irq line. For example, reverse
> > polarity when receiving an instance, and then a new irq instance would
> > occur when all devices de- assert on shared irq line, and then recover
> > the polarity. In your concerned case where guest driver misbehaves, this
> > polarity trick can't work neither as one device always asserts the line.
>
> You're right, I didn't think it through.
>
> If there was a standard way to mask pci irqs, it might have worked, but
> there isn't, unfortunately.
>
One purpose:

If we suffered from IRQ storm of one level triggered irq line, two possible: 
host issue or guest issue.

If it's a host issue, host should try to stop it. If it can't, the IRQ line 
would be disabled, and guest device also isn't functional. 

If it's a guest issue, guest should try to stop it, and prevent it from 
causing trouble in host. KVM should try best including disable guest device 
to do this. So guest device also won't functional.

Base on above theory, we can assume that IRQ storm caused by assigned guest 
device, and try to stop device from doing this. (Yeah, anyway, guest device 
won't survive).

I think we can brought a little QoS concept here(stolen from Eddie :) ). The 
assumption is, the normal rate of device deliver interrupts is much slower 
than a continuous level trigger if the EOI is wrote immediately. So we can do 
something with the gap.

Measure the calling rate of our irq handler, if it's exceed some reasonable 
threshold, KVM would try to stop guest device for a while (even it don't know 
if the guest device cause this).

First to try set interrupt disable bit in Device Control Register, wait for a 
period of time, then check again.

If the irq strom can't be stopped, KVM try a more aggressive way: Do the 
Function Level Reset. It's should be the end of device's life...

Oh, of course, if even FLR didn't solve the IRQ storm, that's host's issue. 
Let's wait host to disable the IRQ line - of course, the guest device can't 
be recovered too.

It's just a initial purpose, I think it may work. The problem is if the gap is 
easy to catch... But at least, I think a physical continuous one should be 
much different from any working ones...

--
regards
Yang, Sheng

  parent reply	other threads:[~2008-09-28  5:54 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-24  6:15 Remaining passthrough/VT-d tasks list Han, Weidong
2008-09-24  6:31 ` Yang, Sheng
2008-09-24  6:58   ` Zhang, Xiantao
2008-09-24  7:41   ` Amit Shah
2008-09-24  7:51     ` Han, Weidong
2008-09-24  8:02       ` Amit Shah
2008-09-24  8:38         ` Han, Weidong
2008-09-24  8:49           ` Avi Kivity
2008-09-24  9:56           ` Amit Shah
2008-09-24 12:25             ` Han, Weidong
2008-09-24  8:46     ` Avi Kivity
2008-09-24  9:58       ` Amit Shah
2008-09-24 10:46         ` Avi Kivity
2008-09-24 14:46           ` Han, Weidong
2008-09-24  8:38   ` Avi Kivity
2008-09-24  8:46     ` Yang, Sheng
2008-09-27  9:15     ` Yang, Sheng
2008-09-27  9:49       ` Avi Kivity
2008-09-27 10:09         ` Jan Kiszka
2008-09-27 10:16           ` Avi Kivity
2008-09-28  6:03             ` Muli Ben-Yehuda
2008-09-28  1:48         ` Tian, Kevin
2008-09-28  2:03           ` Dong, Eddie
2008-09-28  2:29             ` Tian, Kevin
2008-09-28  4:22           ` Avi Kivity
2008-09-28  4:50             ` Tian, Kevin
2008-09-28  5:04               ` Avi Kivity
2008-09-28  5:17                 ` Yang, Sheng
2008-10-05 10:18                   ` Avi Kivity
2008-09-28  5:54                 ` Yang, Sheng [this message]
2008-09-24  8:34 ` Avi Kivity
2008-09-24  8:42   ` Yang, Sheng
2008-09-24  8:53     ` Avi Kivity
2008-09-24  9:08       ` Yang, Sheng
2008-09-24  9:22         ` Avi Kivity
2008-09-24  9:43           ` Yang, Sheng
2008-09-24  9:51             ` Avi Kivity
2008-09-28  6:09               ` Yang, Sheng
2008-09-24  9:40   ` Amit Shah
2008-09-24  9:46     ` Avi Kivity
2008-09-24 15:39   ` Dong, Eddie
2008-09-27 10:11     ` Avi Kivity
2008-09-28  2:28       ` Dong, Eddie
2008-09-28  4:25         ` Avi Kivity
2008-09-28  5:54           ` Dong, Eddie
2008-09-24  8:39 ` Avi Kivity
2008-09-24  8:50   ` Han, Weidong
2008-09-24  9:12     ` Avi Kivity
2008-09-24 15:12   ` Anthony Liguori
2008-09-24 15:38     ` Avi Kivity

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=200809281354.56553.sheng.yang@intel.com \
    --to=sheng.yang@intel.com \
    --cc=allen.m.kay@intel.com \
    --cc=amit.shah@redhat.com \
    --cc=avi@redhat.com \
    --cc=benami@il.ibm.com \
    --cc=eddie.dong@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=muli@il.ibm.com \
    --cc=weidong.han@intel.com \
    --cc=xiantao.zhang@intel.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 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).