Hello, everybody! I knew recently that xl doesn''t yet work with GFX passthrough for HVM guest. It makes me consider that main job for GFX passthrough are going for xm toolstack. My company is very interested to use xl tool, but we need also GFX passthrough. The issue is not very hard to solve. It just needs to teach xl to recognize ''gfx_passthru'' in config file and pass it to qemu-dm. And qemu-dm will choose the specific VGA bios to load into domain''s memory in case of this option. I attached the patch, addressing this issue. Please, consider to push it to main repository. Thank you. Sergey. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thu, 2011-01-13 at 09:12 +0000, Sergey Tovpeko wrote:> diff --git a/tools/libxl/libxl.idl b/tools/libxl/libxl.idl > index 81fcfd9..bf3c429 100644 > --- a/tools/libxl/libxl.idl > +++ b/tools/libxl/libxl.idl > @@ -96,6 +96,7 @@ libxl_domain_build_info > Struct("domain_build_info",[ > ("disable_migrate", bool), > ("kernel", libxl_file_reference), > ("cpuid", libxl_cpuid_policy_list), > + ("gfx_passthru", integer), > ("hvm", integer), > ("u", KeyedUnion(None, "hvm", > [("hvm", "%s", Struct(None, > @@ -161,6 +162,7 @@ libxl_device_model_info > Struct("device_model_info",[ > ("vcpu_avail", integer, False, "vcpus actually > available"), > ("xen_platform_pci", integer, False, "enable/disable > the xen platform pci device"), > ("extra", libxl_string_list, False, "extra parameters > pass directly to qemu, NULL terminated"), > + ("gfx_passthru", integer), > ], > comment> """Device Model information.I think gfx_passthrough is actually a boolean, right? In that case it should be declared as "bool" in the idl. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell wrote:> > > I think gfx_passthrough is actually a boolean, right? In that case it > should be declared as "bool" in the idl. >Well, the integer value of gfx_passthru had meaning in 2009, I suspect. It differentiated between IGD adapter and discrete adapter. http://xen.1045712.n5.nabble.com/PATCH-0-2-v2-graphics-passthrough-with-VT-d-td2534811.html At now, I didn''t notice integer meaning of this variable in the code. I changed it to bool in the new patch. Sergey. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thu, 2011-01-13 at 10:05 +0000, Sergey Tovpeko wrote:> Ian Campbell wrote: > > > > > > I think gfx_passthrough is actually a boolean, right? In that case it > > should be declared as "bool" in the idl. > > > > Well, the integer value of gfx_passthru had meaning in 2009, I suspect. > It differentiated between IGD adapter and discrete adapter. > http://xen.1045712.n5.nabble.com/PATCH-0-2-v2-graphics-passthrough-with-VT-d-td2534811.html > > At now, I didn''t notice integer meaning of this variable in the code. I > changed it to bool in the new patch.I just noticed that this appears to have been fixed by Daniel De Graf just a few days ago, see 22711:4f6fee3a456e, which may only be in the staging tree at http://xenbits.xen.org/staging/xen-unstable.hg since we are waiting for a test pass. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> > I just noticed that this appears to have been fixed by Daniel De Graf > just a few days ago, see 22711:4f6fee3a456e, which may only be in the > staging tree at http://xenbits.xen.org/staging/xen-unstable.hg since we > are waiting for a test pass. > >Ian, Daniel my patch is almost like Daniel''s one. Thank you for pointing to it. And there''s one absent thing in Daniel''s commit (4f6fee3a456e). To complete the gfx passthrough issue for xl we should pass this option to qemu-dm, like this : + if (info->gfx_passthru) { + flexarray_set(dm_args, num++, "-gfx_passthru"); + flexarray_set(dm_args, num++, libxl__sprintf(gc, "%d", info->gfx_passthru)); + } I suppose, without it ''qemu-dm'' won''t know about gfx_passthru mode and won''t load passthru''ed vga bios. Daniel might plan to add this code or added it already? _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thu, 2011-01-13 at 11:17 +0000, Sergey Tovpeko wrote:> > > > I just noticed that this appears to have been fixed by Daniel De Graf > > just a few days ago, see 22711:4f6fee3a456e, which may only be in the > > staging tree at http://xenbits.xen.org/staging/xen-unstable.hg since we > > are waiting for a test pass. > > > > > > Ian, Daniel > > my patch is almost like Daniel''s one. Thank you for pointing to it. > > And there''s one absent thing in Daniel''s commit (4f6fee3a456e). To > complete the gfx passthrough issue for xl we should pass this option to > qemu-dm, like this : > > + if (info->gfx_passthru) { > + flexarray_set(dm_args, num++, "-gfx_passthru"); > + flexarray_set(dm_args, num++, libxl__sprintf(gc, "%d", > info->gfx_passthru)); > + } > > I suppose, without it ''qemu-dm'' won''t know about gfx_passthru mode and > won''t load passthru''ed vga bios. > > Daniel might plan to add this code or added it already?Daniel''s patch at <4D262B2A.30907@tycho.nsa.gov> includes this bit but it appears to be missing from the commit in 22711:4f6fee3a456e. IanJ: Any idea what''s going on? Perhaps a missed .rej due to the move of the dm stuff to libxl_dm.c between post and application? Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell writes ("Re: [Xen-devel] xl and GFX passthrough"):> Daniel''s patch at <4D262B2A.30907@tycho.nsa.gov> includes this bit but > it appears to be missing from the commit in 22711:4f6fee3a456e. > > IanJ: Any idea what''s going on? Perhaps a missed .rej due to the move of > the dm stuff to libxl_dm.c between post and application?Very likely, sorry. I will fix this up after rc1. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
I wrote:> Ian Campbell writes ("Re: [Xen-devel] xl and GFX passthrough"): > > Daniel''s patch at <4D262B2A.30907@tycho.nsa.gov> includes this bit but > > it appears to be missing from the commit in 22711:4f6fee3a456e. > > > > IanJ: Any idea what''s going on? Perhaps a missed .rej due to the move of > > the dm stuff to libxl_dm.c between post and application? > > Very likely, sorry. > > I will fix this up after rc1.I''ve applied the missing change. Thanks, Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Sergey, Did you get gfx_passthru to work with xl? I found the latest source still does not seems to pass gfx_passthru to qemu correctly. By the way, how to output debug messages to xl*.log file? I tried LOG() and fprintf(stderr...) neither worked for me. Allen -----Original Message----- From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Sergey Tovpeko Sent: Thursday, January 13, 2011 3:18 AM To: Ian Campbell; Daniel De Graaf Cc: xen-devel@lists.xensource.com Subject: Re: [Xen-devel] xl and GFX passthrough> > I just noticed that this appears to have been fixed by Daniel De Graf > just a few days ago, see 22711:4f6fee3a456e, which may only be in the > staging tree at http://xenbits.xen.org/staging/xen-unstable.hg since we > are waiting for a test pass. > >Ian, Daniel my patch is almost like Daniel's one. Thank you for pointing to it. And there's one absent thing in Daniel's commit (4f6fee3a456e). To complete the gfx passthrough issue for xl we should pass this option to qemu-dm, like this : + if (info->gfx_passthru) { + flexarray_set(dm_args, num++, "-gfx_passthru"); + flexarray_set(dm_args, num++, libxl__sprintf(gc, "%d", info->gfx_passthru)); + } I suppose, without it 'qemu-dm' won't know about gfx_passthru mode and won't load passthru'ed vga bios. Daniel might plan to add this code or added it already? _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Wed, 26 Jan 2011, Kay, Allen M wrote:> By the way, how to output debug messages to xl*.log file? I tried LOG() and fprintf(stderr...) neither worked for me. >LOG should print to the logfile, while fprintf(stderr should just print to stderr. Considering that when you execute xl the command is just executed directly by your instance of xl, you can probably debug your issues just using printf or gdb. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 01/25/2011 09:49 PM, Kay, Allen M wrote:> Sergey, > > Did you get gfx_passthru to work with xl? I found the latest source still does not seems to pass gfx_passthru to qemu correctly. > > By the way, how to output debug messages to xl*.log file? I tried LOG() and fprintf(stderr...) neither worked for me. > > Allen > > -----Original Message----- > From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Sergey Tovpeko > Sent: Thursday, January 13, 2011 3:18 AM > To: Ian Campbell; Daniel De Graaf > Cc: xen-devel@lists.xensource.com > Subject: Re: [Xen-devel] xl and GFX passthrough > > >> >> I just noticed that this appears to have been fixed by Daniel De Graf >> just a few days ago, see 22711:4f6fee3a456e, which may only be in the >> staging tree at http://xenbits.xen.org/staging/xen-unstable.hg since we >> are waiting for a test pass. >> >> > > Ian, Daniel > > my patch is almost like Daniel''s one. Thank you for pointing to it. > > And there''s one absent thing in Daniel''s commit (4f6fee3a456e). To > complete the gfx passthrough issue for xl we should pass this option to > qemu-dm, like this : > > + if (info->gfx_passthru) { > + flexarray_set(dm_args, num++, "-gfx_passthru"); > + flexarray_set(dm_args, num++, libxl__sprintf(gc, "%d", > info->gfx_passthru)); > + } > > I suppose, without it ''qemu-dm'' won''t know about gfx_passthru mode and > won''t load passthru''ed vga bios. > > Daniel might plan to add this code or added it already? >Actually, I hadn''t noticed that gfx_passthru takes an (apparently optional) numeric parameter. This change is more correct than the one I posted, although it also needs gfx_passthru to be changed from bool to int in the IDL (assuming that -gfx_passthru 2 is still useful, I hadn''t heard of it until recently). Kay: sounds like you have this fixed in your tree, I''ll let you or Ian fix it. -- Daniel De Graaf National Security Agency _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel