This patch supports basic gfx passthrough on xen side: - retrieves VGA bios from host VGA BIOS address (0xC0000), then load it to guest VGA BIOS address (This is the same with XCI). - Enlarge guest MMIO range to contain gfx card''s large memory - add a config option ''gfx_passthru'' for gfx passthrough Signed-off-by: Ben Lin <ben.y.lin@intel.com> Signed-off-by: Weidong Han <weidong.han@intel.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jean Guyader
2009-Aug-28 08:12 UTC
Re: [Xen-devel] [PATCH 1/2] graphics passthrough with VT-d
On Fri, Aug 28, 2009 at 03:54:05AM -0400, Han, Weidong wrote:> This patch supports basic gfx passthrough on xen side: > - retrieves VGA bios from host VGA BIOS address (0xC0000), then load it to guest VGA BIOS address (This is the same with XCI). > - Enlarge guest MMIO range to contain gfx card''s large memory > - add a config option ''gfx_passthru'' for gfx passthrough > > Signed-off-by: Ben Lin <ben.y.lin@intel.com> > Signed-off-by: Weidong Han <weidong.han@intel.com>Hi, First thanks for taking the time to upstream those patch that will help a lot. I think the patch will be let intrusive if we could do all that bios mapping + copying inside qemu so we don''t need to modify the xc_hvm_build function. Qemu starts before the bios so that should be doable. Thanks, Jean _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Han, Weidong
2009-Aug-28 08:30 UTC
RE: [Xen-devel] [PATCH 1/2] graphics passthrough with VT-d
Jean Guyader wrote:> On Fri, Aug 28, 2009 at 03:54:05AM -0400, Han, Weidong wrote: >> This patch supports basic gfx passthrough on xen side: >> - retrieves VGA bios from host VGA BIOS address (0xC0000), then >> load it to guest VGA BIOS address (This is the same with XCI). >> - Enlarge guest MMIO range to contain gfx card''s large memory >> - add a config option ''gfx_passthru'' for gfx passthrough >> >> Signed-off-by: Ben Lin <ben.y.lin@intel.com> >> Signed-off-by: Weidong Han <weidong.han@intel.com> > > Hi, > > First thanks for taking the time to upstream those patch > that will help a lot. > > I think the patch will be let intrusive if we could do all > that bios mapping + copying inside qemu so we don''t need to > modify the xc_hvm_build function. > > Qemu starts before the bios so that should be doable. > > Thanks, > JeanSounds good. You mean mapping + coping vgabios in hw/pc.c, right? We will go to change it. Thanks. Regards, Weidong _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2009-Aug-28 08:45 UTC
Re: [Xen-devel] [PATCH 1/2] graphics passthrough with VT-d
On 28/08/2009 08:54, "Han, Weidong" <weidong.han@intel.com> wrote:> This patch supports basic gfx passthrough on xen side: > - retrieves VGA bios from host VGA BIOS address (0xC0000), then load it to > guest VGA BIOS address (This is the same with XCI). > - Enlarge guest MMIO range to contain gfx card''s large memoryHvmloader will auto-size the MMIO hole. You shouldn''t need to change the default initial size of the hole. -- Keir> - add a config option ''gfx_passthru'' for gfx passthrough_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Han, Weidong
2009-Aug-28 08:46 UTC
RE: [Xen-devel] [PATCH 1/2] graphics passthrough with VT-d
Keir Fraser wrote:> On 28/08/2009 08:54, "Han, Weidong" <weidong.han@intel.com> wrote: > >> This patch supports basic gfx passthrough on xen side: >> - retrieves VGA bios from host VGA BIOS address (0xC0000), then >> load it to guest VGA BIOS address (This is the same with XCI). >> - Enlarge guest MMIO range to contain gfx card''s large memory > > Hvmloader will auto-size the MMIO hole. You shouldn''t need to change > the default initial size of the hole.Ok. I will remove the change. Thanks. Regards, Weidong> > -- Keir > >> - add a config option ''gfx_passthru'' for gfx passthrough_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefano Stabellini
2009-Sep-11 15:41 UTC
Re: [Xen-devel] [PATCH 1/2] graphics passthrough with VT-d
On Fri, 28 Aug 2009, Jean Guyader wrote:> On Fri, Aug 28, 2009 at 03:54:05AM -0400, Han, Weidong wrote: > > This patch supports basic gfx passthrough on xen side: > > - retrieves VGA bios from host VGA BIOS address (0xC0000), then load it to guest VGA BIOS address (This is the same with XCI). > > - Enlarge guest MMIO range to contain gfx card''s large memory > > - add a config option ''gfx_passthru'' for gfx passthrough > > > > Signed-off-by: Ben Lin <ben.y.lin@intel.com> > > Signed-off-by: Weidong Han <weidong.han@intel.com> > > Hi, > > First thanks for taking the time to upstream those patch > that will help a lot. > > I think the patch will be let intrusive if we could do all > that bios mapping + copying inside qemu so we don''t need to > modify the xc_hvm_build function. > > Qemu starts before the bios so that should be doable.The problem with letting qemu do the mapping is that it is not going to work with stubdoms, while using a libxc function should work OK as long as it is called by xend, as in this case. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Han, Weidong
2009-Sep-16 05:10 UTC
RE: [Xen-devel] [PATCH 1/2] graphics passthrough with VT-d
Stefano Stabellini wrote:> On Fri, 28 Aug 2009, Jean Guyader wrote: >> On Fri, Aug 28, 2009 at 03:54:05AM -0400, Han, Weidong wrote: >>> This patch supports basic gfx passthrough on xen side: >>> - retrieves VGA bios from host VGA BIOS address (0xC0000), then >>> load it to guest VGA BIOS address (This is the same with XCI). >>> - Enlarge guest MMIO range to contain gfx card''s large memory >>> - add a config option ''gfx_passthru'' for gfx passthrough >>> >>> Signed-off-by: Ben Lin <ben.y.lin@intel.com> >>> Signed-off-by: Weidong Han <weidong.han@intel.com> >> >> Hi, >> >> First thanks for taking the time to upstream those patch that will >> help a lot. >> >> I think the patch will be let intrusive if we could do all >> that bios mapping + copying inside qemu so we don''t need to >> modify the xc_hvm_build function. >> >> Qemu starts before the bios so that should be doable. > > The problem with letting qemu do the mapping is that it is not going > to work with stubdoms, while using a libxc function should work OK as > long as it is called by xend, as in this case.Currently stubdom doesn''t support VT-d. So letting qemu do the mapping is much cleaner. Regards, Weidong _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jean Guyader
2009-Sep-16 08:33 UTC
Re: [Xen-devel] [PATCH 1/2] graphics passthrough with VT-d
2009/9/16 Han, Weidong <weidong.han@intel.com>:> Stefano Stabellini wrote: >> On Fri, 28 Aug 2009, Jean Guyader wrote: >>> On Fri, Aug 28, 2009 at 03:54:05AM -0400, Han, Weidong wrote: >>>> This patch supports basic gfx passthrough on xen side: >>>> - retrieves VGA bios from host VGA BIOS address (0xC0000), then >>>> load it to guest VGA BIOS address (This is the same with XCI). >>>> - Enlarge guest MMIO range to contain gfx card''s large memory >>>> - add a config option ''gfx_passthru'' for gfx passthrough >>>> >>>> Signed-off-by: Ben Lin <ben.y.lin@intel.com> >>>> Signed-off-by: Weidong Han <weidong.han@intel.com> >>> >>> Hi, >>> >>> First thanks for taking the time to upstream those patch that will >>> help a lot. >>> >>> I think the patch will be let intrusive if we could do all >>> that bios mapping + copying inside qemu so we don''t need to >>> modify the xc_hvm_build function. >>> >>> Qemu starts before the bios so that should be doable. >> >> The problem with letting qemu do the mapping is that it is not going >> to work with stubdoms, while using a libxc function should work OK as >> long as it is called by xend, as in this case. > > Currently stubdom doesn''t support VT-d. So letting qemu do the mapping is much cleaner. >I remember I tried graphic pass through a while ago with stubdom and it did work. Jean _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Han, Weidong
2009-Sep-16 08:54 UTC
RE: [Xen-devel] [PATCH 1/2] graphics passthrough with VT-d
Jean Guyader wrote:> 2009/9/16 Han, Weidong <weidong.han@intel.com>: >> Stefano Stabellini wrote: >>> On Fri, 28 Aug 2009, Jean Guyader wrote: >>>> On Fri, Aug 28, 2009 at 03:54:05AM -0400, Han, Weidong wrote: >>>>> This patch supports basic gfx passthrough on xen side: >>>>> - retrieves VGA bios from host VGA BIOS address (0xC0000), then >>>>> load it to guest VGA BIOS address (This is the same with XCI). >>>>> - Enlarge guest MMIO range to contain gfx card''s large memory >>>>> - add a config option ''gfx_passthru'' for gfx passthrough >>>>> >>>>> Signed-off-by: Ben Lin <ben.y.lin@intel.com> >>>>> Signed-off-by: Weidong Han <weidong.han@intel.com> >>>> >>>> Hi, >>>> >>>> First thanks for taking the time to upstream those patch that will >>>> help a lot. >>>> >>>> I think the patch will be let intrusive if we could do all >>>> that bios mapping + copying inside qemu so we don''t need to >>>> modify the xc_hvm_build function. >>>> >>>> Qemu starts before the bios so that should be doable. >>> >>> The problem with letting qemu do the mapping is that it is not going >>> to work with stubdoms, while using a libxc function should work OK >>> as long as it is called by xend, as in this case. >> >> Currently stubdom doesn''t support VT-d. So letting qemu do the >> mapping is much cleaner. >> > > I remember I tried graphic pass through a while ago with stubdom and > it did work. >I heard VT-d didn''t work with stubdom, it needs some efforts to support it. Actually I didn''t try stubdom with VT-d. Regards, Weidong _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefano Stabellini
2009-Sep-16 10:57 UTC
RE: [Xen-devel] [PATCH 1/2] graphics passthrough with VT-d
On Wed, 16 Sep 2009, Han, Weidong wrote:> I heard VT-d didn''t work with stubdom, it needs some efforts to support it. Actually I didn''t try stubdom with VT-d. >You are right, currently stubdom doesn''t work with passthrough. I have a patch series to make it work but it is not finished yet and I have been pulled on other projects; I hope to resume my work on that in the near future. In any case the fact the currently passthrough doesn''t work with stubdom is not a good reason for introducing even more problematic changes. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Han, Weidong
2009-Sep-17 11:11 UTC
RE: [Xen-devel] [PATCH 1/2] graphics passthrough with VT-d
Stefano Stabellini wrote:> On Wed, 16 Sep 2009, Han, Weidong wrote: >> I heard VT-d didn''t work with stubdom, it needs some efforts to >> support it. Actually I didn''t try stubdom with VT-d. >> > > You are right, currently stubdom doesn''t work with passthrough. > I have a patch series to make it work but it is not finished yet and I > have been pulled on other projects; I hope to resume my work on that > in the near future. > > In any case the fact the currently passthrough doesn''t work with > stubdom is not a good reason for introducing even more problematic > changes.Actually stubdom is missed when changing the patch. It is easy to change. We will change it. Regards, Weidong _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Han, Weidong
2009-Sep-18 07:42 UTC
RE: [Xen-devel] [PATCH 1/2] graphics passthrough with VT-d
Stefano Stabellini wrote:> On Wed, 16 Sep 2009, Han, Weidong wrote: >> I heard VT-d didn''t work with stubdom, it needs some efforts to >> support it. Actually I didn''t try stubdom with VT-d. >> > > You are right, currently stubdom doesn''t work with passthrough. > I have a patch series to make it work but it is not finished yet and I > have been pulled on other projects; I hope to resume my work on that > in the near future. > > In any case the fact the currently passthrough doesn''t work with > stubdom is not a good reason for introducing even more problematic > changes.There are many changes on qemu for gfx passthrough, copying and mapping vbios in qemu just a small part. If other changes on qemu can be implemented correspondingly in stubdom, why not copying and mapping vbios in qemu? Regards, Weidong _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefano Stabellini
2009-Sep-19 01:15 UTC
RE: [Xen-devel] [PATCH 1/2] graphics passthrough with VT-d
On Fri, 18 Sep 2009, Han, Weidong wrote:> Stefano Stabellini wrote: > > On Wed, 16 Sep 2009, Han, Weidong wrote: > >> I heard VT-d didn''t work with stubdom, it needs some efforts to > >> support it. Actually I didn''t try stubdom with VT-d. > >> > > > > You are right, currently stubdom doesn''t work with passthrough. > > I have a patch series to make it work but it is not finished yet and I > > have been pulled on other projects; I hope to resume my work on that > > in the near future. > > > > In any case the fact the currently passthrough doesn''t work with > > stubdom is not a good reason for introducing even more problematic > > changes. > > There are many changes on qemu for gfx passthrough, copying and mapping vbios in qemu just a small part. If other changes on qemu can be implemented correspondingly in stubdom, why not copying and mapping vbios in qemu? >Because it would require the stubdom to be able to read the vgabios and it would be better if we avoid it. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Han, Weidong
2009-Sep-20 12:59 UTC
RE: [Xen-devel] [PATCH 1/2] graphics passthrough with VT-d
Stefano Stabellini wrote:> On Fri, 18 Sep 2009, Han, Weidong wrote: >> Stefano Stabellini wrote: >>> On Wed, 16 Sep 2009, Han, Weidong wrote: >>>> I heard VT-d didn''t work with stubdom, it needs some efforts to >>>> support it. Actually I didn''t try stubdom with VT-d. >>>> >>> >>> You are right, currently stubdom doesn''t work with passthrough. >>> I have a patch series to make it work but it is not finished yet >>> and I have been pulled on other projects; I hope to resume my work >>> on that in the near future. >>> >>> In any case the fact the currently passthrough doesn''t work with >>> stubdom is not a good reason for introducing even more problematic >>> changes. >> >> There are many changes on qemu for gfx passthrough, copying and >> mapping vbios in qemu just a small part. If other changes on qemu >> can be implemented correspondingly in stubdom, why not copying and >> mapping vbios in qemu? >> > > Because it would require the stubdom to be able to read the vgabios > and it would be better if we avoid it.The problem of changing on xc_hvm_build is need to modify hypercall API (xc_hvm_build_target_mem), it''s better to avoid it. If it is more intrusive or harder to read vgabios in stubdom, we can change it back to modify xc_hvm_build. Regards, Weidong _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefano Stabellini
2009-Sep-20 16:49 UTC
RE: [Xen-devel] [PATCH 1/2] graphics passthrough with VT-d
On Sun, 20 Sep 2009, Han, Weidong wrote:> The problem of changing on xc_hvm_build is need to modify hypercall API (xc_hvm_build_target_mem), it''s better to avoid it. If it is more intrusive or harder to read vgabios in stubdom, we can change it back to modify xc_hvm_build. >You could leave xc_hvm_build_target_mem as it is and implement something similar to: + if ( gfx_passthru ) + sts |= setup_vga_pt(xc_handle, domid); + else + sts |= init_vgabios(xc_handle, domid, NULL, 0x800); in pyxc_hvm_build instead so that there is no need for API changes and the vga bios would still be read from a process in dom0 (xend in this case). _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel