[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-users] Problems with VGA Passthrough



Hi all,
I'm trying, without success, to get VGA Passthrough working.
My relevant hardware configuration is:
- Intel i7-3770 (supports VT-d)
- ASRock Z77 Pro4-M (VT-x and VT-d enabled from BIOS)
- AMD Radeon HD7750, enumerated as 01:00.0 (VGA) and 01:00.1 (HD audio)
- AMD Radeon HD6450, enumerated as 02:00.0 and 02:00.1 (I physically removed this one on my latest tests) 

On dom0 I run an Ubuntu Server 12.04.2 LTS 64 bit, kernel version 3.5.0-34.55~precise1, xm tools.
I have a Windows 7 32 bit virtual machine that works regularly with gfx_passthru=0

I blacklisted modules radeon and snd_hda_intel.
At boot, console is on HD7750, then it switches to onboard Intel HD Graphics, leaving the HD7750 screen black and on.
In /etc/rc.local I call a script to bind pciback driver to 01:00.0, 01:00.1, 02:00.0, and 02:00.1
My tests were mainly with HD7750, but I gave some tries also to HD6450

I used:
- Ubuntu supplied Xen 4.1.2-2ubuntu2.10
- Xen 4.2.2 built from sources
- Xen 4.3-unstable from git HEAD

The results:
- Xen 4.1.2-2ubuntu2.10
  - with gfx_passthru=1 and pci=['01:00.0'] xm create apparently works but the screen remains off (to be precise, it goes DPMS off on the first run after a reboot and stays off for the followings)
  - with gfx_passthru=0 and pci=['01:00.0','01:00.1'] xm create fails with "Error: (22, 'Invalid argument')" (but the screen goes off on the first try after a reboot)

- Xen 4.2.2
Build:
  - git clone git://xenbits.xen.org/xen.git xen-devel
  - git branch pac-4.2.2 RELEASE-4.2.2
  - git checkout pac-4.2.2
  - ./configure --prefix=/usr/local
  - make -j9 world
  Install:
  - sudo make -j9 install
  - replacement of /etc/init.d/xen* with modified ones in order to make everything start on Ubuntu
  - ldconfig
  - reboot
Results:
  - with gfx_passthru=0 and pci=['01:00.0','01:00.1'] xm create fails with "Error: (22, 'Invalid argument')" (but the screen goes off on the first try after a reboot)
  - with gfx_passthru=0 and pci=['01:00.0'] xm create works
  - with gfx_passthru=1 and pci=['01:00.0'] xm create starts the virtual machine but the screen remains off, VM CPU stays high (~70%) until xm shutdown; if I start again the VM with gfx_passthru=0, it starts and Windows does not complain about being shut down uncleanly (I think that with gfx_passthru=1 guest OS does not even start bootstrapping)

- Xen 4.3-unstable
Build:
  - git checkout master
  - git clean -f -d -x
  - git reset --hard
  - git branch pac-4.3-unstable 
  - git checkout pac-4.3-unstable
  - ./configure
  - make -j9 world
Install:
  - sudo make -j9 install
  - replacement of /etc/init.d/xen* with modified ones in order to make everything start on Ubuntu
  - ldconfig
  - reboot
Results:
  - with gfx_passthru=0 and without pci=... xm create works, VM starts and works, screen stays black & on
  - with gfx_passthru=0 and pci=['01:00.0','01:00.1'] xm create works, VM starts and works, screen goes off
  - with gfx_passthru=1 and pci=['01:00.0','01:00.1'] xm create starts VM, screen goes off, VM CPU goes 70% and stays there; VM does not boot; last message I see with xm dmesg is ROMBIOS Revision "$Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $"

I investigated  4.3-unstable. Adding logs to tools/firmware/rombios/rombios.c, I discovered that VM gets stuck in call to VGA ROM init.

I also gave a look to the 'Invalid argument' failure in 4.2.2
Call to pirq_permit_access() on IRQ 17, the interrupt of HD audio at 01.00.1 , returns -EINVAL
The failing call chain is:
  do_domctl(cmd=XEN_DOMCTL_irq_permission, allow=1, pirq=17) ->
  pirq_permit_access() ->
  domain_pirq_to_irq() ->
  pirq_field() ->
  pirq_info() ->
  radix_tree_lookup()

radix_tree_lookup() fails to find the structure for IRQ 17, while it succeeds finding IRQ 16, belonging to VGA at 01.00.0

I tried also secondary passthrough, but the native driver installation program crashes and shortly afterwards Windows guest goes blue screen.

Here is my VM configuration:

builder='hvm'
memory = 1024
vcpus=1
name = "win7"
vif = ['bridge=xenbr0']
disk = ['phy:/dev/xen2/win7,hda,w']
acpi = 1
device_model_version = "qemu-xen-traditional"
device_model = 'qemu-dm'
stdvga=1
usbdevice='tablet'
boot="c"
sdl=0
serial='pty'
vnc=1
vnclisten="0.0.0.0"
vncpasswd=""
vncdisplay="7"
xen_platform_pci=1
viridian=1
apic=1
gfx_passthru=1
pci=['01:00.0','01:00.1']


I can provide all the configuration files and logs you desire.
I can also try patches, other Xen versions and, if needed, another kernel (even building it from sources), but I fear I'm missing some very basic detail :-/
What are your advices?

Cheers,

Paolo

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.