From: Sean Christopherson <seanjc@google•com>
To: Will Deacon <will@kernel•org>
Cc: kvm@vger•kernel.org, David Hildenbrand <david@redhat•com>,
linux-mips@vger•kernel.org, linux-mm@kvack•org,
Marc Zyngier <maz@kernel•org>,
linux-trace-kernel@vger•kernel.org,
Nicholas Piggin <npiggin@gmail•com>,
Bibo Mao <maobibo@loongson•cn>,
loongarch@lists•linux.dev, Atish Patra <atishp@atishpatra•org>,
kvmarm@lists•linux.dev, linux-arm-kernel@lists•infradead.org,
Thomas Bogendoerfer <tsbogend@alpha•franken.de>,
linux-kernel@vger•kernel.org,
Oliver Upton <oliver.upton@linux•dev>,
linux-perf-users@vger•kernel.org, kvm-riscv@lists•infradead.org,
Anup Patel <anup@brainfault•org>,
Paolo Bonzini <pbonzini@redhat•com>,
Andrew Morton <akpm@linux-foundation•org>,
Tianrui Zhao <zhaotianrui@loongson•cn>,
linuxppc-dev@lists•ozlabs.org
Subject: Re: [PATCH 1/4] KVM: delete .change_pte MMU notifier callback
Date: Fri, 19 Apr 2024 06:58:06 -0700 [thread overview]
Message-ID: <ZiJ4bqrBUPM0E8iq@google.com> (raw)
In-Reply-To: <20240419112432.GB2972@willie-the-truck>
On Fri, Apr 19, 2024, Will Deacon wrote:
> > @@ -663,10 +669,22 @@ static __always_inline kvm_mn_ret_t __kvm_handle_hva_range(struct kvm *kvm,
> > break;
> > }
> > r.ret |= range->handler(kvm, &gfn_range);
> > +
> > + /*
> > + * Use a precise gfn-based TLB flush when possible, as
> > + * most mmu_notifier events affect a small-ish range.
> > + * Fall back to a full TLB flush if the gfn-based flush
> > + * fails, and don't bother trying the gfn-based flush
> > + * if a full flush is already pending.
> > + */
> > + if (range->flush_on_ret && !need_flush && r.ret &&
> > + kvm_arch_flush_remote_tlbs_range(kvm, gfn_range.start,
> > + gfn_range.end - gfn_range.start + 1))
>
> What's that '+ 1' needed for here?
(a) To see if you're paying attention.
(b) Because more is always better.
(c) Because math is hard.
(d) Because I haven't tested this.
(e) Both (c) and (d).
next prev parent reply other threads:[~2024-04-19 13:58 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 11:58 [PATCH 0/4] KVM, mm: remove the .change_pte() MMU notifier and set_pte_at_notify() Paolo Bonzini
2024-04-05 11:58 ` [PATCH 1/4] KVM: delete .change_pte MMU notifier callback Paolo Bonzini
2024-04-07 4:50 ` Anup Patel
2024-04-08 7:23 ` maobibo
2024-04-08 11:45 ` Michael Ellerman
2024-04-08 13:56 ` Peter Xu
2024-04-11 16:55 ` Paolo Bonzini
2024-04-11 18:47 ` Peter Xu
2024-04-12 20:01 ` David Hildenbrand
2024-04-12 10:44 ` Will Deacon
2024-04-12 13:15 ` Marc Zyngier
2024-04-12 14:54 ` Sean Christopherson
2024-04-13 9:56 ` Marc Zyngier
2024-04-15 17:03 ` Sean Christopherson
2024-04-18 14:19 ` Will Deacon
2024-04-18 19:53 ` Sean Christopherson
2024-04-19 11:24 ` Will Deacon
2024-04-19 13:58 ` Sean Christopherson [this message]
2024-06-12 15:22 ` Sean Christopherson
2024-06-12 17:31 ` Sean Christopherson
2024-04-05 11:58 ` [PATCH 2/4] KVM: remove unused argument of kvm_handle_hva_range() Paolo Bonzini
2024-04-08 6:31 ` Philippe Mathieu-Daudé
2024-04-05 11:58 ` [PATCH 3/4] mmu_notifier: remove the .change_pte() callback Paolo Bonzini
2024-04-08 7:35 ` David Hildenbrand
2024-04-05 11:58 ` [PATCH 4/4] mm: replace set_pte_at_notify() with just set_pte_at() Paolo Bonzini
2024-04-08 6:28 ` Philippe Mathieu-Daudé
2024-04-08 7:36 ` David Hildenbrand
2024-04-10 21:30 ` [PATCH 0/4] KVM, mm: remove the .change_pte() MMU notifier and set_pte_at_notify() Andrew Morton
2024-04-11 16:57 ` Paolo Bonzini
2024-04-12 13:07 ` Marc Zyngier
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=ZiJ4bqrBUPM0E8iq@google.com \
--to=seanjc@google$(echo .)com \
--cc=akpm@linux-foundation$(echo .)org \
--cc=anup@brainfault$(echo .)org \
--cc=atishp@atishpatra$(echo .)org \
--cc=david@redhat$(echo .)com \
--cc=kvm-riscv@lists$(echo .)infradead.org \
--cc=kvm@vger$(echo .)kernel.org \
--cc=kvmarm@lists$(echo .)linux.dev \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-mips@vger$(echo .)kernel.org \
--cc=linux-mm@kvack$(echo .)org \
--cc=linux-perf-users@vger$(echo .)kernel.org \
--cc=linux-trace-kernel@vger$(echo .)kernel.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=loongarch@lists$(echo .)linux.dev \
--cc=maobibo@loongson$(echo .)cn \
--cc=maz@kernel$(echo .)org \
--cc=npiggin@gmail$(echo .)com \
--cc=oliver.upton@linux$(echo .)dev \
--cc=pbonzini@redhat$(echo .)com \
--cc=tsbogend@alpha$(echo .)franken.de \
--cc=will@kernel$(echo .)org \
--cc=zhaotianrui@loongson$(echo .)cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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