All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] graphics passthrough with VT-d
@ 2009-08-28  7:53 Han, Weidong
  2009-08-28  8:24 ` Jean Guyader
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Han, Weidong @ 2009-08-28  7:53 UTC (permalink / raw)
  To: 'xen-devel@lists.xensource.com'
  Cc: Lin, Ben Y, 'bengheng@eecs.umich.edu',
	Kay, Allen M, 'Keir.Fraser@eu.citrix.com',
	'Jean Guyader'

Hi all,

Recently, more and more people are interesting in gfx passthrough. But now xen-unstable doesn't support it, although some guys (Jean Guyader, Beng Heng, Ng) posted gfx passthrough patches. If xen-unstable includes gfx passthrough support, people can be easy to try it.

gfx passthrough is more complicated than other PCI device passthrough such as NIC, and is hard to use a generic approach for all gfx passthrough. But there are some necessary changes for gfx passthrough:
  1. disable emulated VGA adapter, instead use passthroughed gfx
  2. load VGA bios of the gfx to guest
  3. passthrough legacy VGA IO ports and MMIOs to guest

This patchset implements above common changes. Based on the common changes, we are investigating to support more gfx cards and guest OSs. We will post the hacks in future.

The patchset supports to passthrough the primary gfx and discrete gfx. With the patchset, virtualization friendly gfx cards can be passthroughed (e.g. Nvidia FX3800), IGD and many discrete gfx cards are not supported yet. 

This is easy to use, the only difference from other PCI passthrough is to add following lines to hvm configure file:

#----------------------------------------------------------------------------------------
# 0: no gfx passthru, 1: IGD passthru, 2: discrete gfx passthru, default is 0
gfx_passthru=2

and also pls passthrough a USB controller for keyboard/mouse use in guest. (Now there are some issues on USB controller passthrough with pv-ops dom0, so currently prefer to use 2.6.18 dom0.)


The patchset is as follows:
1. PATCH 1/2: changes in xen-unstable
	- 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

2. PATCH 2/2: changes in QEMU
	- disable emulated VGA adapter 
	- register/unregister legacy VGA I/O ports and MMIOs


Signed-off-by: Ben Lin <ben.y.lin@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>

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

* Re: [PATCH 0/2] graphics passthrough with VT-d
  2009-08-28  7:53 [PATCH 0/2] graphics passthrough with VT-d Han, Weidong
@ 2009-08-28  8:24 ` Jean Guyader
  2009-08-28  8:32   ` Han, Weidong
  2010-03-13  0:37   ` [PATCH 0/2] graphics passthrough with VT-d / keyboard and mouse sharing patch Pasi Kärkkäinen
  2009-08-28  9:04 ` [PATCH 0/2] graphics passthrough with VT-d Andrew Lyon
  2009-09-16 14:23 ` Stefano Stabellini
  2 siblings, 2 replies; 15+ messages in thread
From: Jean Guyader @ 2009-08-28  8:24 UTC (permalink / raw)
  To: Han, Weidong
  Cc: 'xen-devel@lists.xensource.com',
	Lin, Ben Y, Kay, Allen M, Fraser

On Fri, Aug 28, 2009 at 03:53:56AM -0400, Han, Weidong wrote:
> Hi all,
> 
> Recently, more and more people are interesting in gfx passthrough. But now xen-unstable doesn't support it, although some guys (Jean Guyader, Beng Heng, Ng) posted gfx passthrough patches. If xen-unstable includes gfx passthrough support, people can be easy to try it.
> 
> gfx passthrough is more complicated than other PCI device passthrough such as NIC, and is hard to use a generic approach for all gfx passthrough. But there are some necessary changes for gfx passthrough:
>   1. disable emulated VGA adapter, instead use passthroughed gfx
>   2. load VGA bios of the gfx to guest
>   3. passthrough legacy VGA IO ports and MMIOs to guest
> 
> This patchset implements above common changes. Based on the common changes, we are investigating to support more gfx cards and guest OSs. We will post the hacks in future.
> 
> The patchset supports to passthrough the primary gfx and discrete gfx. With the patchset, virtualization friendly gfx cards can be passthroughed (e.g. Nvidia FX3800), IGD and many discrete gfx cards are not supported yet. 
> 
> This is easy to use, the only difference from other PCI passthrough is to add following lines to hvm configure file:
> 
> #----------------------------------------------------------------------------------------
> # 0: no gfx passthru, 1: IGD passthru, 2: discrete gfx passthru, default is 0
> gfx_passthru=2
> 
> and also pls passthrough a USB controller for keyboard/mouse use in guest. (Now there are some issues on USB controller passthrough with pv-ops dom0, so currently prefer to use 2.6.18 dom0.)
> 

Once we have those patch inside xen-unstable, I could commit the patch we have for XCI
to share the host keyboard/mouse with multiple vms.

> 
> The patchset is as follows:
> 1. PATCH 1/2: changes in xen-unstable
> 	- 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
> 
> 2. PATCH 2/2: changes in QEMU
> 	- disable emulated VGA adapter 
> 	- register/unregister legacy VGA I/O ports and MMIOs
> 
> 

Hi,

Has those patch been tested with an intel IGD?

Because I think they are some pieces missing: 
        - GMCH mapping in the guest.
        - VID DID pt for the host bridge (for linux hvm guest).
        - TOM pass through for winxp guest.

Jean

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

* RE: [PATCH 0/2] graphics passthrough with VT-d
  2009-08-28  8:24 ` Jean Guyader
@ 2009-08-28  8:32   ` Han, Weidong
  2010-03-13  0:37   ` [PATCH 0/2] graphics passthrough with VT-d / keyboard and mouse sharing patch Pasi Kärkkäinen
  1 sibling, 0 replies; 15+ messages in thread
From: Han, Weidong @ 2009-08-28  8:32 UTC (permalink / raw)
  To: 'Jean Guyader'
  Cc: 'xen-devel@lists.xensource.com',
	Lin, Ben Y, 'Keir, Kay, Allen M, Fraser',
	'bengheng@eecs.umich.edu'

Jean Guyader wrote:
> On Fri, Aug 28, 2009 at 03:53:56AM -0400, Han, Weidong wrote:
>> Hi all,
>> 
>> Recently, more and more people are interesting in gfx passthrough.
>> But now xen-unstable doesn't support it, although some guys (Jean
>> Guyader, Beng Heng, Ng) posted gfx passthrough patches. If
>> xen-unstable includes gfx passthrough support, people can be easy to
>> try it.    
>> 
>> gfx passthrough is more complicated than other PCI device
>> passthrough such as NIC, and is hard to use a generic approach for
>> all gfx passthrough. But there are some necessary changes for gfx
>> passthrough:   
>>   1. disable emulated VGA adapter, instead use passthroughed gfx
>>   2. load VGA bios of the gfx to guest
>>   3. passthrough legacy VGA IO ports and MMIOs to guest
>> 
>> This patchset implements above common changes. Based on the common
>> changes, we are investigating to support more gfx cards and guest
>> OSs. We will post the hacks in future.  
>> 
>> The patchset supports to passthrough the primary gfx and discrete
>> gfx. With the patchset, virtualization friendly gfx cards can be
>> passthroughed (e.g. Nvidia FX3800), IGD and many discrete gfx cards
>> are not supported yet.   
>> 
>> This is easy to use, the only difference from other PCI passthrough
>> is to add following lines to hvm configure file: 
>> 
>> #----------------------------------------------------------------------------------------
>> # 0: no gfx passthru, 1: IGD passthru, 2: discrete gfx passthru,
>> default is 0 
>> gfx_passthru=2
>> 
>> and also pls passthrough a USB controller for keyboard/mouse use in
>> guest. (Now there are some issues on USB controller passthrough with
>> pv-ops dom0, so currently prefer to use 2.6.18 dom0.)  
>> 
> 
> Once we have those patch inside xen-unstable, I could commit the
> patch we have for XCI to share the host keyboard/mouse with multiple
> vms. 

Cool. That's very useful.

Regards,
Weidong

> 
>> 
>> The patchset is as follows:
>> 1. PATCH 1/2: changes in xen-unstable
>> 	- 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
>> 
>> 2. PATCH 2/2: changes in QEMU
>> 	- disable emulated VGA adapter
>> 	- register/unregister legacy VGA I/O ports and MMIOs
>> 
>> 
> 
> Hi,
> 
> Has those patch been tested with an intel IGD?
> 
> Because I think they are some pieces missing:
>         - GMCH mapping in the guest.
>         - VID DID pt for the host bridge (for linux hvm guest).
>         - TOM pass through for winxp guest.
> 
> Jean

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

* Re: [PATCH 0/2] graphics passthrough with VT-d
  2009-08-28  7:53 [PATCH 0/2] graphics passthrough with VT-d Han, Weidong
  2009-08-28  8:24 ` Jean Guyader
@ 2009-08-28  9:04 ` Andrew Lyon
  2009-08-28  9:13   ` Han, Weidong
  2009-09-16 14:23 ` Stefano Stabellini
  2 siblings, 1 reply; 15+ messages in thread
From: Andrew Lyon @ 2009-08-28  9:04 UTC (permalink / raw)
  To: Han, Weidong; +Cc: xen-devel

On Fri, Aug 28, 2009 at 8:53 AM, Han, Weidong<weidong.han@intel.com> wrote:
> Hi all,
>
> Recently, more and more people are interesting in gfx passthrough. But now xen-unstable doesn't support it, although some guys (Jean Guyader, Beng Heng, Ng) posted gfx passthrough patches. If xen-unstable includes gfx passthrough support, people can be easy to try it.
>
> gfx passthrough is more complicated than other PCI device passthrough such as NIC, and is hard to use a generic approach for all gfx passthrough. But there are some necessary changes for gfx passthrough:
>  1. disable emulated VGA adapter, instead use passthroughed gfx
>  2. load VGA bios of the gfx to guest
>  3. passthrough legacy VGA IO ports and MMIOs to guest
>
> This patchset implements above common changes. Based on the common changes, we are investigating to support more gfx cards and guest OSs. We will post the hacks in future.
>
> The patchset supports to passthrough the primary gfx and discrete gfx. With the patchset, virtualization friendly gfx cards can be passthroughed (e.g. Nvidia FX3800), IGD and many discrete gfx cards are not supported yet.

What about cheaper cards in the FX range like the FX580 or FX1800, are
they likely to be passthrough friendly?

Perhaps we should ask nvidia exactly which cards support
virtualization, or is it a feature that is listed in the tech specs?,
I could probably run to one of the cheaper FX cards but the high end
ones are way too expensive for me to justify the cost.

Andy

>
> This is easy to use, the only difference from other PCI passthrough is to add following lines to hvm configure file:
>
> #----------------------------------------------------------------------------------------
> # 0: no gfx passthru, 1: IGD passthru, 2: discrete gfx passthru, default is 0
> gfx_passthru=2
>
> and also pls passthrough a USB controller for keyboard/mouse use in guest. (Now there are some issues on USB controller passthrough with pv-ops dom0, so currently prefer to use 2.6.18 dom0.)
>
>
> The patchset is as follows:
> 1. PATCH 1/2: changes in xen-unstable
>        - 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
>
> 2. PATCH 2/2: changes in QEMU
>        - disable emulated VGA adapter
>        - register/unregister legacy VGA I/O ports and MMIOs
>
>
> 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
>

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

* RE: [PATCH 0/2] graphics passthrough with VT-d
  2009-08-28  9:04 ` [PATCH 0/2] graphics passthrough with VT-d Andrew Lyon
@ 2009-08-28  9:13   ` Han, Weidong
  2009-08-28 10:23     ` Andrew Lyon
  0 siblings, 1 reply; 15+ messages in thread
From: Han, Weidong @ 2009-08-28  9:13 UTC (permalink / raw)
  To: 'Andrew Lyon'; +Cc: 'xen-devel@lists.xensource.com'

Andrew Lyon wrote:
> On Fri, Aug 28, 2009 at 8:53 AM, Han, Weidong<weidong.han@intel.com>
> wrote: 
>> Hi all,
>> 
>> Recently, more and more people are interesting in gfx passthrough.
>> But now xen-unstable doesn't support it, although some guys (Jean
>> Guyader, Beng Heng, Ng) posted gfx passthrough patches. If
>> xen-unstable includes gfx passthrough support, people can be easy to
>> try it.    
>> 
>> gfx passthrough is more complicated than other PCI device
>> passthrough such as NIC, and is hard to use a generic approach for
>> all gfx passthrough. But there are some necessary changes for gfx
>> passthrough:   
>>  1. disable emulated VGA adapter, instead use passthroughed gfx
>>  2. load VGA bios of the gfx to guest
>>  3. passthrough legacy VGA IO ports and MMIOs to guest
>> 
>> This patchset implements above common changes. Based on the common
>> changes, we are investigating to support more gfx cards and guest
>> OSs. We will post the hacks in future.  
>> 
>> The patchset supports to passthrough the primary gfx and discrete
>> gfx. With the patchset, virtualization friendly gfx cards can be
>> passthroughed (e.g. Nvidia FX3800), IGD and many discrete gfx cards
>> are not supported yet.   
> 
> What about cheaper cards in the FX range like the FX580 or FX1800, are
> they likely to be passthrough friendly?

I don't know. We didn't try those cards. You can try with our patch by yourself.

> 
> Perhaps we should ask nvidia exactly which cards support
> virtualization, or is it a feature that is listed in the tech specs?,

No. we just find it works with the common changes. Actually, its VGA bios re-execution doesn't works well. 

Regards,
Weidong

> I could probably run to one of the cheaper FX cards but the high end
> ones are way too expensive for me to justify the cost.
> 
> Andy
> 
>> 
>> This is easy to use, the only difference from other PCI passthrough
>> is to add following lines to hvm configure file: 
>> 
>> #----------------------------------------------------------------------------------------
>> # 0: no gfx passthru, 1: IGD passthru, 2: discrete gfx passthru,
>> default is 0 
>> gfx_passthru=2
>> 
>> and also pls passthrough a USB controller for keyboard/mouse use in
>> guest. (Now there are some issues on USB controller passthrough with
>> pv-ops dom0, so currently prefer to use 2.6.18 dom0.)  
>> 
>> 
>> The patchset is as follows:
>> 1. PATCH 1/2: changes in xen-unstable
>>        - 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
>> 
>> 2. PATCH 2/2: changes in QEMU
>>        - disable emulated VGA adapter
>>        - register/unregister legacy VGA I/O ports and MMIOs
>> 
>> 
>> 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

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

* Re: [PATCH 0/2] graphics passthrough with VT-d
  2009-08-28  9:13   ` Han, Weidong
@ 2009-08-28 10:23     ` Andrew Lyon
  0 siblings, 0 replies; 15+ messages in thread
From: Andrew Lyon @ 2009-08-28 10:23 UTC (permalink / raw)
  To: Han, Weidong; +Cc: xen-devel

On Fri, Aug 28, 2009 at 10:13 AM, Han, Weidong<weidong.han@intel.com> wrote:
> Andrew Lyon wrote:
>> On Fri, Aug 28, 2009 at 8:53 AM, Han, Weidong<weidong.han@intel.com>
>> wrote:
>>> Hi all,
>>>
>>> Recently, more and more people are interesting in gfx passthrough.
>>> But now xen-unstable doesn't support it, although some guys (Jean
>>> Guyader, Beng Heng, Ng) posted gfx passthrough patches. If
>>> xen-unstable includes gfx passthrough support, people can be easy to
>>> try it.
>>>
>>> gfx passthrough is more complicated than other PCI device
>>> passthrough such as NIC, and is hard to use a generic approach for
>>> all gfx passthrough. But there are some necessary changes for gfx
>>> passthrough:
>>>  1. disable emulated VGA adapter, instead use passthroughed gfx
>>>  2. load VGA bios of the gfx to guest
>>>  3. passthrough legacy VGA IO ports and MMIOs to guest
>>>
>>> This patchset implements above common changes. Based on the common
>>> changes, we are investigating to support more gfx cards and guest
>>> OSs. We will post the hacks in future.
>>>
>>> The patchset supports to passthrough the primary gfx and discrete
>>> gfx. With the patchset, virtualization friendly gfx cards can be
>>> passthroughed (e.g. Nvidia FX3800), IGD and many discrete gfx cards
>>> are not supported yet.
>>
>> What about cheaper cards in the FX range like the FX580 or FX1800, are
>> they likely to be passthrough friendly?
>
> I don't know. We didn't try those cards. You can try with our patch by yourself.
>
>>
>> Perhaps we should ask nvidia exactly which cards support
>> virtualization, or is it a feature that is listed in the tech specs?,
>
> No. we just find it works with the common changes. Actually, its VGA bios re-execution doesn't works well.

http://www.nvidia.com/object/sli_multi_os.html

Dual Quadro FX 5800, 4800, and 3800 professional graphics boards



>
> Regards,
> Weidong
>
>> I could probably run to one of the cheaper FX cards but the high end
>> ones are way too expensive for me to justify the cost.
>>
>> Andy
>>
>>>
>>> This is easy to use, the only difference from other PCI passthrough
>>> is to add following lines to hvm configure file:
>>>
>>> #----------------------------------------------------------------------------------------
>>> # 0: no gfx passthru, 1: IGD passthru, 2: discrete gfx passthru,
>>> default is 0
>>> gfx_passthru=2
>>>
>>> and also pls passthrough a USB controller for keyboard/mouse use in
>>> guest. (Now there are some issues on USB controller passthrough with
>>> pv-ops dom0, so currently prefer to use 2.6.18 dom0.)
>>>
>>>
>>> The patchset is as follows:
>>> 1. PATCH 1/2: changes in xen-unstable
>>>        - 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
>>>
>>> 2. PATCH 2/2: changes in QEMU
>>>        - disable emulated VGA adapter
>>>        - register/unregister legacy VGA I/O ports and MMIOs
>>>
>>>
>>> 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
>
>

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

* Re: [PATCH 0/2] graphics passthrough with VT-d
  2009-08-28  7:53 [PATCH 0/2] graphics passthrough with VT-d Han, Weidong
  2009-08-28  8:24 ` Jean Guyader
  2009-08-28  9:04 ` [PATCH 0/2] graphics passthrough with VT-d Andrew Lyon
@ 2009-09-16 14:23 ` Stefano Stabellini
  2009-09-16 23:50   ` Lin, Ben Y
  2009-09-17  1:10   ` Han, Weidong
  2 siblings, 2 replies; 15+ messages in thread
From: Stefano Stabellini @ 2009-09-16 14:23 UTC (permalink / raw)
  To: Han, Weidong
  Cc: 'xen-devel@lists.xensource.com',
	Lin, Ben Y, Kay, Allen M, Jean Guyader, Fraser

On Fri, 28 Aug 2009, Han, Weidong wrote:
> Hi all,
> 
> Recently, more and more people are interesting in gfx passthrough. But now xen-unstable doesn't support it, although some guys (Jean Guyader, Beng Heng, Ng) posted gfx passthrough patches. If xen-unstable includes gfx passthrough support, people can be easy to try it.
> 
> gfx passthrough is more complicated than other PCI device passthrough such as NIC, and is hard to use a generic approach for all gfx passthrough. But there are some necessary changes for gfx passthrough:
>   1. disable emulated VGA adapter, instead use passthroughed gfx
>   2. load VGA bios of the gfx to guest
>   3. passthrough legacy VGA IO ports and MMIOs to guest
> 
> This patchset implements above common changes. Based on the common changes, we are investigating to support more gfx cards and guest OSs. We will post the hacks in future.
> 
> The patchset supports to passthrough the primary gfx and discrete gfx. With the patchset, virtualization friendly gfx cards can be passthroughed (e.g. Nvidia FX3800), IGD and many discrete gfx cards are not supported yet. 
> 
> This is easy to use, the only difference from other PCI passthrough is to add following lines to hvm configure file:
> 
> #----------------------------------------------------------------------------------------
> # 0: no gfx passthru, 1: IGD passthru, 2: discrete gfx passthru, default is 0
> gfx_passthru=2
> 
> and also pls passthrough a USB controller for keyboard/mouse use in guest. (Now there are some issues on USB controller passthrough with pv-ops dom0, so currently prefer to use 2.6.18 dom0.)
> 
> 
> The patchset is as follows:
> 1. PATCH 1/2: changes in xen-unstable
> 	- 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
> 
> 2. PATCH 2/2: changes in QEMU
> 	- disable emulated VGA adapter 
> 	- register/unregister legacy VGA I/O ports and MMIOs
> 


I think we should make clear that this option is for passing through
graphic cards as the primary graphic device in the guest.
Discrete graphic cards could be passed through to the guest as
secondary graphic devices, avoiding the need for remapping the vga bios
or disabling the emulated vga.
I think they would still need the other patches, in particular the
vBAR-pBAR patch.
What do you think about adding a third option "3 : discrete gfx passthru
as secondary"?

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

* RE: [PATCH 0/2] graphics passthrough with VT-d
  2009-09-16 14:23 ` Stefano Stabellini
@ 2009-09-16 23:50   ` Lin, Ben Y
  2009-09-21 17:05     ` Jun Koi
  2009-09-17  1:10   ` Han, Weidong
  1 sibling, 1 reply; 15+ messages in thread
From: Lin, Ben Y @ 2009-09-16 23:50 UTC (permalink / raw)
  To: Stefano Stabellini, Han, Weidong
  Cc: 'xen-devel@lists.xensource.com',
	Kay, Allen M, Guyader, Keir Fraser

[-- Attachment #1: Type: text/plain, Size: 3444 bytes --]

One shortcoming of VGA resource remapping is that the host domain could not use console anymore.

Here is what we did before in XEN:
Pass-through the Discrete graphics card into guest as the primary graphics card, and used the emulated VGA controller for this graphics card in the guest. In other words, graphics card in the guest = physical graphics card (3D computing) + emulated VGA controller.

This solution could avoid of VGA resource remapping, and the host domain could use the console as usual.

Thanks
Ben

-----Original Message-----
From: Stefano Stabellini [mailto:stefano.stabellini@eu.citrix.com] 
Sent: 2009年9月16日 22:24
To: Han, Weidong
Cc: 'xen-devel@lists.xensource.com'; Lin, Ben Y; 'bengheng@eecs.umich.edu'; Kay, Allen M; Keir Fraser; Jean Guyader
Subject: Re: [Xen-devel] [PATCH 0/2] graphics passthrough with VT-d

On Fri, 28 Aug 2009, Han, Weidong wrote:
> Hi all,
> 
> Recently, more and more people are interesting in gfx passthrough. But now xen-unstable doesn't support it, although some guys (Jean Guyader, Beng Heng, Ng) posted gfx passthrough patches. If xen-unstable includes gfx passthrough support, people can be easy to try it.
> 
> gfx passthrough is more complicated than other PCI device passthrough such as NIC, and is hard to use a generic approach for all gfx passthrough. But there are some necessary changes for gfx passthrough:
>   1. disable emulated VGA adapter, instead use passthroughed gfx
>   2. load VGA bios of the gfx to guest
>   3. passthrough legacy VGA IO ports and MMIOs to guest
> 
> This patchset implements above common changes. Based on the common changes, we are investigating to support more gfx cards and guest OSs. We will post the hacks in future.
> 
> The patchset supports to passthrough the primary gfx and discrete gfx. With the patchset, virtualization friendly gfx cards can be passthroughed (e.g. Nvidia FX3800), IGD and many discrete gfx cards are not supported yet. 
> 
> This is easy to use, the only difference from other PCI passthrough is to add following lines to hvm configure file:
> 
> #----------------------------------------------------------------------------------------
> # 0: no gfx passthru, 1: IGD passthru, 2: discrete gfx passthru, default is 0
> gfx_passthru=2
> 
> and also pls passthrough a USB controller for keyboard/mouse use in guest. (Now there are some issues on USB controller passthrough with pv-ops dom0, so currently prefer to use 2.6.18 dom0.)
> 
> 
> The patchset is as follows:
> 1. PATCH 1/2: changes in xen-unstable
> 	- 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
> 
> 2. PATCH 2/2: changes in QEMU
> 	- disable emulated VGA adapter 
> 	- register/unregister legacy VGA I/O ports and MMIOs
> 


I think we should make clear that this option is for passing through
graphic cards as the primary graphic device in the guest.
Discrete graphic cards could be passed through to the guest as
secondary graphic devices, avoiding the need for remapping the vga bios
or disabling the emulated vga.
I think they would still need the other patches, in particular the
vBAR-pBAR patch.
What do you think about adding a third option "3 : discrete gfx passthru
as secondary"?

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

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

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

* RE: [PATCH 0/2] graphics passthrough with VT-d
  2009-09-16 14:23 ` Stefano Stabellini
  2009-09-16 23:50   ` Lin, Ben Y
@ 2009-09-17  1:10   ` Han, Weidong
  1 sibling, 0 replies; 15+ messages in thread
From: Han, Weidong @ 2009-09-17  1:10 UTC (permalink / raw)
  To: 'Stefano Stabellini'
  Cc: 'xen-devel@lists.xensource.com',
	Lin, Ben Y, 'Keir, Kay, Allen M, 'Jean Guyader',
	Fraser', 'bengheng@eecs.umich.edu'

Stefano Stabellini wrote:
> On Fri, 28 Aug 2009, Han, Weidong wrote:
>> Hi all,
>> 
>> Recently, more and more people are interesting in gfx passthrough.
>> But now xen-unstable doesn't support it, although some guys (Jean
>> Guyader, Beng Heng, Ng) posted gfx passthrough patches. If
>> xen-unstable includes gfx passthrough support, people can be easy to
>> try it.    
>> 
>> gfx passthrough is more complicated than other PCI device
>> passthrough such as NIC, and is hard to use a generic approach for
>> all gfx passthrough. But there are some necessary changes for gfx
>> passthrough:   
>>   1. disable emulated VGA adapter, instead use passthroughed gfx
>>   2. load VGA bios of the gfx to guest
>>   3. passthrough legacy VGA IO ports and MMIOs to guest
>> 
>> This patchset implements above common changes. Based on the common
>> changes, we are investigating to support more gfx cards and guest
>> OSs. We will post the hacks in future.  
>> 
>> The patchset supports to passthrough the primary gfx and discrete
>> gfx. With the patchset, virtualization friendly gfx cards can be
>> passthroughed (e.g. Nvidia FX3800), IGD and many discrete gfx cards
>> are not supported yet.   
>> 
>> This is easy to use, the only difference from other PCI passthrough
>> is to add following lines to hvm configure file: 
>> 
>> #----------------------------------------------------------------------------------------
>> # 0: no gfx passthru, 1: IGD passthru, 2: discrete gfx passthru,
>> default is 0 
>> gfx_passthru=2
>> 
>> and also pls passthrough a USB controller for keyboard/mouse use in
>> guest. (Now there are some issues on USB controller passthrough with
>> pv-ops dom0, so currently prefer to use 2.6.18 dom0.)  
>> 
>> 
>> The patchset is as follows:
>> 1. PATCH 1/2: changes in xen-unstable
>> 	- 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
>> 
>> 2. PATCH 2/2: changes in QEMU
>> 	- disable emulated VGA adapter
>> 	- register/unregister legacy VGA I/O ports and MMIOs
>> 
> 
> 
> I think we should make clear that this option is for passing through
> graphic cards as the primary graphic device in the guest.
> Discrete graphic cards could be passed through to the guest as
> secondary graphic devices, avoiding the need for remapping the vga
> bios or disabling the emulated vga.
> I think they would still need the other patches, in particular the
> vBAR-pBAR patch.
> What do you think about adding a third option "3 : discrete gfx
> passthru as secondary"?

Yes, it still needs more efforts to make gfx passthrough perfect. This patchset just supports basic gfx passthrough. Based on it, we can develop to support more gfx cards (e.g. IGD, other Nvidia and ATI cards), and more use cases (e.g. secondary gfx in guest, use emulated vga in guest with passthroughed gfx).

Regards,
Weidong

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

* Re: [PATCH 0/2] graphics passthrough with VT-d
  2009-09-16 23:50   ` Lin, Ben Y
@ 2009-09-21 17:05     ` Jun Koi
  2009-09-22  2:17       ` Lin, Ben Y
  0 siblings, 1 reply; 15+ messages in thread
From: Jun Koi @ 2009-09-21 17:05 UTC (permalink / raw)
  To: Lin, Ben Y
  Cc: xen-devel, Stefano Stabellini, Han, Weidong, Kay, Allen M,
	Guyader, Keir Fraser, bengheng

hi Lin,



2009/9/17 Lin, Ben Y <ben.y.lin@intel.com>:
> One shortcoming of VGA resource remapping is that the host domain could not use console anymore.
>
> Here is what we did before in XEN:
> Pass-through the Discrete graphics card into guest as the primary graphics card, and used the emulated VGA controller for this graphics card in the guest. In other words, graphics card in the guest = physical graphics card (3D computing) + emulated VGA controller.
>
> This solution could avoid of VGA resource remapping, and the host domain could use the console as usual.

This is cool! I am wondering how we can separate 3D access and VGA
controller access, so we can direct some access to physical stuff, and
the other to emulated controller??

What is the current status of this project?

Thanks,
J

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

* RE: [PATCH 0/2] graphics passthrough with VT-d
  2009-09-21 17:05     ` Jun Koi
@ 2009-09-22  2:17       ` Lin, Ben Y
  0 siblings, 0 replies; 15+ messages in thread
From: Lin, Ben Y @ 2009-09-22  2:17 UTC (permalink / raw)
  To: Jun Koi
  Cc: xen-devel, Stefano Stabellini, Han, Weidong, Kay, Allen M,
	Guyader, Keir Fraser, bengheng

[-- Attachment #1: Type: text/plain, Size: 2262 bytes --]

Hi Jun:

We tried the following way to enable the QEMU-emulated VGA for NVIDIA graphics pass-through:

1. Assign qemu-emulated VGA resource (0x3C0~0x3DF, 0xA0000~0xC0000) to guest vista. (This part is similar as what existing QEMU does, we just keep the logical for VGA operations)
2. Copy Standard VGA bios to 0xC0000~0xD0000, and copy the VIDEO BIOS of NVIDIA graphics card to 0xD0000~0xE0000. 
The tricky issue is that you should not let the VIDEO BIOS of NVIDIA     Graphics card execution in the virtual BIOS of guest, because it will check the status of physical VGA controller, and it will be in infinite loop.
3. Use standard VGA bios to do initialization of the qemu-emulated VGA resource, and then the booting progress will be shown in qemu-emulated VGA (SDL Window). 
4. After completing the booting progress, the guest vista will run the VIDEO BIOS of NVIDIA graphics card to initialize the graphics card. As we known, in this phase, no VGA output necessary, so the video bios of NVIDIA card only initialize the 3D related of graphics card. In this phase, you can close the SDL window.


Thanks
Ben

-----Original Message-----
From: Jun Koi [mailto:junkoi2004@gmail.com] 
Sent: 2009年9月22日 1:06
To: Lin, Ben Y
Cc: Stefano Stabellini; Han, Weidong; xen-devel@lists.xensource.com; Kay, Allen M; Guyader; Keir Fraser; bengheng@eecs.umich.edu
Subject: Re: [Xen-devel] [PATCH 0/2] graphics passthrough with VT-d

hi Lin,



2009/9/17 Lin, Ben Y <ben.y.lin@intel.com>:
> One shortcoming of VGA resource remapping is that the host domain could not use console anymore.
>
> Here is what we did before in XEN:
> Pass-through the Discrete graphics card into guest as the primary graphics card, and used the emulated VGA controller for this graphics card in the guest. In other words, graphics card in the guest = physical graphics card (3D computing) + emulated VGA controller.
>
> This solution could avoid of VGA resource remapping, and the host domain could use the console as usual.

This is cool! I am wondering how we can separate 3D access and VGA
controller access, so we can direct some access to physical stuff, and
the other to emulated controller??

What is the current status of this project?

Thanks,
J

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

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

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

* Re: [PATCH 0/2] graphics passthrough with VT-d / keyboard and mouse sharing patch
  2009-08-28  8:24 ` Jean Guyader
  2009-08-28  8:32   ` Han, Weidong
@ 2010-03-13  0:37   ` Pasi Kärkkäinen
  2010-03-17 15:42     ` Jean Guyader
  1 sibling, 1 reply; 15+ messages in thread
From: Pasi Kärkkäinen @ 2010-03-13  0:37 UTC (permalink / raw)
  To: Jean Guyader
  Cc: Lin, Ben Y, Kay, Allen M, 'xen-devel@lists.xensource.com',
	Han, Weidong, 'bengheng@eecs.umich.edu'

On Fri, Aug 28, 2009 at 09:24:31AM +0100, Jean Guyader wrote:
> On Fri, Aug 28, 2009 at 03:53:56AM -0400, Han, Weidong wrote:
> > Hi all,
> > 
> > Recently, more and more people are interesting in gfx passthrough. But now xen-unstable doesn't support it, although some guys (Jean Guyader, Beng Heng, Ng) posted gfx passthrough patches. If xen-unstable includes gfx passthrough support, people can be easy to try it.
> > 
> > gfx passthrough is more complicated than other PCI device passthrough such as NIC, and is hard to use a generic approach for all gfx passthrough. But there are some necessary changes for gfx passthrough:
> >   1. disable emulated VGA adapter, instead use passthroughed gfx
> >   2. load VGA bios of the gfx to guest
> >   3. passthrough legacy VGA IO ports and MMIOs to guest
> > 
> > This patchset implements above common changes. Based on the common changes, we are investigating to support more gfx cards and guest OSs. We will post the hacks in future.
> > 
> > The patchset supports to passthrough the primary gfx and discrete gfx. With the patchset, virtualization friendly gfx cards can be passthroughed (e.g. Nvidia FX3800), IGD and many discrete gfx cards are not supported yet. 
> > 
> > This is easy to use, the only difference from other PCI passthrough is to add following lines to hvm configure file:
> > 
> > #----------------------------------------------------------------------------------------
> > # 0: no gfx passthru, 1: IGD passthru, 2: discrete gfx passthru, default is 0
> > gfx_passthru=2
> > 
> > and also pls passthrough a USB controller for keyboard/mouse use in guest. (Now there are some issues on USB controller passthrough with pv-ops dom0, so currently prefer to use 2.6.18 dom0.)
> > 
> 
> Once we have those patch inside xen-unstable, I could commit the patch we have for XCI
> to share the host keyboard/mouse with multiple vms.
> 

Hello,

I just found this while going through the archives.

Jean:
I don't remember seeing this keyboard/mouse sharing patch.. 
Can you send it now when xen-unstable has graphics passthru support?

-- Pasi

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

* Re: [PATCH 0/2] graphics passthrough with VT-d / keyboard and mouse sharing patch
  2010-03-13  0:37   ` [PATCH 0/2] graphics passthrough with VT-d / keyboard and mouse sharing patch Pasi Kärkkäinen
@ 2010-03-17 15:42     ` Jean Guyader
  2010-03-18 16:01       ` Pasi Kärkkäinen
  2010-08-15 19:50       ` Pasi Kärkkäinen
  0 siblings, 2 replies; 15+ messages in thread
From: Jean Guyader @ 2010-03-17 15:42 UTC (permalink / raw)
  To: Pasi Kärkkäinen
  Cc: xen-devel, Lin, Ben Y, Kay, Allen M, Jean Guyader, Han, Weidong,
	bengheng

On 13 March 2010 00:37, Pasi Kärkkäinen <pasik@iki.fi> wrote:
> On Fri, Aug 28, 2009 at 09:24:31AM +0100, Jean Guyader wrote:
>> On Fri, Aug 28, 2009 at 03:53:56AM -0400, Han, Weidong wrote:
>> > Hi all,
>> >
>> > Recently, more and more people are interesting in gfx passthrough. But now xen-unstable doesn't support it, although some guys (Jean Guyader, Beng Heng, Ng) posted gfx passthrough patches. If xen-unstable includes gfx passthrough support, people can be easy to try it.
>> >
>> > gfx passthrough is more complicated than other PCI device passthrough such as NIC, and is hard to use a generic approach for all gfx passthrough. But there are some necessary changes for gfx passthrough:
>> >   1. disable emulated VGA adapter, instead use passthroughed gfx
>> >   2. load VGA bios of the gfx to guest
>> >   3. passthrough legacy VGA IO ports and MMIOs to guest
>> >
>> > This patchset implements above common changes. Based on the common changes, we are investigating to support more gfx cards and guest OSs. We will post the hacks in future.
>> >
>> > The patchset supports to passthrough the primary gfx and discrete gfx. With the patchset, virtualization friendly gfx cards can be passthroughed (e.g. Nvidia FX3800), IGD and many discrete gfx cards are not supported yet.
>> >
>> > This is easy to use, the only difference from other PCI passthrough is to add following lines to hvm configure file:
>> >
>> > #----------------------------------------------------------------------------------------
>> > # 0: no gfx passthru, 1: IGD passthru, 2: discrete gfx passthru, default is 0
>> > gfx_passthru=2
>> >
>> > and also pls passthrough a USB controller for keyboard/mouse use in guest. (Now there are some issues on USB controller passthrough with pv-ops dom0, so currently prefer to use 2.6.18 dom0.)
>> >
>>
>> Once we have those patch inside xen-unstable, I could commit the patch we have for XCI
>> to share the host keyboard/mouse with multiple vms.
>>
>
> Hello,
>
> I just found this while going through the archives.
>
> Jean:
> I don't remember seeing this keyboard/mouse sharing patch..
> Can you send it now when xen-unstable has graphics passthru support?
>

Hi Pasi,

I didn't post the patch on the mailing list, and in XCI we changed the
way it was working.
When I will have some free time, I will right a more upstreamable version.

Jean

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

* Re: [PATCH 0/2] graphics passthrough with VT-d / keyboard and mouse sharing patch
  2010-03-17 15:42     ` Jean Guyader
@ 2010-03-18 16:01       ` Pasi Kärkkäinen
  2010-08-15 19:50       ` Pasi Kärkkäinen
  1 sibling, 0 replies; 15+ messages in thread
From: Pasi Kärkkäinen @ 2010-03-18 16:01 UTC (permalink / raw)
  To: Jean Guyader
  Cc: xen-devel, Lin, Ben Y, Kay, Allen M, Jean Guyader, Han, Weidong,
	bengheng

On Wed, Mar 17, 2010 at 03:42:55PM +0000, Jean Guyader wrote:
> On 13 March 2010 00:37, Pasi Kärkkäinen <pasik@iki.fi> wrote:
> > On Fri, Aug 28, 2009 at 09:24:31AM +0100, Jean Guyader wrote:
> >> On Fri, Aug 28, 2009 at 03:53:56AM -0400, Han, Weidong wrote:
> >> > Hi all,
> >> >
> >> > Recently, more and more people are interesting in gfx passthrough. But now xen-unstable doesn't support it, although some guys (Jean Guyader, Beng Heng, Ng) posted gfx passthrough patches. If xen-unstable includes gfx passthrough support, people can be easy to try it.
> >> >
> >> > gfx passthrough is more complicated than other PCI device passthrough such as NIC, and is hard to use a generic approach for all gfx passthrough. But there are some necessary changes for gfx passthrough:
> >> >   1. disable emulated VGA adapter, instead use passthroughed gfx
> >> >   2. load VGA bios of the gfx to guest
> >> >   3. passthrough legacy VGA IO ports and MMIOs to guest
> >> >
> >> > This patchset implements above common changes. Based on the common changes, we are investigating to support more gfx cards and guest OSs. We will post the hacks in future.
> >> >
> >> > The patchset supports to passthrough the primary gfx and discrete gfx. With the patchset, virtualization friendly gfx cards can be passthroughed (e.g. Nvidia FX3800), IGD and many discrete gfx cards are not supported yet.
> >> >
> >> > This is easy to use, the only difference from other PCI passthrough is to add following lines to hvm configure file:
> >> >
> >> > #----------------------------------------------------------------------------------------
> >> > # 0: no gfx passthru, 1: IGD passthru, 2: discrete gfx passthru, default is 0
> >> > gfx_passthru=2
> >> >
> >> > and also pls passthrough a USB controller for keyboard/mouse use in guest. (Now there are some issues on USB controller passthrough with pv-ops dom0, so currently prefer to use 2.6.18 dom0.)
> >> >
> >>
> >> Once we have those patch inside xen-unstable, I could commit the patch we have for XCI
> >> to share the host keyboard/mouse with multiple vms.
> >>
> >
> > Hello,
> >
> > I just found this while going through the archives.
> >
> > Jean:
> > I don't remember seeing this keyboard/mouse sharing patch..
> > Can you send it now when xen-unstable has graphics passthru support?
> >
> 
> Hi Pasi,
> 
> I didn't post the patch on the mailing list, and in XCI we changed the
> way it was working.
> When I will have some free time, I will right a more upstreamable version.
>

Ok, great!

-- Pasi
 

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

* Re: [PATCH 0/2] graphics passthrough with VT-d / keyboard and mouse sharing patch
  2010-03-17 15:42     ` Jean Guyader
  2010-03-18 16:01       ` Pasi Kärkkäinen
@ 2010-08-15 19:50       ` Pasi Kärkkäinen
  1 sibling, 0 replies; 15+ messages in thread
From: Pasi Kärkkäinen @ 2010-08-15 19:50 UTC (permalink / raw)
  To: Jean Guyader
  Cc: xen-devel, Lin, Ben Y, Kay, Allen M, Jean Guyader, Han, Weidong,
	bengheng

On Wed, Mar 17, 2010 at 03:42:55PM +0000, Jean Guyader wrote:
> >>
> >> Once we have those patch inside xen-unstable, I could commit the patch we have for XCI
> >> to share the host keyboard/mouse with multiple vms.
> >>
> >
> > Hello,
> >
> > I just found this while going through the archives.
> >
> > Jean:
> > I don't remember seeing this keyboard/mouse sharing patch..
> > Can you send it now when xen-unstable has graphics passthru support?
> >
> 
> Hi Pasi,
> 
> I didn't post the patch on the mailing list, and in XCI we changed the
> way it was working.
> When I will have some free time, I will right a more upstreamable version.
> 

Hello again,

Any progress with the keyboard/mouse sharing patch? Is the XCI version ok?

-- Pasi

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

end of thread, other threads:[~2010-08-15 19:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-28  7:53 [PATCH 0/2] graphics passthrough with VT-d Han, Weidong
2009-08-28  8:24 ` Jean Guyader
2009-08-28  8:32   ` Han, Weidong
2010-03-13  0:37   ` [PATCH 0/2] graphics passthrough with VT-d / keyboard and mouse sharing patch Pasi Kärkkäinen
2010-03-17 15:42     ` Jean Guyader
2010-03-18 16:01       ` Pasi Kärkkäinen
2010-08-15 19:50       ` Pasi Kärkkäinen
2009-08-28  9:04 ` [PATCH 0/2] graphics passthrough with VT-d Andrew Lyon
2009-08-28  9:13   ` Han, Weidong
2009-08-28 10:23     ` Andrew Lyon
2009-09-16 14:23 ` Stefano Stabellini
2009-09-16 23:50   ` Lin, Ben Y
2009-09-21 17:05     ` Jun Koi
2009-09-22  2:17       ` Lin, Ben Y
2009-09-17  1:10   ` Han, Weidong

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.