Patches for VGA-Passthrough XEN 4.2 unstable

classic Classic list List threaded Threaded
105 messages Options
1234 ... 6
Reply | Threaded
Open this post in threaded view
|

Patches for VGA-Passthrough XEN 4.2 unstable

JavMV

Hello, I have been working on VGA-passthrough in the last month.

When Xen was at his version 3.5 there was a few patches to make this work for some graphic cards using the patches developed by Han Weidong and posted here (http://lists.xensource.com/archives/html/xen-devel/2009-08/msg01176.html) and the same patches posted file by file are here (http://lists.xensource.com/archives/html/xen-devel/2010-05/msg00441.html)  but now this patches doesn't work on Xen-4.2 unstable because the source code has changed. Well, as I am really interested on VGA-Passthru I have adapted those patches to the new version of xen. I have attached them for you to try it and want to know if they are still working.

This patch set should work for the same graphic cards that it worked on the past (NVIDIA GT200, Geforce 8400 GS ...).

The steps are the same:
Before all that, you need to read out the VGA Bios of the to-be-passthroughed-
Graphiccard with a tool; i used nvflash.exe under DOS for this task.
The patches assume you saved this file as "vgabios-pt.bin"
1. check out xen unstable:
hg clone http://xenbits.xensource.com/xen-unstable.hg (Or download the tarball xen-unstable.gz which I did)
2. go into there and do an "initial build" so that qemu-dm gets checked-out:
cd xen-unstable.hg; cd tools; make ; make clean
3. apply the patches from within the "xen-unstable.hg" dir, with patch -p0
4. move the vgabios-pt.bin to "tools/firmware/vgabios/"
4. do a "make install"


This is only for primary graphic card passthru, I didn't adapt the patch "qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch" but if anyone need it I can do it too.

Unfortunately these patches don't work for my NVIDIA GTX460 graphic card. If anybody knows how can I make VGA-Passtrhough for this one it would be great! (Or if it is not possible tell me too plz)

I hope you find this helpful.




config.patch (522 bytes) Download Attachment
dsdt.patch (2K) Download Attachment
hvmloader.patch (1K) Download Attachment
Makefile.patch (1K) Download Attachment
passthrough.patch (1K) Download Attachment
rombios.patch (3K) Download Attachment
JavMV
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

Stefano Stabellini-3
On Wed, 18 May 2011, JavMV wrote:

>
> Hello, I have been working on VGA-passthrough in the last month.
>
> When Xen was at his version 3.5 there was a few patches to make this work for some graphic cards using the patches
> developed by Han Weidong and posted here (http://lists.xensource.com/archives/html/xen-devel/2009-08/msg01176.html) and
> the same patches posted file by file are here (http://lists.xensource.com/archives/html/xen-devel/2010-05/msg00441.html
> but now this patches doesn't work on Xen-4.2 unstable because the source code has changed. Well, as I am really interested
> on VGA-Passthru I have adapted those patches to the new version of xen. I have attached them for you to try it and want to
> know if they are still working.
>
> This patch set should work for the same graphic cards that it worked on the past (NVIDIA GT200, Geforce 8400 GS ...).
>
> The steps are the same:
>
> Before all that, you need to read out the VGA Bios of the to-be-passthroughed-
> Graphiccard with a tool; i used nvflash.exe under DOS for this task.
> The patches assume you saved this file as "vgabios-pt.bin"
>
> 1. check out xen unstable:
>     hg clone http://xenbits.xensource.com/xen-unstable.hg (Or download the tarball xen-unstable.gz which I did)
> 2. go into there and do an "initial build" so that qemu-dm gets checked-out:
>     cd  xen-unstable.hg; cd tools; make ; make clean
> 3. apply the patches from within the "xen-unstable.hg" dir, with patch -p0
> 4. move the vgabios-pt.bin to "tools/firmware/vgabios/"
> 4. do a "make install"
> This is only for primary graphic card passthru, I didn't adapt the patch "qemu-claim-vga-cycle-for-secondary-gfx-passthrou
> gh.patch" but if anyone need it I can do it too.
> Unfortunately these patches don't work for my NVIDIA GTX460 graphic card. If anybody knows how can I make VGA-Passtrhough
> for this one it would be great! (Or if it is not possible tell me too plz)
> I hope you find this helpful.
Thanks for your work! However my MUA cannot open your attachments, could
you please send them again, maybe inline one email per patch?
I think it is also worth updating the wiki page about VGA passthrough
with your patches:

http://wiki.xensource.com/xenwiki/XenVGAPassthrough
_______________________________________________
Xen-devel mailing list
[hidden email]
http://lists.xensource.com/xen-devel
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

Pasi Kärkkäinen
On Mon, May 23, 2011 at 11:48:00AM +0100, Stefano Stabellini wrote:

> On Wed, 18 May 2011, JavMV wrote:
> >
> > Hello, I have been working on VGA-passthrough in the last month.
> >
> > When Xen was at his version 3.5 there was a few patches to make this work for some graphic cards using the patches
> > developed by Han Weidong and posted here (http://lists.xensource.com/archives/html/xen-devel/2009-08/msg01176.html) and
> > the same patches posted file by file are here (http://lists.xensource.com/archives/html/xen-devel/2010-05/msg00441.html
> > but now this patches doesn't work on Xen-4.2 unstable because the source code has changed. Well, as I am really interested
> > on VGA-Passthru I have adapted those patches to the new version of xen. I have attached them for you to try it and want to
> > know if they are still working.
> >
> > This patch set should work for the same graphic cards that it worked on the past (NVIDIA GT200, Geforce 8400 GS ...).
> >
> > The steps are the same:
> >
> > Before all that, you need to read out the VGA Bios of the to-be-passthroughed-
> > Graphiccard with a tool; i used nvflash.exe under DOS for this task.
> > The patches assume you saved this file as "vgabios-pt.bin"
> >
> > 1. check out xen unstable:
> >     hg clone http://xenbits.xensource.com/xen-unstable.hg (Or download the tarball xen-unstable.gz which I did)
> > 2. go into there and do an "initial build" so that qemu-dm gets checked-out:
> >     cd  xen-unstable.hg; cd tools; make ; make clean
> > 3. apply the patches from within the "xen-unstable.hg" dir, with patch -p0
> > 4. move the vgabios-pt.bin to "tools/firmware/vgabios/"
> > 4. do a "make install"
> > This is only for primary graphic card passthru, I didn't adapt the patch "qemu-claim-vga-cycle-for-secondary-gfx-passthrou
> > gh.patch" but if anyone need it I can do it too.
> > Unfortunately these patches don't work for my NVIDIA GTX460 graphic card. If anybody knows how can I make VGA-Passtrhough
> > for this one it would be great! (Or if it is not possible tell me too plz)
> > I hope you find this helpful.
>
> Thanks for your work! However my MUA cannot open your attachments, could
> you please send them again, maybe inline one email per patch?
> I think it is also worth updating the wiki page about VGA passthrough
> with your patches:
>
> http://wiki.xensource.com/xenwiki/XenVGAPassthrough
>

Yep, indeed, thanks a lot for the patches!

JavMV: Did you take a look at the other Xen VGA passthru
patches posted last week (or so..) ? They make it possible
to dynamically load the firmware, so there's no need to
'hardcore' it into xen/qemu binaries.

It would be nice to get all these patches reviewed
and committed to xen-unstable.

-- Pasi


_______________________________________________
Xen-devel mailing list
[hidden email]
http://lists.xensource.com/xen-devel
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

Pavel Matěja
> On Mon, May 23, 2011 at 11:48:00AM +0100, Stefano Stabellini wrote:
> > On Wed, 18 May 2011, JavMV wrote:
> > > Hello, I have been working on VGA-passthrough in the last month.
> > >
> > > This patch set should work for the same graphic cards that it worked on
> > > the past (NVIDIA GT200, Geforce 8400 GS ...).
>
> Yep, indeed, thanks a lot for the patches!
>
> JavMV: Did you take a look at the other Xen VGA passthru
> patches posted last week (or so..) ? They make it possible
> to dynamically load the firmware, so there's no need to
> 'hardcore' it into xen/qemu binaries.
>
> It would be nice to get all these patches reviewed
> and committed to xen-unstable.

This patchset breaks AMD VGA Passthrough. I think it's the "vBAR=pBAR" part.
Don't commit them pls.
--
Pavel Mateja

_______________________________________________
Xen-devel mailing list
[hidden email]
http://lists.xensource.com/xen-devel
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

JavMV
Hi again, i have been bussy... So this patchset breaks AMD VGA Passthrough but doesnt break Intel's? if this works for intel it is something so why dont commit them?

Passi:
Can u post the link for the other patchs u mention above? I can't found them and would be nice to have a look at that patches
JavMV
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

JavMV
Ok, I have already found the post u mentioned, Im going to have a look at it. I'll post something about that later.
JavMV
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

JavMV
Well, Hi again!

I have been trying to understand the code of the patch for ATI cards that makes possible
to dynamically load the firmware but it is really large and my goal is to get passthrough for my NVIDIA card
so I'm not going to use it (and I dont know how..) Im really stucked...
Do you know someone in xen-dev who is working on passthrouh actually?

Maybe I get an ATI card like Liwei (the other person who was trying to get GTX460 working with passtru) seems like passthru for NVIDIA cards are too much difficult, and there is no documentation to help us in any way...

Well, as I'm thinking to buy a new graphic card I have done a list that seems to work with this feature, I post it here, maybe is usefull for some of you. (The list is based on reports that people have sent to xen-dev)

- Nvidia officially supports only Quadro FX 3800, 4800 and 5800

- Tested adapters by AMD: Radeon 4850, Radeon 4870, FirePro V5700 and FirePro M5800.

- User reported working adapters:
 
 + ATI HD4550, ATI HD5750, using the Catalyst 10-9 driver on Win7 32bit. Radeon 4770 on Fedora 12, WinXP and Win7.
 + NVIDIA GT200 (GeForce GTX 260)
 + NVIDIA 9500 GT
 + ATI 5450 with open source drivers.
 + AMD/ATI HD6850. (Esta es de las últimas)

Well if anyone knows anything about passthru on GTX460 would be greatly appreciated
JavMV
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

Konrad Rzeszutek Wilk
On Thu, Jun 23, 2011 at 12:18:21PM -0700, JavMV wrote:
> Well, Hi again!
>
> I have been trying to understand the code of the patch for ATI cards that
> makes possible
> to dynamically load the firmware but it is really large and my goal is to
> get passthrough for my NVIDIA card
> so I'm not going to use it (and I dont know how..) Im really stucked...
> Do you know someone in xen-dev who is working on passthrouh actually?

The ATI guys (guy) are definitly doing this.
>
> Maybe I get an ATI card like Liwei (the other person who was trying to get
> GTX460 working with passtru) seems like passthru for NVIDIA cards are too
> much difficult, and there is no documentation to help us in any way...

Well, it is more that there is no documention on the NVIDIA cards and there
are some hacks neccessary for it to work. The business ends cards do seem
to have the proper BIOS to not be an issue.

>
> Well, as I'm thinking to buy a new graphic card I have done a list that
> seems to work with this feature, I post it here, maybe is usefull for some
> of you. (The list is based on reports that people have sent to xen-dev)
>
> - Nvidia officially supports only Quadro FX 3800, 4800 and 5800
>
> - Tested adapters by AMD: Radeon 4850, Radeon 4870, FirePro V5700 and
> FirePro M5800.
>
> - User reported working adapters:
>  
>  + ATI HD4550, ATI HD5750, using the Catalyst 10-9 driver on Win7 32bit.
> Radeon 4770 on Fedora 12, WinXP and Win7.
>  + NVIDIA GT200 (GeForce GTX 260)
>  + NVIDIA 9500 GT
>  + ATI 5450 with open source drivers.
>  + AMD/ATI HD6850. (Esta es de las últimas)
>
> Well if anyone knows anything about passthru on GTX460 would be greatly
> appreciated

>
>
> -----
> JavMV
> --
> View this message in context: http://xen.1045712.n5.nabble.com/Patches-for-VGA-Passthrough-XEN-4-2-unstable-tp4406265p4518721.html
> Sent from the Xen - Dev mailing list archive at Nabble.com.
>
> _______________________________________________
> Xen-devel mailing list
> [hidden email]
> http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[hidden email]
http://lists.xensource.com/xen-devel
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

JavMV
Thanks for your reply
JavMV
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

komkon555
This post has NOT been accepted by the mailing list yet.
This post was updated on .
In reply to this post by JavMV
        Hallo. Today I tried VGA-passthrough for my GeForce GTX 260 to WindowsXP-guest.  Unfortunately the client will not start with this error reported: “Error: Timed out waiting for device model action”.  As far as VGA-passthrough in client.hvm is deactivated, it starts normally.  There were some errors while applying  your patches.  See the log:
 
root@squeezexen:/usr/local/src/xen-unstable.hg# patch -p0 < ./config.patch

patching file tools/firmware/hvmloader/config.h

Hunk #1 succeeded at 5 with fuzz 2.

root@squeezexen:/usr/local/src/xen-unstable.hg# patch -p0 < ./dsdt.patch

patching file tools/firmware/hvmloader/acpi/dsdt.asl

root@squeezexen:/usr/local/src/xen-unstable.hg# patch -p0 < ./hvmloader.patch

patching file tools/firmware/hvmloader/hvmloader.c

Hunk #1 FAILED at 113.

Hunk #2 FAILED at 433.

2 out of 2 hunks FAILED -- saving rejects to file tools/firmware/hvmloader/hvmloader.c.rej

root@squeezexen:/usr/local/src/xen-unstable.hg# patch -p0 < ./Makefile.patch

patching file tools/firmware/hvmloader/Makefile

root@squeezexen:/usr/local/src/xen-unstable.hg# patch -p0 < ./passthrough.patch

patching file tools/ioemu-remote/hw/pass-through.c

root@squeezexen:/usr/local/src/xen-unstable.hg# patch -p0 < ./rombios.patch

patching file tools/firmware/hvmloader/rombios.c

Hunk #1 succeeded at 40 (offset -2 lines).

Hunk #2 FAILED at 155.

1 out of 2 hunks FAILED -- saving rejects to file tools/firmware/hvmloader/rombios.c.rej


As for IOMMU-support on my Computer (Tyan S7025):

(XEN) Intel VT-d Snoop Control not enabled.

(XEN) Intel VT-d Dom0 DMA Passthrough not enabled.

(XEN) Intel VT-d Queued Invalidation enabled.

(XEN) Intel VT-d Interrupt Remapping enabled.

(XEN) Intel VT-d Shared EPT tables not enabled.

(XEN) I/O virtualisation enabled
.
(XEN)  - APIC MMIO access virtualisation
.

Can you please fix all patches for current version of XEN-unstable (4.2)?
Best regards.
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

komkon555
This post was updated on .
I have no luck with xen 4.2-unstable changeset 23350 + jeremi xen kernel 2.6.32.43/45 (xenfs static) on debian squeeze. I see Windows XP greeting screen followed by blue screen (BSOD) a few seconds later.
Does anybody know for sure if these patches are functional?

Thank you in advance.

P.S. My hardware:
Tyan S7025
VGA to passthrough: nvidia GTX 260

Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

JavMV
Hi Komkon,

These patches were functional when I posted it, but now maybe xen-unstable has changed the source code because xen-unstable4.2 is supossed to stay in constant change (untill they decide to make a final release).

Maybe (and just maybe) I will adapt them again in October because I have to include a successful example in a paper. If i finally adapt them I will post the patchset for u to try it, i will need some feedback if u try it and it works sucessfully.

JavMV
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

komkon555
Thank you for reply. The point is: I used xen-sources from the about estimation-date of the patches. There were no errors while patching. What sources changeset did you use to test patches? As for new revision of patches in October: it would be grate. I'll test them with pleasure.

Best regards.
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

JavMV
Ok,

So did you try to install windows XP before use the patches in that changeset? Did windows run normally? if this is correct you should be able to patch that source of xen and run windows without problems using VGA-passthrough with the primary graphic card (you must use the same changeset that has allowed you to apply the patchset without errors).

If you are having troubles post here your configuration file, maybe is something wrong in there. Also you can try first to not enable the gfx_passthru option and see if windows runs without errors, then restart and enable the option and try again (if u get error logs attach them in your next mail)
JavMV
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

komkon555
This post was updated on .
Hi. Windows starts with xen4.2 (clearly patched from changeset 23350 ) normally as far as pci-passthrough for VGA-Card is disabled. PCI-passthrough works perfect with other  pci-devices (lan, sound and s.o.). With pci-passthrough enabled for VGA-Card (meters not if GFX=0/1) Windows XP crashes. There are my configs:
HVM-client:

#  -*- mode: python; -*-
#============================================================================
# Python configuration setup for 'xm create'.
# This script sets the parameters used when a domain is created using 'xm create'.
# You use a separate script for each domain you want to create, or
# you can set the parameters for the domain on the xm command line.
#============================================================================

#----------------------------------------------------------------------------
# Kernel image file.
kernel = "hvmloader"

# The domain build function. HVM domain uses 'hvm'.
builder='hvm'

memory = 1024

# A name for your domain. All domains must have different names.
name = "winxpvm1"

vif = [ 'type=ioemu, bridge=xenbr0' ]

disk = [ 'phy:/dev/data/vm01,ioemu:hda,w' ]

device_model = 'qemu-dm'

sdl=0

opengl=0

vnc=1

vncdisplay=1

stdvga=0

serial='pty'

tsc_mode=0

pci=[ '08:00.0' ]

gfx_passthru=1

###########################################################

/boo/grub/grub.cfg:

"xen-pciback.permissive xen-pciback.hide=(08:00.0) pci=resource_alignment=08:00.0"

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

Pasi Kärkkäinen
On Wed, Aug 31, 2011 at 01:16:07AM -0700, komkon555 wrote:

> Hi. Windows starts with xen4.2 normally as far as pci-passthrough for
> VGA-Card is disabled. PCI-passthrough works perfect with other  pci-devices
> (lan, sound and s.o.). With pci-passthrough enabled for VGA-Card (meters not
> if GFX=0/1) Windows XP crashes. There is my configs:
> HVM-client:
>
> #  -*- mode: python; -*-
> #============================================================================
> # Python configuration setup for 'xm create'.
> # This script sets the parameters used when a domain is created using 'xm
> create'.
> # You use a separate script for each domain you want to create, or
> # you can set the parameters for the domain on the xm command line.
> #============================================================================
>
> #----------------------------------------------------------------------------
> # Kernel image file.
> kernel = "hvmloader"
>
> # The domain build function. HVM domain uses 'hvm'.
> builder='hvm'
>
> memory = 1024
>
> # A name for your domain. All domains must have different names.
> name = "winxpvm1"
>
> vif = [ 'type=ioemu, bridge=xenbr0' ]
>
> disk = [ 'phy:/dev/data/vm01,ioemu:hda,w' ]
>
> device_model = 'qemu-dm'
>
> sdl=0
>
> opengl=0
>
> vnc=1
>
> vncdisplay=1
>
> stdvga=0
>
> serial='pty'
>
> tsc_mode=0
>
> pci=[ '08:00.0' ]
>
> gfx_passthru=1
>
> ###########################################################
>
> /boo/grub/grub.cfg:
>
> "xen-pciback.permissive xen-pciback.hide=(08:00.0)
> pci=resource_alignment=08:00.0"
>

Did you try without resource_alignment?

What's your gfx adapter?

-- Pasi


_______________________________________________
Xen-devel mailing list
[hidden email]
http://lists.xensource.com/xen-devel
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

komkon555
Yes, I tried all possible xen-pciback entrances with the same result. My adapter is:
08:00.0 VGA compatible controller: nVidia Corporation GT200 [GeForce GTX 260] (rev a1) (prog-if 00 [VGA controller])
Subsystem: ZOTAC International (MCO) Ltd. Device 1109
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

komkon555
This post was updated on .
Some news more: right just now i had success with this configuration: xen 4.1-unstable changeset 21668 patched with these patches + jeremi xen kernel 2.6.32.45 (xenfs static). Windows XP starts normally. But the actual nvidia driver cannot be setup correctly.  If I try to shutdown Windows XP, domU and dom0 both crash.
The hardware is same as above.
 

Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

Pasi Kärkkäinen
On Wed, Aug 31, 2011 at 05:56:41AM -0700, komkon555 wrote:
> Some news more: right just now i had success with this configuration: xen
> 4.1-unstable changeset 21668 patched with these
> http://lists.xensource.com/archives/html/xen-devel/2010-05/msg00441.html
> patches  + jeremi xen kernel 2.6.32.45 (xenfs static). Windows XP starts
> normally. But the actual nvidia driver cannot be setup correctly.  If I try
> shutdown Windows XP domU and dom0 both crash.
>

yeah, vga passthru on nvidia requires some more work (=debuggin and patching).

-- Pasi


_______________________________________________
Xen-devel mailing list
[hidden email]
http://lists.xensource.com/xen-devel
Reply | Threaded
Open this post in threaded view
|

Re: Patches for VGA-Passthrough XEN 4.2 unstable

David TECHER
It works with Xen 4.2 unstable.

I've updated the patchs last week.

Please see

http://old.nabble.com/Pathcs-for-VGA-PassThrough-for-xen-4.2-unstable-revision-23799-td32370790.html

for more informations.

David
1234 ... 6