xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Brychcy <alexander@brychcy.net>
To: xen-devel@lists.xen.org
Subject: Re: Struggling with PCI-Passthrough
Date: Tue, 25 Mar 2014 21:33:02 +0100	[thread overview]
Message-ID: <5331E7FE.7070007@brychcy.net> (raw)
In-Reply-To: <bebbd4673b5004bff1b21473d4715cac@mail.shatteredsilicon.net>

Am 25.03.2014 11:46, schrieb Gordan Bobic:
> 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.
> 

I think that should be the same weirdness. I declare the problem solved
:) vm will get their own dedicated controller when everythin else is
working.

>> 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.

Edited the config to 768MB - way below the address 2051MB. First i
though it works, but only because the 5 Minutes felt like hours. Win7 is
a pain in the ass with such scanty amount of memory.

>> 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
>>
Tried to apply the patch, but there were to many changes since 4.2.0 and
currently i don't have to time to find all the changes in the current files.
> 
> 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

I think it has definetly something to do with the memory mapping. I want
to assign 8GB of RAM to the hvm. And the dedicated memory of the gpu to
passthrough itself is 4GB. The thread "[Xen-devel] [PATCH v3 0/4] Add
max-ram-below-4g (was Add pci_hole_min_size machine option)" aroused my
attention.

Alexander

  reply	other threads:[~2014-03-25 20:33 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
2014-03-25 20:33           ` Alexander Brychcy [this message]
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=5331E7FE.7070007@brychcy.net \
    --to=alexander@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).