From: "Shah, Amit" <Amit.Shah@amd.com>
To: "seanjc@google.com" <seanjc@google.com>,
"andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>
Cc: "corbet@lwn.net" <corbet@lwn.net>,
"pawan.kumar.gupta@linux.intel.com"
<pawan.kumar.gupta@linux.intel.com>,
"kai.huang@intel.com" <kai.huang@intel.com>,
"jpoimboe@kernel.org" <jpoimboe@kernel.org>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"daniel.sneddon@linux.intel.com" <daniel.sneddon@linux.intel.com>,
"Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"dwmw@amazon.co.uk" <dwmw@amazon.co.uk>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"Moger, Babu" <Babu.Moger@amd.com>,
"Das1, Sandipan" <Sandipan.Das@amd.com>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
"hpa@zytor.com" <hpa@zytor.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"bp@alien8.de" <bp@alien8.de>,
"boris.ostrovsky@oracle.com" <boris.ostrovsky@oracle.com>,
"Kaplan, David" <David.Kaplan@amd.com>,
"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCH v6 1/1] x86: kvm: svm: set up ERAPS support for guests
Date: Thu, 11 Dec 2025 16:09:06 +0000 [thread overview]
Message-ID: <08826b5879e2d9c354424279763d3ce5556f44cc.camel@amd.com> (raw)
In-Reply-To: <4102ede9-4bf7-4c0a-a303-5ed4d9cca762@citrix.com>
On Mon, 2025-11-24 at 16:40 +0000, Andrew Cooper wrote:
[...]
> But this *is* the problem. The APM says that OSes can depend on this
> property for safety, and does not provide enough information for
> Hypervisors to make it safe.
>
> ERAPS is a bad spec. It should not have gotten out of the door.
>
> A better spec would say "clears the RAP on any MOV to CR3" and
> nothing else.
>
> The fact that it might happen microarchitecturally in other cases
> doesn't matter; what matters is what OSes can architecturally depend
> on,
> and right now that that explicitly includes "unspecified cases in NDA
> documents".
I'd like to clarify and confirm the details around TLB flushes and
their effects of ERAPS here as an official AMD statement. First, I'd
like to clarify that INVLPGB does not flush the RAP.
Second,
Referring to the APM at
https://docs.amd.com/v/u/en-US/24593_3.43
Section 3.2.9: move to CR3 and the execution of INVPCID are the
instructions that result in the flushing of the ERAPS.
The reference to section 5.3.3 - TLB Management - and the implicit TLB
flushes there was unclear which led to most of the speculation in this
discussion earlier in this thread. For the section 5.3.3, we will
update the APM to clarify that the "writes to certain MSRs" relates to
microarchitectural behavior.
The updated wording for section 5.3.3 will make its way in a future APM
update.
(For the curious, the list of those MSRs currently is APIC_BASE,
PREFETCH_CONTROL, SYSCFG, IORRs, TOM/TOM2, SMMADDR/MASK, ECS_BASE, but
of course this is subject to change.)
Coming back to the patch here with these clarifications from AMD
architects - I am happy with Sean's update to the patch. I've also
tested the patch and it works as expected on a Zen5 CPU.
Reviewed-by: Amit Shah <amit.shah@amd.com>
Thanks,
Amit
prev parent reply other threads:[~2025-12-11 16:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-07 9:32 [PATCH v6 0/1] KVM: Add support for the ERAPS feature Amit Shah
2025-11-07 9:32 ` [PATCH v6 1/1] x86: kvm: svm: set up ERAPS support for guests Amit Shah
2025-11-20 20:11 ` Sean Christopherson
2025-11-21 2:40 ` Andrew Cooper
2025-11-21 14:58 ` Sean Christopherson
2025-11-21 15:21 ` Andrew Cooper
2025-11-24 16:15 ` Shah, Amit
2025-11-24 16:40 ` Andrew Cooper
2025-11-25 14:41 ` Shah, Amit
2025-11-25 14:54 ` Sean Christopherson
2025-12-11 16:09 ` Shah, Amit [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=08826b5879e2d9c354424279763d3ce5556f44cc.camel@amd.com \
--to=amit.shah@amd.com \
--cc=Babu.Moger@amd.com \
--cc=David.Kaplan@amd.com \
--cc=Sandipan.Das@amd.com \
--cc=Thomas.Lendacky@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=daniel.sneddon@linux.intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=dwmw@amazon.co.uk \
--cc=hpa@zytor.com \
--cc=jpoimboe@kernel.org \
--cc=kai.huang@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=x86@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;
as well as URLs for NNTP newsgroup(s).