From: Sean Christopherson <seanjc@google.com>
To: Yosry Ahmed <yosry@kernel.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
pbonzini@redhat.com, venkateshs@chromium.org,
venkateshs@google.com
Subject: Re: [PATCH v2 3/3] KVM: SVM: Advertise Translation Cache Extensions to userspace
Date: Mon, 9 Mar 2026 08:06:07 -0700 [thread overview]
Message-ID: <aa7h39_Vp6P5TVA7@google.com> (raw)
In-Reply-To: <CAO9r8zOM0OWaFvAQd6FGkCC6WxkVBbQZa10pFm9b-wF1G1A6ew@mail.gmail.com>
On Mon, Mar 09, 2026, Yosry Ahmed wrote:
> On Fri, Mar 6, 2026 at 5:54 PM Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> >
> > > From: Venkatesh Srinivas <venkateshs@chromium.org>
> > >
> > > TCE augments the behavior of TLB invalidating instructions (INVLPG,
> > > INVLPGB, and INVPCID) to only invalidate translations for relevant
> > > intermediate mappings to the address range, rather than ALL intermdiate
> > > translations.
> > >
> > > The Linux kernel has been setting EFER.TCE if supported by the CPU since
> > > commit 440a65b7d25f ("x86/mm: Enable AMD translation cache extensions"),
> > > as it may improve performance.
> > >
> > > KVM does not need to do anything to virtualize the feature, only
> > > advertise it and allow setting EFER.TCE. If a TLB invalidating
> > > instruction is not intercepted, it will behave according to the guest's
> > > setting of EFER.TCE as the value will be loaded on VM-Enter. Otherwise,
> > > KVM's emulation may invalidate more TLB entries, which is perfectly fine
> > > as the CPU is allowed to invalidate more TLB entries that it strictly
> > > needs to.
> > >
> > > Advertise X86_FEATURE_TCE to userspace, and allow the guest to set
> > > EFER.TCE if available.
> > >
> > > Signed-off-by: Venkatesh Srinivas <venkateshs@chromium.org>
> > > Co-developed-by: Yosry Ahmed <yosry@kernel.org>
> > > Signed-off-by: Yosry Ahmed <yosry@kernel.org>
> >
> > I'll repeat what I said on that referenced patch.
> >
> > What's the point? AMD have said that TCE doesn't exist any more; it's a
> > bit that's no longer wired into anything.
> >
> > You've got to get to pre-Zen hardware before this has any behavioural
> > effect, at which point the breath of testing is almost 0.
>
> Oh, I did not know that, thanks for pointing it out.
>
> I'll leave it up to Sean whether to pick this up (because Linux guests
> still set the bit), just pick up patches 1-2 as cleanups, or drop this
> entirely.
I'll grab 1-2 and leave 3 alone, at least for now. It _should_ do no harm, but
it would really suck to discover that pre-Zen hardware has a TLB bug that affects
TCE, or worse, affects TCE but only for ASID!=0 translations or something.
If new CPUs ever use TCE, it'll be trivial to enable at that time.
next prev parent reply other threads:[~2026-03-09 15:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-07 1:16 [PATCH v2 0/3] KVM: SVM: Advertise TCE to userspace Yosry Ahmed
2026-03-07 1:16 ` [PATCH v2 1/3] KVM: x86: Move some EFER bits enablement to common code Yosry Ahmed
2026-03-07 1:16 ` [PATCH v2 2/3] KVM: x86: Use kvm_cpu_cap_has() for EFER bits enablement checks Yosry Ahmed
2026-03-07 1:16 ` [PATCH v2 3/3] KVM: SVM: Advertise Translation Cache Extensions to userspace Yosry Ahmed
2026-03-07 1:54 ` Andrew Cooper
2026-03-09 13:53 ` Yosry Ahmed
2026-03-09 15:06 ` Sean Christopherson [this message]
2026-03-09 15:10 ` Yosry Ahmed
2026-03-09 22:53 ` Venkatesh Srinivas
2026-04-03 15:13 ` [PATCH v2 0/3] KVM: SVM: Advertise TCE " Sean Christopherson
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=aa7h39_Vp6P5TVA7@google.com \
--to=seanjc@google.com \
--cc=andrew.cooper3@citrix.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=venkateshs@chromium.org \
--cc=venkateshs@google.com \
--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