The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: x86: use again the flush argument of __link_shadow_page()
Date: Thu, 7 May 2026 12:13:26 -0700	[thread overview]
Message-ID: <afzkVvq6l5VDCfpI@google.com> (raw)
In-Reply-To: <CABgObfYR1NLbzsgoe=agkpjVJ7hs3E_ftrJ5zNnu_xF5moeKLQ@mail.gmail.com>

On Tue, May 05, 2026, Paolo Bonzini wrote:
> On Mon, May 4, 2026 at 8:36 PM Sean Christopherson <seanjc@google.com> wrote:
> > An amendment to that: I thought this was just switching back to the more targeted
> > range-based flushed, I didn't realize you applied the version that hardcoded the
> > @flush param to kvm_mmu_remote_flush_or_zap() with "true".
> 
> Yes, I was hoping to simplify stable backports a bit.  Here is my
> version of your comment (yes, I did try adding batched zapping to
> shadow_mmu_split_huge_page() and failed):
> 
> /*
>  * Note: while normally KVM uses a "bool flush" return value to let
>  * the caller batch flushes, __link_shadow_page() flushes immediately
>  * immediately before populating the parent PTE with the new shadow page.
>  * The typical callers, direct_map() and FNAME(fetch)(), are not going
>  * to zap more than one large SPTE anyway.
>  *
>  * The only exception, where @flush can be false, is when a large SPTE

Can we use "huge" instead of "large"?  KVM has lots of references to both, but
the kernel generally uses "huge", so I've been trying to opportunistically switch
to "huge".

>  * is replaced with a large SPTE with a fully populated page table,

I think you want "a shadow page SPTE" here?

>  * which can happen from shadow_mmu_split_huge_page().  In this case,
>  * no memory is unmapped across the change to the page tables and no
>  * immediate flush is needed for correctness.
>  *
>  * Even in that case, calls to kvm_mmu_commit_zap_page() are not
>  * batched.  Doing so would require adding an invalid_list argument
>  * all the way down to __walk_slot_rmaps().
>  */
> 
> What do you think?

Other than the nit and the goof, LGTM.

      reply	other threads:[~2026-05-07 19:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260503210917.121840-1-pbonzini@redhat.com>
2026-05-04 17:27 ` [PATCH] KVM: x86: use again the flush argument of __link_shadow_page() Sean Christopherson
2026-05-04 18:36   ` Sean Christopherson
2026-05-05 11:52     ` Paolo Bonzini
2026-05-07 19:13       ` 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=afzkVvq6l5VDCfpI@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@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