From: Patrick Ringl <patrick_@freenet.de>
To: kvm@vger.kernel.org
Subject: PCI-passthrough - issues/questions/ideas
Date: Sat, 10 Sep 2011 11:09:10 +0200 [thread overview]
Message-ID: <4E6B2936.4080005@freenet.de> (raw)
Hi,
I just wanted to introduce a problem I currently face including some
questions regarding my temporary fix.
Anyway, I have a PCI-device that I want to passthrough to a hvm guest.
Now there are several problems that add up:
a) the PCI-device is bound to a PCI-to-PCI bridge (which in turn is
directly attached to the rootbus) (mainboard has a AMD 970/SB950 chipset).
[since pciIsParent shows that the secondary bus equals the device's bus]:
bridge:
> lspci -s00:14.4 -vvv | grep Bus:
> Bus: primary=00, secondary=07, subordinate=07, sec-latency=64
PCI-device
> 07:06.0 Multimedia controller: Philips Semiconductors SAA7146 (rev 01)
b) neither the bridge nor the PCI device itself have the currently
implemented reset functionality that you trigger in pciResetDevice
c) the PCI-device is mapped through the PCI bridge (IOMMU-wise):
ACPI IOMMU dump:
> [ 1.121239] AMD-Vi: DEV_SELECT devid: 00:14.4 flags: 00
> [ 1.121274] AMD-Vi: DEV_ALIAS_RANGE devid: 07:00.0
flags: 00 devid_to: 00:14.4
> [ 1.121311] AMD-Vi: DEV_RANGE_END devid: 07:1f.7
What I did to get (temporarily and in a rather hackish (maybe even
wrong) manner) rid of the problem, is to ignore the error thrown in
pciResetDevice when no reset had been possible at all.
if (ret < 0) {
/*
-- I know what you did last summer!
virErrorPtr err = virGetLastError();
pciReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to reset PCI device %s: %s"),
dev->name,
err ? err->message : _("no FLR, PM reset or bus
reset available"));
*/
ret = 0;
}
Concludingly I'd ask the following questions:
a) Why is a secondary_bus_reset a bad idea if the "device in question"'s
_primary_ bus is the root bus?
b) Why would it be a bad idea adding some sort of 'override attribute'
to the guest's config, so libvirt may intentionally skip the reset? What
are the possible consequences if no reset takes place at all?
c) What options do I have besides implementing c) or just going the
dirty way and ignore the case when no reset is possible (like I
described above)?
PS : Since I am not subscribed, please CC to me
PPS: Please cut me slack ;)
regards,
Patrick
next reply other threads:[~2011-09-10 9:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-10 9:09 Patrick Ringl [this message]
2011-09-23 19:11 ` PCI-passthrough - issues/questions/ideas Chris Wright
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=4E6B2936.4080005@freenet.de \
--to=patrick_@freenet.de \
--cc=kvm@vger.kernel.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 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.