From: Avi Kivity <avi@redhat.com>
To: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] kvm mmu: optimizations when tdp is in use
Date: Thu, 27 May 2010 11:33:40 +0300 [thread overview]
Message-ID: <4BFE2E64.1070303@redhat.com> (raw)
In-Reply-To: <4BFE280A.3090607@cn.fujitsu.com>
On 05/27/2010 11:06 AM, Gui Jianfeng wrote:
> In case of using tdp, checking write protected page isn't needed and
> quadrant also no need to be calculated.
>
> Signed-off-by: Gui Jianfeng<guijianfeng@cn.fujitsu.com>
> ---
> arch/x86/kvm/mmu.c | 7 +++++--
> 1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index 0bb9f17..ce4bbd3 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -495,10 +495,13 @@ static int mapping_level(struct kvm_vcpu *vcpu, gfn_t large_gfn)
> max_level = kvm_x86_ops->get_lpage_level()< host_level ?
> kvm_x86_ops->get_lpage_level() : host_level;
>
> + if (tdp_enabled)
> + goto done;
> +
> for (level = PT_DIRECTORY_LEVEL; level<= max_level; ++level)
> if (has_wrprotected_page(vcpu->kvm, large_gfn, level))
> break;
> -
> +done:
> return level - 1;
> }
>
>
We also use ->write_count to prevent mapping the end of a
non-large-page-aligned memslot with a large spte.
Undocumented in mmu.txt, I'll post a patch.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2010-05-27 8:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-27 8:06 [PATCH] kvm mmu: optimizations when tdp is in use Gui Jianfeng
2010-05-27 8:33 ` Avi Kivity [this message]
2010-05-27 12:40 ` Marcelo Tosatti
2010-05-28 0:24 ` Gui Jianfeng
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=4BFE2E64.1070303@redhat.com \
--to=avi@redhat.com \
--cc=guijianfeng@cn.fujitsu.com \
--cc=kvm@vger.kernel.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 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.