All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Does xen-4.2.0 support VGA passthrough with the virtual machine created by xl command?
@ 2012-11-30  1:25 Dr. Greg Wettstein
  2012-11-30  7:08 ` Pasi Kärkkäinen
  0 siblings, 1 reply; 10+ messages in thread
From: Dr. Greg Wettstein @ 2012-11-30  1:25 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: xen-devel@lists.xen.org, Ian Campbell, Qian Hu

On Nov 28,  4:04pm, Konrad Rzeszutek Wilk wrote:
} Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v

> On Sat, Nov 17, 2012 at 09:17:36AM -0600, Dr. Greg Wettstein wrote:
> > On Nov 14,  3:40pm, "Dr. Greg Wettstein" wrote:
> > } Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v
> > 
> > Good morning, hope the day is going well for everyone.

> Heya!

Good evening, thanks for taking the time to respond.

> > We then went back and tested the 3.4.18 kernel and with both xm and xl
> > the guest faults on the first attempt to do an I/O port access.  All
> > factors (windows image, hardware, xen guest config) are held identical
> > so the difference would seem to be linked to the PCI passthrough
> > implementation between the two kernels.  I've copied Konrad on the
> > note since he would seem to be the person most familiar with this
> > area.
> > 
> > I'm including below a diff between a successful qemu-dm passthrough
> > session (2.6.32.45) and an unsuccessful session (3.4.18).  It would
> > appear 3.4.18 is getting the both the I/O port and memory ranges
> > wrong.

I was going to get an update back to everyone but got swamped by the
holiday weekend and a series of hardware failures I had to chase
after.

I took advantage of some time over the holiday weekend to chase down
the passthrough problems and now have it working well on 4.2.0 on all
kernels up to 3.4.19 using XM.  The original ATI patches have a bug in
them which causes qemu-dm to core dump on kernels somewhere after
2.6.32.x.

The original patches were bracketing the inb/outb instructions used in
ati_hw_read()/ati_hw_write with an ioperm() call.  The fix was a
straight forward replacement of the ioperm() call with a call to
iopl(3).

I seem to vaguely remember something about the kernel not properly
enforcing access controlls on in/out instructions but don't remember
if that was with a pvops or standard kernel.  In any event the kernel
behavior changed after 2.6.32.x which triggered the breakage.

I will post an updated version of the ATI patches under separate cover
in case anytone else is using them.

> Hm, can you also provide the 'lspci -vvv' with the 2.6.32.45 and
> 3.4.18 kernel?
>
> I am specifically looking to see if there are any:
> 
> [from git commit c341ca45ce56143804ef5a8f4db753e554e640b4]
> Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Date:   Tue Sep 25 16:48:24 2012 -0400
> 
>    
> 	.. snip.. 
>     -       Region 0: [virtual] Memory at fe8c0000 (32-bit, non-prefetchable) [size=128K]
>     -       Region 1: [virtual] Memory at fe800000 (32-bit, non-prefetchable) [size=512K]
>     +       Region 0: Memory at fe8c0000 (32-bit, non-prefetchable) [size=128K]
>     +       Region 1: Memory at fe800000 (32-bit, non-prefetchable) [size=512K]
>             Region 2: I/O ports at c000 [size=32]
>     -       Region 3: [virtual] Memory at fe8e0000 (32-bit, non-prefetchable) [size=16K]
>     +       Region 3: Memory at fe8e0000 (32-bit, non-prefetchable) [size=16K]

>     The [virtual] means that lspci read those entries from SysFS but when
>     it read them from the device it got a different value (0xfffffff).
>
> Any of those '[virtual]' ones? And how are you reserving the PCI devices?
> Are you using xen-pciback.hide on the Linux command line?
> 
> Does 'xm dmesg' give you an logs? Do the logs have any warnings?

We were under some time constraints to get Windows access back working
with a 'modern' kernel so once things were working reliably with xm I
didn't get a chance to fiddle with xl.  Given the behavior I saw on
2.6.32.x with xl I'm suspicious it may not work.  I'm hoping to get
back and do some testing early next week.

I just checked the machine (which is running a Windows session as I
write this) and dont see any [virtual] references.  This is on 3.4.18
but I also haven't had the chance to check xl on that kernel.  At
least a couple of hundred Windows 7 boots have been done with xm so
4.2.0 seems solid with that control plane.

With respect to reservation of the PCI device we have a script which
unplugs the device and re-plugs it after the Window session
completes.  The machines are Linux/Windows dual-use so the cards need
to be active for the Linux sessions.

The script can be picked up at the following location:

	ftp://ftp.enjellic.com/pub/xen/run-passthrough

I will give xl a try later in the weekend with the updated qemu-dm and
I will report back the results from a more throroughly controlled test
environment.

Thanks for the input, have a good weekend.

Greg

}-- End of excerpt from Konrad Rzeszutek Wilk

As always,
Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
4206 N. 19th Ave.           Specializing in information infra-structure
Fargo, ND  58102            development.
PH: 701-281-1686
FAX: 701-281-3949           EMAIL: greg@enjellic.com
------------------------------------------------------------------------------
"Not only is this incomprehensible, but the ink is ugly and the paper
 is from the wrong kind of tree."
                                -- Professor W.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: Does xen-4.2.0 support VGA passthrough with the virtual machine created by xl command?
@ 2012-11-14 21:40 Dr. Greg Wettstein
  0 siblings, 0 replies; 10+ messages in thread
From: Dr. Greg Wettstein @ 2012-11-14 21:40 UTC (permalink / raw)
  To: Ian Campbell, Qian Hu; +Cc: xen-devel@lists.xen.org

On Nov 13, 10:02am, Ian Campbell wrote:
} Subject: Re: [Xen-devel] Does xen-4.2.0 support VGA passthrough with the v

Good afternoon, hope the week is going well for everyone.

> On Tue, 2012-11-13 at 06:30 +0000, Qian Hu wrote:
> 
> > With spice tool, I have to create a VM by xl command, and now I am
> > wondering if it supports VGA passghrouth?

> This list is for the development of Xen. You';d probably have more
> luck with these sorts of support requests on the xen-users list.

That would normally be the case but I'm suspicious there are issues
with VGA passthrough in 4.2.0.

I worked through all the vagaries of getting VGA passthrough going
with ATI cards about two years ago using the patches which are
available through the xen-vel archives.  We have run literally
thousands of Windows 7 passthrough sessions since then under 4.0.x and
4.1.x.

We've just started validating 4.2.0 and passthrough reliably generates
segmentation faults in qemu-dm on the first attempt to do an I/O port
read.  The fault occurs with an identical configuration file using
either xm or xl.  Testing is being done with a 3.4.18 dom0 kernel.

I'm thinking we may have initially hit this in 4.1.0.  Segmentation
faults in the device emulator were being experienced but these seemed
to go away when we the dom0 kernel was switched back to a 2.6.32.x
kernel which we were using from Jeremy's GIT tree.

We need to make the jump to 3.4.x so I'm going to see if I can hunt
the issue down.

For those who may want to assist in trying to get all of this working
a bit better I have a 4.2.0 port of the ATI patches available at the
following location:

	ftp://ftp.enjellic.com/pub/xen/xen-4.2.0.ati-passthrough.patch

You will minimally need the qemu-dm binary from a build with this
patch applied.

I have also made available a helper script which we use to automate
the binding/rebinding of the VGA card and the USB controller passed
through to provide mouse/keyboard support.   The script can be picked
up from the following location:

	ftp://ftp.enjellic.com/pub/xen/run-passthrough

The script is straight forward but will need a bit of tweaking for
items such as the PCI configuration being passwed through.

The script uses vbetool to issue a VGA post reset after the passthough
session is completed.  We run all this from a VGA text mode console
(yes we are old fashioned) so the results are 'unspecified' for trying
do this from anything resembling a remotely sophisticated graphics
session.

This all tends to not be for the faint of heart.  I recommend having a
network login session running from a separate machine in case things
decide to go south.  A 'sync && reboot' always being a bit more
palatable then yanking the power cord.

The VGA cards we have been using were some monstrous thing which was
in vogue 2-3 years ago.  The fundamentals are as follows:

---------------------------------------------------------------------------
01:00.0 VGA compatible controller: ATI Technologies Inc Device 6898
(prog-if 00
[VGA controller])
        Subsystem: ASUSTeK Computer Inc. Device 0346
        Flags: fast devsel, IRQ 16
        Memory at b0000000 (64-bit, prefetchable) [size=256M]
        Memory at c1a00000 (64-bit, non-prefetchable) [size=128K]
        I/O ports at 3000 [size=256]
        Expansion ROM at c1a40000 [disabled] [size=128K]
        Capabilities: <access denied>
---------------------------------------------------------------------------

I will continue to hunt to see if I can further isolate the problem.
If anyone else wants to experiment a bit please do so and let me know
the results from 4.2.0.

For the record we are using Intel S3420GP motherboards.  We found the
VT-D implementation to be solid on that motherboard.

> Ian.

Hope the above is helpful.

Have a good evening.

Greg

}-- End of excerpt from Ian Campbell

As always,
Dr. G.W. Wettstein, Ph.D.   Enjellic Systems Development, LLC.
4206 N. 19th Ave.           Specializing in information infra-structure
Fargo, ND  58102            development.
PH: 701-281-1686
FAX: 701-281-3949           EMAIL: greg@enjellic.com
------------------------------------------------------------------------------
"We have more to fear from the bungling of the incompetent than from
 the machinations of the wicked."
                                -- Slashdot

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Does xen-4.2.0 support VGA passthrough with the virtual machine created by xl command?
@ 2012-11-13  6:30 Qian Hu
  2012-11-13 10:02 ` Ian Campbell
  0 siblings, 1 reply; 10+ messages in thread
From: Qian Hu @ 2012-11-13  6:30 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 471 bytes --]

Hi, everyone!

I am working on xen-4.2.0 with spice remote connect.  My host is Fedora 14
and guest is win7.

I have installed spice package and now I can connect to guest by spice
client.

For better graphics experience, I want to try the  VGA passthrough.

With spice tool, I have to create a VM by xl command, and now I am
wondering if it supports VGA passghrouth?

If so, how should I  test it ?

The device model in my config file is "qemu-xen".

Thank you!

huqian

[-- Attachment #1.2: Type: text/html, Size: 2707 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-11-23 14:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <greg@wind.enjellic.com>
2012-11-17 15:17 ` Does xen-4.2.0 support VGA passthrough with the virtual machine created by xl command? Dr. Greg Wettstein
2012-11-28 21:04   ` Konrad Rzeszutek Wilk
2014-11-21 21:02 ` Q77 IGD instantly crashes on xen-pciback bind Dr. Greg Wettstein
2014-11-23 14:05   ` Pasi Kärkkäinen
2014-11-23 14:23     ` Pasi Kärkkäinen
2012-11-30  1:25 Does xen-4.2.0 support VGA passthrough with the virtual machine created by xl command? Dr. Greg Wettstein
2012-11-30  7:08 ` Pasi Kärkkäinen
  -- strict thread matches above, loose matches on Subject: below --
2012-11-14 21:40 Dr. Greg Wettstein
2012-11-13  6:30 Qian Hu
2012-11-13 10:02 ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.