From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org, Yosry Ahmed <yosry@kernel.org>
Subject: Re: [GIT PULL] KVM (mostly s390) fixes for Linux 7.2-rc7
Date: Fri, 7 Aug 2026 10:06:56 -0700 [thread overview]
Message-ID: <anYQsMnpS2kpYoqA@google.com> (raw)
In-Reply-To: <20260807135327.2629594-1-pbonzini@redhat.com>
+Yosry
On Fri, Aug 07, 2026, Paolo Bonzini wrote:
> - disable use of INVLPGA when NPT is enabled, because it doesn't seem
> to flush TLBs correctly
...
> Paolo Bonzini (3):
> KVM: SVM: make svm_flush_tlb_gva do a full asid flush if NPT enabled
Why did this get rushed in? There was quite a bit of discussion, both on the
code itself[1][2] and on the assessment that this appears to be hardware issue[3].
IMO, neither of those discussions was resolved enough to merge the patch as-is.
I can appreciate wanting to get a fix into stable ASAP, but we could have gone
with a *much* simpler fix for stable@. The bulk of this change is a performance
optimization masquerading as a bug fix, and I'm not convinced it's actually
optimizing anything meaningful, because SVM only queues the TLB flush, and that
is super cheap. E.g. the "we don't know why this is failing, let's smack it with
a hammer" patch could have been:
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 3057ca7051db..58bc4a1cb7a4 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -4237,7 +4237,15 @@ static void svm_flush_tlb_gva(struct kvm_vcpu *vcpu, gva_t gva)
{
struct vcpu_svm *svm = to_svm(vcpu);
- invlpga(gva, svm->vmcb->control.asid);
+ if (!npt_enabled) {
+ invlpga(gva, svm->vmcb->control.asid);
+ return;
+ }
+
+ if (static_cpu_has(X86_FEATURE_FLUSHBYASID))
+ svm->vmcb->control.tlb_ctl = TLB_CONTROL_FLUSH_ASID;
+ else
+ svm->current_vmcb->asid_generation--;
}
static void svm_flush_tlb_guest(struct kvm_vcpu *vcpu)
I don't care _that_ much about the code itself, though I still think the out-param
is all kinds of ugly. What frustrates me most is completely ignoring the processes
that everyone else is trying quite hard to follow. I'm a-ok with getting overruled
on jugdment calls and matters of taste, but I'm not at all ok with doing so silently
and without what I would consider an honest attempt to address review feedback.
[1] https://lore.kernel.org/all/amPo-XdhFGIZquES@google.com
[2] https://lore.kernel.org/all/CAO9r8zM=Mb=eTEFGF0G-POvwwbSr7e8SN6zcDp=GstzKtBKcow@mail.gmail.com
[3] https://lore.kernel.org/all/CAO9r8zMopB=YKXs5pkQmPf9uHKE0P0XORcNbc60AWXTusuY3tg@mail.gmail.com
next prev parent reply other threads:[~2026-08-07 17:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 13:53 [GIT PULL] KVM (mostly s390) fixes for Linux 7.2-rc7 Paolo Bonzini
2026-08-07 15:18 ` pr-tracker-bot
2026-08-07 17:06 ` Sean Christopherson [this message]
2026-08-07 21:41 ` Paolo Bonzini
2026-08-07 22:39 ` Sean Christopherson
2026-08-08 5:43 ` Paolo Bonzini
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=anYQsMnpS2kpYoqA@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=torvalds@linux-foundation.org \
--cc=yosry@kernel.org \
/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