From: Sean Christopherson <seanjc@google.com>
To: David Matlack <dmatlack@google.com>
Cc: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
Ben Gardon <bgardon@google.com>
Subject: Re: [PATCH] KVM: x86/mmu: Remove stale comment mentioning skip_4k
Date: Wed, 26 May 2021 15:12:20 +0000 [thread overview]
Message-ID: <YK5lVHARaeNfCJ5L@google.com> (raw)
In-Reply-To: <20210525223447.2724663-1-dmatlack@google.com>
On Tue, May 25, 2021, David Matlack wrote:
> This comment was left over from a previous version of the patch that
> introduced wrprot_gfn_range, when skip_4k was passed in instead of
> min_level.
>
> Remove the comment (instead of fixing it) since wrprot_gfn_range has
> only one caller and min_level is documented there.
That would be ok-ish if there were no comment whatsoever, but the function comment
is now flat out wrong, which is bad.
> Signed-off-by: David Matlack <dmatlack@google.com>
> ---
> arch/x86/kvm/mmu/tdp_mmu.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
> index 95eeb5ac6a8a..97f273912764 100644
> --- a/arch/x86/kvm/mmu/tdp_mmu.c
> +++ b/arch/x86/kvm/mmu/tdp_mmu.c
> @@ -1192,8 +1192,7 @@ bool kvm_tdp_mmu_set_spte_gfn(struct kvm *kvm, struct kvm_gfn_range *range)
> }
>
> /*
> - * Remove write access from all the SPTEs mapping GFNs [start, end). If
> - * skip_4k is set, SPTEs that map 4k pages, will not be write-protected.
> + * Remove write access from all the SPTEs mapping GFNs [start, end).
If the goal is to avoid churn on the last sentence, what about:
* Write protect SPTEs mapping GFNs [start, end) at or above min_level.
> * Returns true if an SPTE has been changed and the TLBs need to be flushed.
> */
> static bool wrprot_gfn_range(struct kvm *kvm, struct kvm_mmu_page *root,
> --
> 2.32.0.rc0.204.g9fa02ecfa5-goog
>
next prev parent reply other threads:[~2021-05-26 15:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-25 22:34 [PATCH] KVM: x86/mmu: Remove stale comment mentioning skip_4k David Matlack
2021-05-26 15:12 ` Sean Christopherson [this message]
2021-05-26 16:23 ` David Matlack
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=YK5lVHARaeNfCJ5L@google.com \
--to=seanjc@google.com \
--cc=bgardon@google.com \
--cc=dmatlack@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