From: Alex Williamson <alex.williamson@redhat.com>
To: James Neave <roboj1m@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: PCI Passthrough, error: The driver 'pci-stub' is occupying your device 0000:08:06.2
Date: Mon, 14 Feb 2011 10:48:48 -0700 [thread overview]
Message-ID: <1297705728.14733.50.camel@x201> (raw)
In-Reply-To: <AANLkTikGh83Y6oh0HibucFBYwmroLgMkqgtCaVxHvCye@mail.gmail.com>
On Sat, 2011-02-12 at 16:04 +0000, James Neave wrote:
> On Tue, Feb 8, 2011 at 10:17 AM, James Neave <roboj1m@gmail.com> wrote:
> > On Tue, Feb 8, 2011 at 9:59 AM, Kenni Lund <kenni@kelu.dk> wrote:
> >> 2011/2/7 Daniel P. Berrange <berrange@redhat.com>:
> >>> On Sat, Feb 05, 2011 at 04:34:01PM +0000, James Neave wrote:
> >>>> Hi,
> >>>>
> >>>> I'm trying to pass a NOVA-T-500 TV Tuner card through to a gust VM.
> >>>> I'm getting the error "The driver 'pci-stub' is occupying your device
> >>>> 0000:08:06.2"
> >>>
> >>> This is a rather misleading error message. It is *expected* that
> >>> pci-stub will occupy the device. Unfortunately the rest of the
> >>> error messages QEMU is printing aren't much help either, but
> >>> ultimately something is returning -EBUSY in the PCI device assign
> >>> step
> >>
> >> James, as far as I remember, I had the same issue when I set up my
> >> system. Looking at my current (working) boot-script, apparently I've
> >> added a 4th line which removes the pci-stub again as a
> >> workaround....and it works:
> >>
> >> echo "4444 0016" > /sys/bus/pci/drivers/pci-stub/new_id
> >> echo "0000:04:08.0" > /sys/bus/pci/drivers/ivtv/unbind
> >> echo "0000:04:08.0" > /sys/bus/pci/drivers/pci-stub/bind
> >> echo "4444 0016" > /sys/bus/pci/drivers/pci-stub/remove_id
> >>
> >> Best regards
> >> Kenni
> >>
> >
> > Hi Kenni,
> >
> > Can I get a bit more information on "boot-script" please? Which file
> > exaclty have you put this in? Did you write your own service script
> > and put it in init.d?
> >
> > I've tried this:
> >
> > echo "8086 10b9" > /sys/bus/pci/drivers/pci-stub/new_id
> > echo 0000:01:00.0 > /sys/bus/pci/devices/0000:01:00.0/driver/unbind
> > echo 0000:01:00.0 > /sys/bus/pci/drivers/pci-stub/bind
> >
> > I'll try it again with the fourth line added, manually before I start the VM.
> >
> > How come yours is 'echo "PCI" > /sys/bus/drivers/DRIVERNAME/unbind'
> > and mine is echo "PCI" > /sys/bus/pci/devices/PCI/driver/unbind
> >
> > Obviously one looks up which driver is being used by the PCI id, but
> > how do I look up which driver my PCI card is using?
> >
> > Thanks,
> >
> > James.
> >
>
> Hi,
>
> OK, adding the fourth line does nothing, changing the second line to
> "driver" rather than "device" does nothing, including in combination
> with fourth line there/not there.
Yep, the last line is just removing the id from pci-stub, it doesn't
change anything about devices that are already bound to it. driver vs
device are just different ways to get to the same thing.
> So I'm still stuck, can anybody else help?
> Perhaps point me to a guide on how to compile the latest qemu-kvm
> against my kernel?
I don't know why you're getting -EBUSY for this device, but maybe we can
start from a clean slate and see if it helps. Here's what I would
suggest:
echo "0000:08:06.0" > /sys/bus/pci/devices/0000:08:06.0/driver/unbind
echo "0000:08:06.1" > /sys/bus/pci/devices/0000:08:06.1/driver/unbind
echo "0000:08:06.2" > /sys/bus/pci/devices/0000:08:06.2/driver/unbind
echo "0000:08:0e.0" > /sys/bus/pci/devices/0000:08:0e.0/driver/unbind
Note we have to knock out the firewire because it shares an interrupt
with the ehci device you're trying to assign. We want to remove the USB
controller entirely from the host. Your dmesg indicates the host is
still seeing the device via the uhci ports, and isn't happy about it.
You can ignore pci-stub for the moment, it's just a way to keep drivers
from claiming the device, it's not required for device assignment. Now,
instead of only trying to assign the ehci, let's move the whole usb
controller to the guest:
-device pci-assign,host=08:06.0,addr=5.0 \
-device pci-assign,host=08:06.1,addr=5.1 \
-device pci-assign,host=08:06.2,addr=5.2
(slot 5 on the guest is arbitrary, pick something else if you need to)
If that works, then you can bind all those devices to pci-stub and it
should still work.
Alex
next prev parent reply other threads:[~2011-02-14 17:48 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-05 16:34 PCI Passthrough, error: The driver 'pci-stub' is occupying your device 0000:08:06.2 James Neave
2011-02-07 13:26 ` Daniel P. Berrange
2011-02-08 9:13 ` James Neave
2011-02-08 9:59 ` Kenni Lund
2011-02-08 10:17 ` James Neave
2011-02-12 16:04 ` James Neave
2011-02-14 17:48 ` Alex Williamson [this message]
2011-02-21 20:31 ` James Neave
2011-02-21 21:01 ` Alex Williamson
2011-02-21 22:25 ` James Neave
2011-02-21 22:49 ` James Neave
2011-02-21 22:55 ` James Neave
2011-02-21 23:05 ` James Neave
2011-02-22 1:51 ` Chris Wright
2011-02-22 9:18 ` James Neave
2011-02-22 9:53 ` Roedel, Joerg
2011-02-22 10:11 ` James Neave
2011-02-23 0:11 ` Chris Wright
2011-02-23 19:44 ` James Neave
2011-02-23 20:09 ` James Neave
2011-02-24 9:26 ` James Neave
2011-02-25 0:13 ` Chris Wright
2011-02-25 0:06 ` Chris Wright
2011-02-25 22:47 ` James Neave
2011-02-25 23:02 ` James Neave
2011-02-25 23:09 ` James Neave
2011-02-25 23:31 ` Chris Wright
2011-02-28 13:42 ` James Neave
2011-02-28 15:31 ` Chris Wright
2011-02-28 20:25 ` James Neave
2011-03-01 20:54 ` James Neave
[not found] ` <BANLkTi=ZHpHU=Gd+tTcLysTD3duGY8PPjQ@mail.gmail.com>
2011-05-10 16:00 ` James Neave
2011-02-25 23:14 ` Chris Wright
2011-02-24 23:59 ` Chris Wright
2011-02-21 23:28 ` Chris Wright
2011-02-21 23:50 ` James Neave
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=1297705728.14733.50.camel@x201 \
--to=alex.williamson@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=roboj1m@gmail.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