kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	kvm@vger.kernel.org, Joerg Roedel <joerg.roedel@amd.com>
Subject: Re: [PATCH] KVM: MMU: Fix regression with ept memory types merged into non-ept page tables
Date: Mon, 13 Sep 2010 20:01:50 +0200	[thread overview]
Message-ID: <20100913180150.GA3853@8bytes.org> (raw)
In-Reply-To: <1284389779-11214-1-git-send-email-avi@redhat.com>

On Mon, Sep 13, 2010 at 04:56:19PM +0200, Avi Kivity wrote:
> Commit "KVM: MMU: Make tdp_enabled a mmu-context parameter" made real-mode
> set ->direct_map, and changed the code that merges in the memory type depend
> on direct_map instead of tdp_enabled.  However, in this case what really
> matters is tdp, not direct_map, since tdp changes the pte format regardless
> of whether the mapping is direct or not.
> 
> As a result, real-mode shadow mappings got corrupted with ept memory types.
> The result was a huge slowdown, likely due to the cache being disabled.
> 
> Change it back as the simplest fix for the regression (real fix is to move
> all that to vmx code, and not use tdp_enabled as a synonym for ept).
> 
> Signed-off-by: Avi Kivity <avi@redhat.com>
> ---
>  arch/x86/kvm/mmu.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index 6e248d8..3ce56bf 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -1980,7 +1980,7 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *sptep,
>  		spte |= shadow_user_mask;
>  	if (level > PT_PAGE_TABLE_LEVEL)
>  		spte |= PT_PAGE_SIZE_MASK;
> -	if (vcpu->arch.mmu.direct_map)
> +	if (tdp_enabled)
>  		spte |= kvm_x86_ops->get_mt_mask(vcpu, gfn,
>  			kvm_is_mmio_pfn(pfn));

Oh, indeed. Thanks for fixing this.

Acked-by: Joerg Roedel <joerg.roedel@amd.com>


      reply	other threads:[~2010-09-13 18:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-13 14:56 [PATCH] KVM: MMU: Fix regression with ept memory types merged into non-ept page tables Avi Kivity
2010-09-13 18:01 ` Joerg Roedel [this message]

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=20100913180150.GA3853@8bytes.org \
    --to=joro@8bytes.org \
    --cc=avi@redhat.com \
    --cc=joerg.roedel@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).