xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Gordan Bobic <gordan@bobich.net>
To: Alexander Brychcy <bober@brychcy.net>, xen-devel@lists.xen.org
Subject: Re: Struggling with PCI-Passthrough
Date: Tue, 25 Mar 2014 10:46:33 +0000	[thread overview]
Message-ID: <bebbd4673b5004bff1b21473d4715cac@mail.shatteredsilicon.net> (raw)
In-Reply-To: <5330850D.6050608@brychcy.net>

On 2014-03-24 19:18, Alexander Brychcy wrote:

> As ever there are only problems with domU #2. The first one, that i
> could not passthrough an USB controller resolved. No matter at which
> port you plug an USB device on the mainboard, it is always assigned to
> the XHCI controller.

I found that on Intel ICH USB controllers the PCI USB device that the
USB device is attached to changes dependant on what is connected. There
is some odd routing going on. This is especially the case when a USB
hub is connected to a port. If you just want to pass through, say, a
keyboard, it is stable, but IIRC the device has to be connected to the
port before you re-assign the PCI device that is the port to 
xen-pcistub.

My motherboard also comes with a NEC USB 3.0 adapter on-board which
doesn't suffer from this problem, so for VMs that require multiple
USB devices I have a USB hub on that controller and I pass the
whole controller to the VM.

> My workaround is to add another PCIe USB controller
> for the vm, so i'm still able to have usb connection in dom0 for backup
> or other purposes.

Sounds similar to what I do. Note that you can also pass specific USB
devices to the domU, rather than using PCI passthrough for the USB
controllers. Unfortunately this comes with ~5% CPU idling overhead
in domU due to USB polling.

> Tried to passthrough a NIC to verify if it is a bios related bug. This
> works without any problems and nothing freezes at all.

I suspect you are just seeing the Intel ICH USB weirdness I described
above.

> So last but not least the VGA Passthrough. Issue is still present. HVM
> boots and GPU is assigned and working. But after some time respectively
> an application tries to access some kind of function the whole system
> freezes.

How much RAM are you passing to the VM? It is possible your motherboard
suffers from the same problem as mine and IOMEM DMA is bypassing the
root PCIe hub. Do the following:

lspci -v | grep "Memory at" | sed -e 's/.*Memory at //' -e 's/ .*//' | 
sort

Convert the first address that comes back from hex, and set the amount
of memory you are passing to your VM to a few MB below that.

Then see if the crash still happens after a while. If it doesn't, then
there is a good chance that what is happening is that your VM's
memory is trampling over the IOMEM region of the host because it
isn't being translated by the IOMMU, probably because DMA is
bypassing it. In my case this is caused by a bug/feature of NF200
PCIe switches, but it could also be caused by a buggy motherboard
chipset or firmware.

> Nearly forgot the RAM problem. The maximum amount of RAM i can assign 
> to
> the HVM when i passthrough the GPU is 3GB. Haven't tried it yet but may
> this patch still be usable with 4.4.0?
> http://www.davidgis.fr/blog/index.php?2013/04/05/937-xen-43-unstable-vga-passthrough-hd-7970-windows-7-64-bits-with-more-than-3gb-for-ram

I think this is for a different bug, but probably worth a try
depending on what results you get with domU memory size reduced to
ensure it cannot trample IOMEM regions.

Gordan

  reply	other threads:[~2014-03-25 10:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-10  9:59 Struggling with PCI-Passthrough Alexander Brychcy
2014-03-10 11:09 ` Andrew Cooper
2014-03-11 10:26   ` Alexander Brychcy
2014-03-11 10:49     ` Andrew Cooper
2014-03-24 19:18       ` Alexander Brychcy
2014-03-25 10:46         ` Gordan Bobic [this message]
2014-03-25 20:33           ` Alexander Brychcy
2014-03-25 23:40             ` Gordan Bobic

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=bebbd4673b5004bff1b21473d4715cac@mail.shatteredsilicon.net \
    --to=gordan@bobich.net \
    --cc=bober@brychcy.net \
    --cc=xen-devel@lists.xen.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 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).