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

Re: [Xen-users] VGA passthrough radeon 4850 as primary card


  • To: xen-users@xxxxxxxxxxxxx
  • From: Eric Shelton <eshelton@xxxxxxxxx>
  • Date: Thu, 28 Feb 2013 16:46:15 -0500
  • Delivery-date: Thu, 28 Feb 2013 21:47:49 +0000
  • List-id: Xen user discussion <xen-users.lists.xen.org>

After looking high and low for a solution for primary PCI passthrough,
I found the below patch works perfectly for doing primary passthrough
of my 6570 adapter (it was also fine with a 5450 I was using
previously):

http://lists.xen.org/archives/html/xen-devel/2012-12/msg00009.html

Note that I am running Xen 4.3-unstable and Linux kernel 3.7.8 on an
AMD platform.  I never tried it on 4.2.  One tricky part is applying
the patch at the right time, as QEMU is dynamically downloaded.
During "make tools" I wait until right after the git download of
qemu-traditional, CTRL-Z the make session to pause it, apply the patch
against qemu-traditional, and then "fg" the make session to let it
continue.  Since QEMU is built first in tools, you don't have to wait
long.

Apparently the Radeon cards are doing some oddball things in PCI
config space and one of the MMIO's.  The above patch (which is based
on a much older original patch) implements these quirks, taking into
account any MMIO address translation, and implements the intrinsic IO
and MMIO regions for a primary VGA device.  Additionally, it ensures
that the VGA rom is executed properly.  The patch is only good against
qemu-traditional, although I think the same techniques could be
readily implemented in qemu-unstable.  In fact, one of their
developers recently put out a patch essentially doing this:

http://lists.nongnu.org/archive/html/qemu-devel/2013-02/msg02759.html

The patch was worked far and away better than any of the other schemes
I have seen discussed.  I can boot into a clean HVM, see a regular
BIOS POST, run the Win 7 install disc, and install the Catalyst
drivers (although sometimes the driver install will have issues).
There is no need to do any tricks with installing with the emulated
Cirrus video and then rebooting without it later - you can just start
right off with a passthrough setup.

Running the provided script for unbinding and binding, I can
repeatedly shut down Windows, get back to a functional text console,
and start up the Windows HVM again without rebooting (with some
solutions, this does not work, and can even take down the system,
unless you do things like eject the video card in Windows, etc.).
Also the accompanying HDMI audio PCI device is also passed through and
streams audio successfully.  With this, I can run my HVM as an HTPC
(although HDCP still blocks protected content playback), which was one
of my goals with this system.  I am also doing passthrough of one of
my USB controllers to provide me with a keyboard and mouse, and
ultimately a USB HDMI-CEC adapter.

If you use the above patch, I think you should be able to painlessly
implement primary VGA PCI passthrough with a Radeon card (assuming
you're up for compiling Xen).

If the patch is cleaned up a little more (issues include: (1) I don't
think it instantiates the 0x3C0-DF VGA IO range for non-IGD/non-ATI
cards, (2) it may try to implement the VGA ranges for all cards - not
just the primary (observance of the VGA/ISA enable bits may help
this), and (3) there may be a few too many hard-coded values), it
would be nice to see this formally incorporated into 4.3, as it works
very nicely.


> Is there any special reason you use primary passthrough? because using
> the ati vga as secondary is A LOT easier and simpler (and as stable
> and performant). To be honest, i never got primary passthrough to work
> with any of my radeon cards, but secondary works quite well for 2,5
> years now.
>
> So my advice: use secondary, boot and install domU normally, then
> install the catalyst driver and reboot. Within the start-process, it
> will automatically switch to the right vga near the end of the boot
> and as an additional benefit you can use the vnc view as additional
> input device if you for example don't have pci-passthrough for input
> devices or want a remote interface anyway (with for example a
> mediacenter).
>
> 2013/2/27 povder <povder@xxxxxxxxx>:
> > Hi all
> >
> > I'm trying to enable VGA passthrough in linux domU without success. I
> > want to pass through AMD Radeon HD 4850 - 03:00.0 VGA compatible
> > controller: Advanced Micro Devices [AMD] nee ATI RV770 [Radeon HD
> > 4850] as a _primary_ VGA for the VM. Nothing is showing up on the
> > monitor that I have connected to graphics card's HDMI port. I have
> > IOMMU enabled. I searched mailing lists and I don't know what to think
> > about it. There is some information about ATI cards passthrough as
> > primary VGA, some patches were posted but that was long time ago so my
> > first question is:
> > Is passthrough of ATI devices as primary VGA supposed to work now in
> > Xen 4.2.1 without patches?
> >
> > My second question is:
> > How can i debug the problem? I can't access domU through SSH after
> > it's created. When I set gfx_passthru to 0 it's starting normally. How
> > can I tell what went wrong?
> >
> > When I create domU I get this in logs:
> > dm-command: hot insert pass-through pci dev
> > register_real_device: Assigning real physical device 03:00.0 ...
> > register_real_device: Disable MSI translation via per device option
> > register_real_device: Disable power management
> > pt_iomul_init: Error: pt_iomul_init can't open file
> > /dev/xen/pci_iomul: No such file or directory: 0x3:0x0.0x0
> > pt_register_regions: IO region registered (size=0x10000000
> > base_addr=0xd000000c)
> > pt_register_regions: IO region registered (size=0x00010000
> > base_addr=0xfe7f0004)
> > pt_register_regions: IO region registered (size=0x00000100
> > base_addr=0x0000d001)
> > pt_register_regions: Expansion ROM registered (size=0x00020000
> > base_addr=0xfe7c0002)
> > pci_intx: intx=1
> > register_real_device: Real physical device 03:00.0 registered successfuly!
> >
> > I'm using Xen 4.2.1 and xl toolstack. I have the following in VM config 
> > file:
> >
> > builder = "hvm"
> > gfx_passthru = 1
> > pci = ['03:00.0','03:00.1']
> >
> > vm config file:
> > full domU log: http://pastebin.com/raw.php?i=rc9xWcDJ
> > part of lspci -vvv: http://pastebin.com/raw.php?i=wZXcJU7j
> > xl info: http://pastebin.com/raw.php?i=zDrdNm9u
> > xl dmesg: http://pastebin.com/raw.php?i=SmJ7MrB1
> >
> > Please help.
> >
> > _______________________________________________
> > Xen-users mailing list
> > Xen-users@xxxxxxxxxxxxx
> > http://lists.xen.org/xen-users
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxx
> http://lists.xen.org/xen-users

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