All of lore.kernel.org
 help / color / mirror / Atom feed
* paravirtualization structure
@ 2007-02-19 15:17 Omar Khan
       [not found] ` <loom.20070219T155153-393-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Omar Khan @ 2007-02-19 15:17 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

hi,

   I have a couple of kvm/kernel newbie questions:

   1. What is the sequence of events for a paravirtualization hypercall? I
understand how VMX architecture works, but how does the paravirt fit in? When we
make a paravirt sys call we avoid a VMexit, but which address space does the
call go to?  

   2. Is the paravirtualization code included in the 2.6.20 kernel (if so where
is it) or do we still need to apply the patch for it?


  I reply would be greatly appreciated. Thanks in advance.

Omar Khan


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

* Re: paravirtualization structure
       [not found] ` <loom.20070219T155153-393-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
@ 2007-02-19 15:24   ` Avi Kivity
  2007-02-19 20:29     ` Omar Khan
  0 siblings, 1 reply; 7+ messages in thread
From: Avi Kivity @ 2007-02-19 15:24 UTC (permalink / raw)
  To: Omar Khan; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Omar Khan wrote:
> hi,
>
>    I have a couple of kvm/kernel newbie questions:
>
>    1. What is the sequence of events for a paravirtualization hypercall? I
> understand how VMX architecture works, but how does the paravirt fit in? When we
> make a paravirt sys call we avoid a VMexit, but which address space does the
> call go to?  
>   

The hypercall sequence does not avoid a vmexit.  The guest issues a 
vmcall instruction, which is trapped and processed by the host.

>    2. Is the paravirtualization code included in the 2.6.20 kernel (if so where
> is it) or do we still need to apply the patch for it?
>
>
>   

The paravirt code is not present in 2.6.20.  You can download it using 
the instructions in http://kvm.qumranet.com/kvmwiki/Code.



-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

* Re: paravirtualization structure
  2007-02-19 15:24   ` Avi Kivity
@ 2007-02-19 20:29     ` Omar Khan
       [not found]       ` <loom.20070219T211655-267-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Omar Khan @ 2007-02-19 20:29 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Avi Kivity <avi@...> writes:


> The hypercall sequence does not avoid a vmexit.  The guest issues a 
> vmcall instruction, which is trapped and processed by the host.
> 

Thanks for replying Avi. In your response
 (http://article.gmane.org/gmane.linux.kernel/481457) to the announcement of the
 KVM paravirtualization patch you said about the cr3 related hypercall that:

"The gain probably comes not only from avoiding the vmentry/vmexit, but also
from avoiding the flushing of the global page tlb entries."

Is the vmexit caused by the vmcall more efficient/different than the vmexit that
is caused by writing to the cr3 register say. 

Thanks

Omar Khan





-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

* Re: paravirtualization structure
       [not found]       ` <loom.20070219T211655-267-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
@ 2007-02-19 21:18         ` Dor Laor
  2007-02-20  0:47           ` Omar Khan
  0 siblings, 1 reply; 7+ messages in thread
From: Dor Laor @ 2007-02-19 21:18 UTC (permalink / raw)
  To: Omar Khan, kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

>> The hypercall sequence does not avoid a vmexit.  The guest issues a
>> vmcall instruction, which is trapped and processed by the host.
>>
>
>Thanks for replying Avi. In your response
> (http://article.gmane.org/gmane.linux.kernel/481457) to the
announcement
>of the
> KVM paravirtualization patch you said about the cr3 related hypercall
>that:
>
>"The gain probably comes not only from avoiding the vmentry/vmexit, but
>also
>from avoiding the flushing of the global page tlb entries."
>
>Is the vmexit caused by the vmcall more efficient/different than the
vmexit
>that
>is caused by writing to the cr3 register say.

Theoretically speaking the answer is yes, vmcall is a special
instruction that it one and only purpose is the exit from the guest.
While mov cr3 instruction might be bound to other actions of the
processor and might have more effects on the pipeline, this harder to
optimize for vmexit purposes.

>
>Thanks
>
>Omar Khan
>
>
>
>
>
>-----------------------------------------------------------------------
--
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share
>your
>opinions on IT & business topics through brief surveys-and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVD
EV
>_______________________________________________
>kvm-devel mailing list
>kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

* Re: paravirtualization structure
  2007-02-19 21:18         ` Dor Laor
@ 2007-02-20  0:47           ` Omar Khan
       [not found]             ` <loom.20070220T011441-39-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Omar Khan @ 2007-02-20  0:47 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Dor Laor <dor.laor@...> writes:


> 
> Theoretically speaking the answer is yes, vmcall is a special
> instruction that it one and only purpose is the exit from the guest.
> While mov cr3 instruction might be bound to other actions of the
> processor and might have more effects on the pipeline, this harder to
> optimize for vmexit purposes.
> 

I guess what is confusing me is that the vmcall causes an vmexit in VMX non-root
mode (the one in which a paravirtualized guest is operating), but Avi says that
 a hypercal (made using a vmcall) 'avoids' a vmentry/vmexit and Ingo comments in
his patch that :

"This utilizes the cr3 filter capability of the hardware - if this works out
then no VM exit happens"

NO VM-exits happen. hmmmm... maybe I need to go over the intel manuals more
thoroughly, however any hints will be most welcomed. 

Thanks


Omar




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

* Re: paravirtualization structure
       [not found]             ` <loom.20070220T011441-39-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
@ 2007-02-20  7:14               ` Avi Kivity
  2007-02-20  8:18               ` Arjan van de Ven
  1 sibling, 0 replies; 7+ messages in thread
From: Avi Kivity @ 2007-02-20  7:14 UTC (permalink / raw)
  To: Omar Khan; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Omar Khan wrote:
> Dor Laor <dor.laor@...> writes:
>
>
>   
>> Theoretically speaking the answer is yes, vmcall is a special
>> instruction that it one and only purpose is the exit from the guest.
>> While mov cr3 instruction might be bound to other actions of the
>> processor and might have more effects on the pipeline, this harder to
>> optimize for vmexit purposes.
>>
>>     
>
> I guess what is confusing me is that the vmcall causes an vmexit in VMX non-root
> mode (the one in which a paravirtualized guest is operating), but Avi says that
>  a hypercal (made using a vmcall) 'avoids' a vmentry/vmexit and Ingo comments in
> his patch that :
>
> "This utilizes the cr3 filter capability of the hardware - if this works out
> then no VM exit happens"
>
> NO VM-exits happen. hmmmm... maybe I need to go over the intel manuals more
> thoroughly, however any hints will be most welcomed. 
>   

Using the cr3 filter does not involve a hypercall.  Instead, it allows 
the guest to context switch without trapping on the mov %cr3 
instruction, by providing a set of pre-prepared cr3s.


-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

* Re: paravirtualization structure
       [not found]             ` <loom.20070220T011441-39-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
  2007-02-20  7:14               ` Avi Kivity
@ 2007-02-20  8:18               ` Arjan van de Ven
  1 sibling, 0 replies; 7+ messages in thread
From: Arjan van de Ven @ 2007-02-20  8:18 UTC (permalink / raw)
  To: Omar Khan; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f


> 
> "This utilizes the cr3 filter capability of the hardware - if this works out
> then no VM exit happens"
> 
> NO VM-exits happen. hmmmm... maybe I need to go over the intel manuals more
> thoroughly, however any hints will be most welcomed. 

Hi,

I think you're confused a bit ;)

the cr3 filter is not a hypercall interface. It's a optimization in the
hardware that makes it not needed to go to the host (via a vmexit in
some form or another) to do a context switch inside the guest... so
guest context switches will become a lot faster.

In order for this to work, the guest needs to assist the host a bit, and
hence a hypercall interface was needed. Well it's needed anyway going
forward for other things such as the paravirtualized block and
networking drivers...

I hope this clears up some of what you're asking...

Greetings,
   Arjan van de Ven 
-- 
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

end of thread, other threads:[~2007-02-20  8:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-19 15:17 paravirtualization structure Omar Khan
     [not found] ` <loom.20070219T155153-393-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
2007-02-19 15:24   ` Avi Kivity
2007-02-19 20:29     ` Omar Khan
     [not found]       ` <loom.20070219T211655-267-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
2007-02-19 21:18         ` Dor Laor
2007-02-20  0:47           ` Omar Khan
     [not found]             ` <loom.20070220T011441-39-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
2007-02-20  7:14               ` Avi Kivity
2007-02-20  8:18               ` Arjan van de Ven

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.