mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: x86/mmu: Calculate and check "full" mmu_role for nested MMU
Date: Fri, 11 Jun 2021 18:49:25 +0200	[thread overview]
Message-ID: <64d774e4-affa-b96e-5116-66756dc160dd@redhat.com> (raw)
In-Reply-To: <YMOTK7eYytpw58Vc@google.com>

On 11/06/21 18:45, Sean Christopherson wrote:
>> Along which path though?  I would have naively expected those to be driven
>> only by the context->root_level.
> The functional code is driven by context->root_level, but if KVM doesn't include
> the level in the mmu_role then it will fail to update context->root_level when
> L2 changes from 32-bit PAE to 64-bit.  If all the CR0/CR4/EFER bits remain the
> same, only the level will differ.  Without this patch, role.level is always '0'
> for the nested MMU.
> 

Yes the problem is the

         if (new_role.as_u64 == g_context->mmu_role.as_u64)
                 return;

and the patch lets you preserve the optimization instead of dropping it. 
  I was wondering if I was missing something else because of the "when 
walking the guest page tables" remark.

Paolo


      reply	other threads:[~2021-06-11 16:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 22:00 Sean Christopherson
2021-06-11  8:57 ` Vitaly Kuznetsov
2021-06-11 14:22   ` Sean Christopherson
2021-06-11 19:51     ` Sean Christopherson
2021-06-11 16:02 ` Paolo Bonzini
2021-06-11 16:19 ` Paolo Bonzini
2021-06-11 16:45   ` Sean Christopherson
2021-06-11 16:49     ` Paolo Bonzini [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=64d774e4-affa-b96e-5116-66756dc160dd@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seanjc@google.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.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

all inboxes | Powered by JetHome®