public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* VGA pass-through
@ 2009-06-29 18:19 Subash Kalbarga
  2009-06-30  6:16 ` Han, Weidong
  0 siblings, 1 reply; 12+ messages in thread
From: Subash Kalbarga @ 2009-06-29 18:19 UTC (permalink / raw)
  To: kvm

Hi

I am using kvm-86 on 2.6.28 and I am able to pass through most of my PCI devices successfully. However, I do not see even the KVM BIOS output if I pass through my VGA adapter. 
I am doing -vga none, -nographic and -pcidevice host=xx:yy.z 


Should I expect to see the kvm BIOS output?  Is VGA pass-through something that is expected to work?

Thanks in advance.

Subash



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

* RE: VGA pass-through
  2009-06-29 18:19 VGA pass-through Subash Kalbarga
@ 2009-06-30  6:16 ` Han, Weidong
  2009-06-30  6:51   ` Avi Kivity
  0 siblings, 1 reply; 12+ messages in thread
From: Han, Weidong @ 2009-06-30  6:16 UTC (permalink / raw)
  To: 'Subash Kalbarga', 'kvm@vger.kernel.org'

Subash Kalbarga wrote:
> Hi
> 
> I am using kvm-86 on 2.6.28 and I am able to pass through most of my
> PCI devices successfully. However, I do not see even the KVM BIOS
> output if I pass through my VGA adapter. I am doing -vga none,
> -nographic and -pcidevice host=xx:yy.z  
> 
> 
> Should I expect to see the kvm BIOS output?  Is VGA pass-through
> something that is expected to work? 

Currently VGA pass-through is not supported in KVM. It needs much work to support it.

Regards,
Weidong

> 
> Thanks in advance.
> 
> Subash


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

* Re: VGA pass-through
  2009-06-30  6:16 ` Han, Weidong
@ 2009-06-30  6:51   ` Avi Kivity
  2009-06-30  7:46     ` Han, Weidong
  0 siblings, 1 reply; 12+ messages in thread
From: Avi Kivity @ 2009-06-30  6:51 UTC (permalink / raw)
  To: Han, Weidong; +Cc: 'Subash Kalbarga', 'kvm@vger.kernel.org'

On 06/30/2009 09:16 AM, Han, Weidong wrote:
> Subash Kalbarga wrote:
>    
>> Hi
>>
>> I am using kvm-86 on 2.6.28 and I am able to pass through most of my
>> PCI devices successfully. However, I do not see even the KVM BIOS
>> output if I pass through my VGA adapter. I am doing -vga none,
>> -nographic and -pcidevice host=xx:yy.z
>>
>>
>> Should I expect to see the kvm BIOS output?  Is VGA pass-through
>> something that is expected to work?
>>      
>
> Currently VGA pass-through is not supported in KVM. It needs much work to support it.
>
>    

What does it need?

Here's what I know of:

- load the vga bios at 0xc0000
- implement whatever main bios interfaces the vga vios expects
- pass through the vga I/O ports

Anything else?

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.


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

* RE: VGA pass-through
  2009-06-30  6:51   ` Avi Kivity
@ 2009-06-30  7:46     ` Han, Weidong
  2009-06-30  8:56       ` Michael Tokarev
  2009-08-18 23:27       ` nathan binkert
  0 siblings, 2 replies; 12+ messages in thread
From: Han, Weidong @ 2009-06-30  7:46 UTC (permalink / raw)
  To: 'Avi Kivity'
  Cc: 'Subash Kalbarga', 'kvm@vger.kernel.org'

Avi Kivity wrote:
> On 06/30/2009 09:16 AM, Han, Weidong wrote:
>> Subash Kalbarga wrote:
>> 
>>> Hi
>>> 
>>> I am using kvm-86 on 2.6.28 and I am able to pass through most of my
>>> PCI devices successfully. However, I do not see even the KVM BIOS
>>> output if I pass through my VGA adapter. I am doing -vga none,
>>> -nographic and -pcidevice host=xx:yy.z
>>> 
>>> 
>>> Should I expect to see the kvm BIOS output?  Is VGA pass-through
>>> something that is expected to work?
>>> 
>> 
>> Currently VGA pass-through is not supported in KVM. It needs much
>> work to support it. 
>> 
>> 
> 
> What does it need?
> 
> Here's what I know of:
> 
> - load the vga bios at 0xc0000
> - implement whatever main bios interfaces the vga vios expects
> - pass through the vga I/O ports
> 
> Anything else?

I think it also needs:
  - map video RAM: 0xa0000 - 0xbffff
  - remove Qemu VGA device emulation
  - reserve enough guest memory space for PCI BARs (most graphics cards has more than 256M memory, I didn't check how much guest memory kvm reserve for PCI BARs) 
  
In addition, some graphics cards are specific, such as pBAR must equal to vBAR. To my feeling, there are some tricks to make it work.

Regards,
Weidong

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

* Re: VGA pass-through
  2009-06-30  7:46     ` Han, Weidong
@ 2009-06-30  8:56       ` Michael Tokarev
  2009-06-30  9:37         ` Han, Weidong
  2009-08-18 23:27       ` nathan binkert
  1 sibling, 1 reply; 12+ messages in thread
From: Michael Tokarev @ 2009-06-30  8:56 UTC (permalink / raw)
  To: Han, Weidong
  Cc: 'Avi Kivity', 'Subash Kalbarga',
	'kvm@vger.kernel.org'

Han, Weidong wrote:
[]
>>> Currently VGA pass-through is not supported in KVM. It needs much
>>> work to support it. 
>>>
>> What does it need?
>>
>> Here's what I know of:
>>
>> - load the vga bios at 0xc0000
>> - implement whatever main bios interfaces the vga vios expects
>> - pass through the vga I/O ports
>>
>> Anything else?
> 
> I think it also needs:
>   - map video RAM: 0xa0000 - 0xbffff
>   - remove Qemu VGA device emulation
>   - reserve enough guest memory space for PCI BARs (most graphics cards has more than 256M memory, I didn't check how much guest memory kvm reserve for PCI BARs) 
>   
> In addition, some graphics cards are specific, such as pBAR must equal to vBAR. To my feeling, there are some tricks to make it work.

That all seems to be necessary for "console" support, i.e., so that
the guest bios etc will know this device as "primary display" or
whatever it is called.

But how about using it as a "secondary" video card?  Like, I can
plug another add-on vga card into a free PCI slot and tell X to
use that one instead of "default" card.  Can kvm work like this?

Thanks.

/mjt

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

* RE: VGA pass-through
  2009-06-30  8:56       ` Michael Tokarev
@ 2009-06-30  9:37         ` Han, Weidong
  2009-06-30 12:11           ` Michael Tokarev
  0 siblings, 1 reply; 12+ messages in thread
From: Han, Weidong @ 2009-06-30  9:37 UTC (permalink / raw)
  To: 'Michael Tokarev'
  Cc: 'Avi Kivity', 'Subash Kalbarga',
	'kvm@vger.kernel.org'

Michael Tokarev wrote:
> Han, Weidong wrote:
> []
>>>> Currently VGA pass-through is not supported in KVM. It needs much
>>>> work to support it. 
>>>> 
>>> What does it need?
>>> 
>>> Here's what I know of:
>>> 
>>> - load the vga bios at 0xc0000
>>> - implement whatever main bios interfaces the vga vios expects
>>> - pass through the vga I/O ports
>>> 
>>> Anything else?
>> 
>> I think it also needs:
>>   - map video RAM: 0xa0000 - 0xbffff
>>   - remove Qemu VGA device emulation
>>   - reserve enough guest memory space for PCI BARs (most graphics
>> cards has more than 256M memory, I didn't check how much guest
>> memory kvm reserve for PCI BARs)  
>> 
>> In addition, some graphics cards are specific, such as pBAR must
>> equal to vBAR. To my feeling, there are some tricks to make it work. 
> 
> That all seems to be necessary for "console" support, i.e., so that
> the guest bios etc will know this device as "primary display" or
> whatever it is called.
> 
> But how about using it as a "secondary" video card?  Like, I can
> plug another add-on vga card into a free PCI slot and tell X to
> use that one instead of "default" card.  Can kvm work like this?

"secondary" means secondary video card in host, and will be "primary" in guest, right? As long as it's primary in guest, I think you still need most of above changes. 

Regards,
Weidong

> 
> Thanks.
> 
> /mjt


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

* Re: VGA pass-through
  2009-06-30  9:37         ` Han, Weidong
@ 2009-06-30 12:11           ` Michael Tokarev
  2009-06-30 12:37             ` Han, Weidong
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Tokarev @ 2009-06-30 12:11 UTC (permalink / raw)
  To: Han, Weidong
  Cc: 'Avi Kivity', 'Subash Kalbarga',
	'kvm@vger.kernel.org'

Han, Weidong wrote:
> Michael Tokarev wrote:
[]
>> But how about using it as a "secondary" video card?  Like, I can
>> plug another add-on vga card into a free PCI slot and tell X to
>> use that one instead of "default" card.  Can kvm work like this?
> 
> "secondary" means secondary video card in host, and will be "primary" in guest, right? As long as it's primary in guest, I think you still need most of above changes. 

No, I mean "secondary" on guest - no matter if it's secondary or
primary on host.  So that we'll have qemu-emulated VGA as primary
and a hardware-based secondary on *guest*.

How much useful it is - it's another question.  For instance, I've
no idea how windows guest will be able to use such "secondary" vga
card on guest.

/mjt

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

* RE: VGA pass-through
  2009-06-30 12:11           ` Michael Tokarev
@ 2009-06-30 12:37             ` Han, Weidong
  2009-06-30 13:33               ` Michael Tokarev
  0 siblings, 1 reply; 12+ messages in thread
From: Han, Weidong @ 2009-06-30 12:37 UTC (permalink / raw)
  To: 'Michael Tokarev'
  Cc: 'Avi Kivity', 'Subash Kalbarga',
	'kvm@vger.kernel.org'

Michael Tokarev wrote:
> Han, Weidong wrote:
>> Michael Tokarev wrote:
> []
>>> But how about using it as a "secondary" video card?  Like, I can
>>> plug another add-on vga card into a free PCI slot and tell X to
>>> use that one instead of "default" card.  Can kvm work like this?
>> 
>> "secondary" means secondary video card in host, and will be
>> "primary" in guest, right? As long as it's primary in guest, I think
>> you still need most of above changes.  
> 
> No, I mean "secondary" on guest - no matter if it's secondary or
> primary on host.  So that we'll have qemu-emulated VGA as primary
> and a hardware-based secondary on *guest*.
> 

Oh, for "secondary" in guest, it may needn't above changes. You can try it without any change.

> How much useful it is - it's another question.  For instance, I've
> no idea how windows guest will be able to use such "secondary" vga
> card on guest.
> 

I don't know. Is there any interesting usage of this secondary VGA in guest?

Regards,
Weidong

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

* Re: VGA pass-through
  2009-06-30 12:37             ` Han, Weidong
@ 2009-06-30 13:33               ` Michael Tokarev
  2009-06-30 14:01                 ` Subash Kalbarga
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Tokarev @ 2009-06-30 13:33 UTC (permalink / raw)
  To: Han, Weidong
  Cc: 'Avi Kivity', 'Subash Kalbarga',
	'kvm@vger.kernel.org'

Han, Weidong wrote:
> Michael Tokarev wrote:
>> Han, Weidong wrote:
>>> Michael Tokarev wrote:
>> []
>>>> But how about using it as a "secondary" video card?  Like, I can
>>>> plug another add-on vga card into a free PCI slot and tell X to
>>>> use that one instead of "default" card.  Can kvm work like this?
>>> "secondary" means secondary video card in host, and will be
>>> "primary" in guest, right? As long as it's primary in guest, I think
>>> you still need most of above changes.  
>> No, I mean "secondary" on guest - no matter if it's secondary or
>> primary on host.  So that we'll have qemu-emulated VGA as primary
>> and a hardware-based secondary on *guest*.
> 
> Oh, for "secondary" in guest, it may needn't above changes. You can try it without any change.

I can't: ENOHARDWARE.

>> How much useful it is - it's another question.  For instance, I've
>> no idea how windows guest will be able to use such "secondary" vga
>> card on guest.
> 
> I don't know. Is there any interesting usage of this secondary VGA in guest?

I *guess* windows can be told to use non-primary display.  But I've no
idea how.

Also, it certainly supports multi-display configuration somehow.  Running
most stuff on "secondary" should be possible.

/mjt

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

* RE: VGA pass-through
  2009-06-30 13:33               ` Michael Tokarev
@ 2009-06-30 14:01                 ` Subash Kalbarga
  0 siblings, 0 replies; 12+ messages in thread
From: Subash Kalbarga @ 2009-06-30 14:01 UTC (permalink / raw)
  To: Michael Tokarev, Han, Weidong; +Cc: Avi Kivity, kvm

Thanks for all the replies.


I do have the extra hardware, but I am right now not able to put both
together on the guest (i.e. I have to use -vga none while passing
through the nvidia card that I have) because the VGA I am trying to pass
through has an option rom and hw/device-assignment.c complains about not
having enough option ROM space if both VGAs are included.

I should be able to try something out after some fussing in this
particular area


Thanks
Subash

-----Original Message-----
From: Michael Tokarev [mailto:mjt@tls.msk.ru] 
Sent: Tuesday, June 30, 2009 9:34 AM
To: Han, Weidong
Cc: 'Avi Kivity'; Subash Kalbarga; 'kvm@vger.kernel.org'
Subject: Re: VGA pass-through

Han, Weidong wrote:
> Michael Tokarev wrote:
>> Han, Weidong wrote:
>>> Michael Tokarev wrote:
>> []
>>>> But how about using it as a "secondary" video card?  Like, I can 
>>>> plug another add-on vga card into a free PCI slot and tell X to use

>>>> that one instead of "default" card.  Can kvm work like this?
>>> "secondary" means secondary video card in host, and will be 
>>> "primary" in guest, right? As long as it's primary in guest, I think

>>> you still need most of above changes.
>> No, I mean "secondary" on guest - no matter if it's secondary or 
>> primary on host.  So that we'll have qemu-emulated VGA as primary and

>> a hardware-based secondary on *guest*.
> 
> Oh, for "secondary" in guest, it may needn't above changes. You can
try it without any change.

I can't: ENOHARDWARE.

>> How much useful it is - it's another question.  For instance, I've no

>> idea how windows guest will be able to use such "secondary" vga card 
>> on guest.
> 
> I don't know. Is there any interesting usage of this secondary VGA in
guest?

I *guess* windows can be told to use non-primary display.  But I've no
idea how.

Also, it certainly supports multi-display configuration somehow.
Running most stuff on "secondary" should be possible.

/mjt

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

* Re: VGA pass-through
  2009-06-30  7:46     ` Han, Weidong
  2009-06-30  8:56       ` Michael Tokarev
@ 2009-08-18 23:27       ` nathan binkert
  2009-08-19  3:18         ` Han, Weidong
  1 sibling, 1 reply; 12+ messages in thread
From: nathan binkert @ 2009-08-18 23:27 UTC (permalink / raw)
  To: KVM List

>>> Currently VGA pass-through is not supported in KVM. It needs much
>>> work to support it.
>>
>> Here's what I know of:
>>
>> - load the vga bios at 0xc0000
>> - implement whatever main bios interfaces the vga vios expects
>> - pass through the vga I/O ports
>>
> I think it also needs:
>  - map video RAM: 0xa0000 - 0xbffff
>  - remove Qemu VGA device emulation
>  - reserve enough guest memory space for PCI BARs (most
> graphics cards has more than 256M memory, I didn't check
> how much guest memory kvm reserve for PCI BARs)
>
> In addition, some graphics cards are specific, such as pBAR
> must equal to vBAR. To my feeling, there are some tricks to
> make it work.

Hi All,

Out of curiosity, has any progress been made on this?  I tried to set
this up myself several months ago (KVM-84) with no luck as primary or
secondary.  No matter what I did, if I passed through a video card,
kvm wouldn't even enter the bios.  Presumably because of vga bios
issues.  I even hacked the nvidia driver on my host system to make
certain that the host didn't touch the card at all.

Thanks,

  Nate

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

* RE: VGA pass-through
  2009-08-18 23:27       ` nathan binkert
@ 2009-08-19  3:18         ` Han, Weidong
  0 siblings, 0 replies; 12+ messages in thread
From: Han, Weidong @ 2009-08-19  3:18 UTC (permalink / raw)
  To: 'nathan binkert', 'KVM List'

nathan binkert wrote:
>>>> Currently VGA pass-through is not supported in KVM. It needs much
>>>> work to support it.
>>> 
>>> Here's what I know of:
>>> 
>>> - load the vga bios at 0xc0000
>>> - implement whatever main bios interfaces the vga vios expects
>>> - pass through the vga I/O ports
>>> 
>> I think it also needs:
>>  - map video RAM: 0xa0000 - 0xbffff
>>  - remove Qemu VGA device emulation
>>  - reserve enough guest memory space for PCI BARs (most
>> graphics cards has more than 256M memory, I didn't check
>> how much guest memory kvm reserve for PCI BARs)
>> 
>> In addition, some graphics cards are specific, such as pBAR
>> must equal to vBAR. To my feeling, there are some tricks to
>> make it work.
> 
> Hi All,
> 
> Out of curiosity, has any progress been made on this?  I tried to set
> this up myself several months ago (KVM-84) with no luck as primary or
> secondary.  No matter what I did, if I passed through a video card,
> kvm wouldn't even enter the bios.  Presumably because of vga bios
> issues.  I even hacked the nvidia driver on my host system to make
> certain that the host didn't touch the card at all.
> 

If you didn't do above changes, obviously it won't work directly.

We are working on VGA passthrough on Xen side now. KVM should be similiar. Basically we can reuse most of the code. We will post the code when we port it to KVM.

Regards,
Weidong


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

end of thread, other threads:[~2009-08-19  3:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-29 18:19 VGA pass-through Subash Kalbarga
2009-06-30  6:16 ` Han, Weidong
2009-06-30  6:51   ` Avi Kivity
2009-06-30  7:46     ` Han, Weidong
2009-06-30  8:56       ` Michael Tokarev
2009-06-30  9:37         ` Han, Weidong
2009-06-30 12:11           ` Michael Tokarev
2009-06-30 12:37             ` Han, Weidong
2009-06-30 13:33               ` Michael Tokarev
2009-06-30 14:01                 ` Subash Kalbarga
2009-08-18 23:27       ` nathan binkert
2009-08-19  3:18         ` Han, Weidong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox