From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Anthony Liguori
<aliguori-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: Paravirt KVM capabilities
Date: Wed, 10 Jan 2007 19:23:17 +0200 [thread overview]
Message-ID: <45A52105.5090208@qumranet.com> (raw)
In-Reply-To: <45A51BA2.9090005-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Anthony Liguori wrote:
> Avi Kivity wrote:
>> Ingo Molnar wrote:
>>
>>> * Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
>>>
>>>
>>>
>>>> If you have a CONFIG_PARAVIRT guest, I believe it will always be
>>>> faster to run it without hardware assisted virtualization:
>>>>
>>>> - you cannot eliminate vmexits due to host interrupts
>>>> - a hypercall will (probably) keep being more expensive than a
>>>> syscall;
>>>> it simply has a lot more work to do
>>>> - cr3 switches for CONFIG_PARAVIRT syscalls (which are necessary on
>>>> x86_64) will probably become very cheap with tagged tlbs
>>>>
>>>>
>>> but irq overhead is nothing in importance compared to basic syscall
>>> overhead. KVM/HVM already runs guest kernel syscalls at native speed.
>>> KVM/LL (or Xen) has to switch cr3s to enter guest kernel context, and
>>> has to switch it back to get back to guest user context. It might be
>>> pretty fast with tagged TLBs, but not zero-cost.
>>>
>>>
>>
>> For i386 Xen does not switch cr3 IIRC. Perhaps even not for x86_64 if
>> it can use the segment limits which AMD re-added (I think it does?)
>>
>
> Xen setups the IDT to deliver directly to ring 1 for syscalls as you
> suggested.
>
> At the moment, Xen doesn't make use of the segment limits on AMD on
> 64bit. Currently, the guest kernel runs in ring 3 and I presume there
> are a good deal of assumptions about that.
>
> Xen does, however, use global pages for the kernel (and it's) memory
> so that should help a bit.
That means it needs to flush the Xen tlb entries on domain switch. I
guess that's a good tradeoff since guest context switches are more
common than domain switches.
>
> One thing to consider though is how things like hardware nested paging
> and CR3 caching come into play. On a context switch, a Xen style
> paravirt has to use hypercalls to change CR3 (since it's privileged)
> whereas on VT, there's at least the chance of hitting the cache before
> taking a VMEXIT.
>
> Also, nested paging should considerably change the performance
> characteristics of a FV guest. While TLB lookups will end up being
> more expensive (since more memory accesses are required), the overall
> cost of page fault handling will go down significantly. Recall, even
> in direct paged mode, Xen has to take page faults in the hypervisor
> first. With nested paging, presumably page faults can be delivered
> directly to the guest[1].
I agree that nested page tables changes things dramatically wrt.
paging. My comments apply only to non-nested paging.
>
> [1] This assumes that the implementation will allow for physical
> memory holes which will result in VMEXITs (for MMIO emulation).
The assumption is correct according to my reading of the docs. NPT can
deliver a #PF or a #VMEXIT(NPF), with the expected semantics.
--
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
next prev parent reply other threads:[~2007-01-10 17:23 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-09 14:19 Paravirt KVM capabilities Hugo Mills
[not found] ` <20070109141916.GA13276-qdzjUQGjHNdnxAzMjxVBUbVCufUGDwFn@public.gmane.org>
2007-01-09 14:27 ` Avi Kivity
[not found] ` <45A3A642.1030604-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-09 23:20 ` Rusty Russell
[not found] ` <1168384852.19646.161.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-01-10 9:47 ` Ingo Molnar
[not found] ` <20070110094750.GA934-X9Un+BFzKDI@public.gmane.org>
2007-01-10 10:09 ` Ulrich Drepper
[not found] ` <45A4BB74.9010102-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2007-01-10 10:18 ` Ingo Molnar
[not found] ` <20070110101839.GA6444-X9Un+BFzKDI@public.gmane.org>
2007-01-10 10:43 ` Avi Kivity
[not found] ` <45A4C345.5050404-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-10 10:52 ` Ingo Molnar
[not found] ` <20070110105202.GA13412-X9Un+BFzKDI@public.gmane.org>
2007-01-10 11:03 ` Avi Kivity
[not found] ` <45A4C7ED.8090003-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-10 11:14 ` Ingo Molnar
[not found] ` <20070110111442.GA16867-X9Un+BFzKDI@public.gmane.org>
2007-01-10 11:42 ` Avi Kivity
2007-01-10 18:00 ` Ulrich Drepper
[not found] ` <45A529DB.4030009-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2007-01-10 18:12 ` Avi Kivity
[not found] ` <45A52C8B.70608-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-10 18:27 ` Ulrich Drepper
[not found] ` <45A53005.30300-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2007-01-10 18:35 ` Avi Kivity
2007-01-10 17:00 ` Anthony Liguori
[not found] ` <45A51BA2.9090005-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2007-01-10 17:23 ` Avi Kivity [this message]
2007-01-11 0:42 ` Rusty Russell
[not found] ` <1168476120.19646.209.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-01-11 0:49 ` Ingo Molnar
[not found] ` <20070111004957.GA3279-X9Un+BFzKDI@public.gmane.org>
2007-01-11 2:39 ` Rusty Russell
[not found] ` <1168483188.19646.241.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-01-11 2:51 ` Ingo Molnar
[not found] ` <20070111025130.GB21368-X9Un+BFzKDI@public.gmane.org>
2007-01-11 3:21 ` Rusty Russell
[not found] ` <1168485696.19646.250.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-01-11 9:38 ` Ingo Molnar
2007-01-10 10:46 ` Rusty Russell
[not found] ` <1168425985.19646.205.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-01-10 11:00 ` sean-cz32UWRuVxBIf6P1QZMOBw
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45A52105.5090208@qumranet.com \
--to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
--cc=aliguori-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox