public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: David Matlack <dmatlack@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, Ben Gardon <bgardon@google.com>,
	Junaid Shahid <junaids@google.com>
Subject: Re: [PATCH v2] KVM: x86/mmu: Rename slot_handle_leaf to slot_handle_level_4k
Date: Thu, 21 Oct 2021 16:53:52 +0000	[thread overview]
Message-ID: <YXGbIHAJSPgYh34g@google.com> (raw)
In-Reply-To: <20211019162223.3935109-1-dmatlack@google.com>

On Tue, Oct 19, 2021, David Matlack wrote:
> slot_handle_leaf is a misnomer because it only operates on 4K SPTEs
> whereas "leaf" is used to describe any valid terminal SPTE (4K or
> large page). Rename slot_handle_leaf to slot_handle_level_4k to
> avoid confusion.
> 
> Making this change makes it more obvious there is a benign discrepency
> between the legacy MMU and the TDP MMU when it comes to dirty logging.
> The legacy MMU only iterates through 4K SPTEs when zapping for
> collapsing and when clearing D-bits. The TDP MMU, on the other hand,
> iterates through SPTEs on all levels.
> 
> The TDP MMU behavior of zapping SPTEs at all levels is technically
> overkill for its current dirty logging implementation, which always
> demotes to 4k SPTES, but both the TDP MMU and legacy MMU zap if and only
> if the SPTE can be replaced by a larger page, i.e. will not spuriously
> zap 2m (or larger) SPTEs. Opportunistically add comments to explain this
> discrepency in the code.
> 
> Signed-off-by: David Matlack <dmatlack@google.com>
> ---

Reviewed-by: Sean Christopherson <seanjc@google.com>

      parent reply	other threads:[~2021-10-21 16:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 16:22 [PATCH v2] KVM: x86/mmu: Rename slot_handle_leaf to slot_handle_level_4k David Matlack
2021-10-19 23:38 ` Ben Gardon
2021-10-21 16:53 ` Sean Christopherson [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=YXGbIHAJSPgYh34g@google.com \
    --to=seanjc@google.com \
    --cc=bgardon@google.com \
    --cc=dmatlack@google.com \
    --cc=junaids@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@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