From: Sean Christopherson <seanjc@google.com>
To: Vipin Sharma <vipinsh@google.com>
Cc: Jim Mattson <jmattson@google.com>,
pbonzini@redhat.com, dmatlack@google.com, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: VMX: Add a wrapper for reading INVPCID/INVEPT/INVVPID type
Date: Tue, 2 Nov 2021 19:19:26 +0000 [thread overview]
Message-ID: <YYGPPgCUWSEt0rQ0@google.com> (raw)
In-Reply-To: <CAHVum0eMByJA5Yc0iom6w5+Web105cYoJ-94jxzLPTLVpYOHSw@mail.gmail.com>
On Tue, Nov 02, 2021, Vipin Sharma wrote:
> Sorry for the late reply.
>
> On Thu, Oct 14, 2021 at 10:05 AM Jim Mattson <jmattson@google.com> wrote:
> >
> > On Thu, Oct 14, 2021 at 9:54 AM Sean Christopherson <seanjc@google.com> wrote:
> > > Oh, yeah, definitely. I missed that SVM's invpcid_interception() has the same
> > > open-coded check.
> > >
> > > Alternatively, could we handle the invalid type in the main switch statement? I
> > > don't see anything in the SDM or APM that architecturally _requires_ the type be
> > > checked before reading the INVPCID descriptor. Hardware may operate that way,
> > > but that's uArch specific behavior unless there's explicit documentation.
> >
> > Right. INVVPID and INVEPT are explicitly documented to check the type
> > first, but INVPCID is not.
>
> It seems to me that I can move type > 3 check to kvm_handle_invpcid()
> switch statement. I can replace BUG() in that switch statement with
> kvm_inject_gp for the default case, I won't even need INVPCID_TYPE_MAX
> in this case.
Yep.
> If you are fine with this approach then I will send out a patch where
> invalid type is handled in kvm_handle_invpcid() switch statement.
This has my vote.
prev parent reply other threads:[~2021-11-02 19:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-11 19:46 [PATCH] KVM: VMX: Add a wrapper for reading INVPCID/INVEPT/INVVPID type Vipin Sharma
2021-10-11 20:23 ` Sean Christopherson
2021-10-11 20:51 ` Jim Mattson
2021-10-14 16:54 ` Sean Christopherson
2021-10-14 17:05 ` Jim Mattson
2021-11-02 18:12 ` Vipin Sharma
2021-11-02 19:19 ` Sean Christopherson [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=YYGPPgCUWSEt0rQ0@google.com \
--to=seanjc@google.com \
--cc=dmatlack@google.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=vipinsh@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.