public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@sous-sol.org>
To: Alex Williamson <alex.williamson@hp.com>
Cc: Chris Wright <chrisw@sous-sol.org>,
	Sheng Yang <sheng@linux.intel.com>, kvm <kvm@vger.kernel.org>
Subject: Re: [RFC PATCH] PCI pass-through fixups
Date: Tue, 7 Apr 2009 08:47:52 -0700	[thread overview]
Message-ID: <20090407154752.GN27148@sequoia.sous-sol.org> (raw)
In-Reply-To: <1239117827.6184.74.camel@bling>

* Alex Williamson (alex.williamson@hp.com) wrote:
> On Tue, 2009-04-07 at 07:54 -0700, Chris Wright wrote:
> > * Sheng Yang (sheng@linux.intel.com) wrote:
> > > On Tuesday 07 April 2009 08:02:10 Chris Wright wrote:
> > > > * Alex Williamson (alex.williamson@hp.com) wrote:
> > > > > I'm wondering if we need a spot for device specific fixups for PCI
> > > > > pass-through.  In the example below, I want to expose a single port of
> > > > > an Intel 82571EB quad port copper NIC to a guest.  It works great until
> > > > > I shutdown the guest, at which point the guest e1000e driver knows by
> > > > > the device ID that the NIC is a quad port, and blindly attempts to
> > > > > twiddle some bits on the bridge above it (that doesn't exist).
> > > >
> > > > And what happens?
> > > 
> > > And the output of DEVICE_ASSIGNMENT_DEBUG=1 may help. And I don't have trouble 
> > > here with another dual/quad port card by Intel, but not 82571EB. 
> > 
> > Right, it's driver dependent.  I too can assign a single port w/out
> > trouble.  I'm assuming the guest just complains at rmmod?
> 
> No, it's a little more severe than that, see below.  This may be rather
> unique, I certainly wasn't expecting different device IDs for a quad
> port versus a single port.  However, you can see in
> e1000e/82571.c:e1000_get_variants_82571() we set a flag for quad port
> device IDs, apparently for WOL only being supported on the first port.
> Then when we shutdown, we hit e1000e/netdev.c:e1000_suspend() where we
> take that quad port flag and blindly walk up to bus->self, which is
> NULL, and try to get the PCI capabilities on it.

That's a form of guest complaint ;-)  Yes, I noticed the global wol bit,
but didn't see the bus->self...ick

> It may be prudent for the driver to check the pointer, but there's
> probably also an argument that the device ID indicates something about
> the topology that makes that unnecessary, so we may hit the same problem
> in drivers we don't have source for.  I agree that my rough sketch of a
> patch is pretty fragile and static.  Maybe an option to override a
> device ID on the command line would be more flexible.  Something like:
> 
> -pcidevice host=09:00.0,device_id=0x105E
> 
> This puts the burden on the user, but at least allows us an out.

Still ugly, esp since there's no real way to know ahead of time

      reply	other threads:[~2009-04-07 15:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-03 20:16 [RFC PATCH] PCI pass-through fixups Alex Williamson
2009-04-07  0:02 ` Chris Wright
2009-04-07  6:25   ` Sheng Yang
2009-04-07 14:54     ` Chris Wright
2009-04-07 15:23       ` Alex Williamson
2009-04-07 15:47         ` Chris Wright [this message]

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=20090407154752.GN27148@sequoia.sous-sol.org \
    --to=chrisw@sous-sol.org \
    --cc=alex.williamson@hp.com \
    --cc=kvm@vger.kernel.org \
    --cc=sheng@linux.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