From: Amit Shah <amit@kernel.org>
To: Sean Christopherson <seanjc@google.com>
Cc: David Kaplan <David.Kaplan@amd.com>,
Jim Mattson <jmattson@google.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"x86@kernel.org" <x86@kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"mingo@redhat.com" <mingo@redhat.com>,
"bp@alien8.de" <bp@alien8.de>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"hpa@zytor.com" <hpa@zytor.com>,
Kim Phillips <kim.phillips@amd.com>
Subject: Re: [PATCH v2] KVM: SVM: let alternatives handle the cases when RSB filling is required
Date: Mon, 22 Jul 2024 13:55:49 +0200 [thread overview]
Message-ID: <1cd7516391a4c51890c5b0c60a6f149b00cae3af.camel@kernel.org> (raw)
In-Reply-To: <ZpbFvTUeB3gMIKiU@google.com>
On Tue, 2024-07-16 at 12:10 -0700, Sean Christopherson wrote:
> On Mon, Jul 15, 2024, Amit Shah wrote:
> > On (Mon) 08 Jul 2024 [11:59:45], Sean Christopherson wrote:
> > > On Mon, Jul 01, 2024, David Kaplan wrote:
> > > > > >
(snipped to what is now emerging as the core of the discussion)
> > Also - reviewers of code will get confused, wondering why this code
> > for AMD exists when the CPU vuln does not.
> >
> > I get that we want to write defensive code, but this was a very
> > special condition that is unlikely to happen in this part of the
> > code,
> > and also this was missed by the devs and the reviewers.
>
> Defensive code is only part of it, and a minor part at that. The
> main "issue" is
> having divergent VM-Enter/VM-Exit code for Intel vs. AMD. To those
> of us that
> care primarily about virtualization and are only passingly familiar
> with the myriad
> speculation bugs and mitigations, omitting RSB_VMEXIT_LITE _looks_
> wrong.
>
> To know that the omission is correct, one has to suss out that it's
> (supposed to
> be) impossible for RSB_VMEXIT_LITE to be set on AMD. And as a KVM
> person, that's
> a detail I don't want to care about.
OK - I get that. Cognitive overload is a real thing, and the less of
it the better.
Since this isn't a discussion about any AMD bug or implementation
detail, but rather a uniformity in KVM code across different CPU
implementations from different vendors, I prefer someone else code up
the patch to add that uniformity. I don't have an objection to that.
I can of course offer a comment in this hunk, though, that says AMD
does not have the bug that necessitates VMEXIT_LITE, and that should
help in the meantime. You've not queued this patch yet, right? Do you
think it's better I do a v3 with this comment update?
> FWIW, I feel the same way about all the other post-VM-Exit
> mitigations, they just
> don't stand out in the same way because the entire mitigation
> sequence is absent
> on one vendor the other, i.e. they don't look wrong at first glance.
> But if KVM
> could have a mostly unified VM-Enter => VM-Exit assembly code, I
> would happliy eat
> a dead NOP/JMP or three. Now that I look at it, that actually seems
> very doable...
Sure. I think some of the fallacy there is also to treat VMX and SVM
as similar (while not treating the Arm side as similar). They are
different implementations, with several overlapping details - but it's
perilous to think everything maps the same across vendors.
Amit
next prev parent reply other threads:[~2024-07-22 11:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-26 7:37 Amit Shah
2024-06-28 16:09 ` Sean Christopherson
2024-06-28 18:48 ` Jim Mattson
2024-07-01 12:52 ` Amit Shah
2024-07-01 13:40 ` Kaplan, David
2024-07-08 18:59 ` Sean Christopherson
2024-07-15 8:35 ` Amit Shah
2024-07-16 19:10 ` Sean Christopherson
2024-07-22 11:55 ` Amit Shah [this message]
2024-09-10 17:06 ` Sean Christopherson
2024-06-29 10:28 ` Borislav Petkov
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=1cd7516391a4c51890c5b0c60a6f149b00cae3af.camel@kernel.org \
--to=amit@kernel.org \
--cc=David.Kaplan@amd.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=kim.phillips@amd.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--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
all inboxes | Powered by JetHome®