mbox series

[v3,0/2] Add wrapper to read GPR of INVPCID, INVVPID, and INVEPT

Message ID 20211103205911.1253463-1-vipinsh@google.com (mailing list archive)
Headers show
Series Add wrapper to read GPR of INVPCID, INVVPID, and INVEPT | expand

Message

Vipin Sharma Nov. 3, 2021, 8:59 p.m. UTC
Hello,

v3 is similar to v2 except that the commit message of "PATCH v3 2/2" is now
clearer and detailed.

VMX code to handle INVPCID, INVVPID, and INVEPT read the same GPR index
in VM exit info. This patch series improves that handling by adding a
common wrapper function for them.

Patch 2 makes a sublte change in INVPCID type check. Unlike INVVPID and
INVEPT, INVPCID is not explicitly documented to check the type before
reading the operand from memory. So, this patch moves INVPCID type check
to the common switch statement instead of VMX and SVM validating it
individually.

Changes in v3:
- Patch 2's commit message is more detailed now.

Changes in v2:
- Keeping the register read visible in the functions.
- Removed INVPCID type check hardcoding and moved error condition to common 
  function.

[v2] https://lore.kernel.org/lkml/20211103183232.1213761-1-vipinsh@google.com/
[v1] https://lore.kernel.org/lkml/20211011194615.2955791-1-vipinsh@google.com/

Vipin Sharma (2):
  KVM: VMX: Add a wrapper to read index of GPR for INVPCID, INVVPID, and
    INVEPT
  KVM: Move INVPCID type check from vmx and svm to the common
    kvm_handle_invpcid()

 arch/x86/kvm/svm/svm.c    |  5 -----
 arch/x86/kvm/vmx/nested.c | 10 ++++++----
 arch/x86/kvm/vmx/vmx.c    |  9 +++------
 arch/x86/kvm/vmx/vmx.h    |  5 +++++
 arch/x86/kvm/x86.c        |  3 ++-
 5 files changed, 16 insertions(+), 16 deletions(-)

Comments

Sean Christopherson Nov. 3, 2021, 11:07 p.m. UTC | #1
On Wed, Nov 03, 2021, Vipin Sharma wrote:
> Hello,
> 
> v3 is similar to v2 except that the commit message of "PATCH v3 2/2" is now
> clearer and detailed.

Heh, please wait at _minimum_ one day before spinning a new version.  I know it's
a bit weird/silly for such a small series, but even in this case I replied to the
previous version because I circled back to the "series" while waiting for a build
to complete.  For small series and/or single patches, unless there's a reason for
urgency, it's polite to wait a few days between versions to give folks a reasonable
chance to weigh in before getting hit with a new version.
Vipin Sharma Nov. 4, 2021, 5:08 a.m. UTC | #2
On Wed, Nov 3, 2021 at 4:08 PM Sean Christopherson <seanjc@google.com> wrote:
>
> On Wed, Nov 03, 2021, Vipin Sharma wrote:
> > Hello,
> >
> > v3 is similar to v2 except that the commit message of "PATCH v3 2/2" is now
> > clearer and detailed.
>
> Heh, please wait at _minimum_ one day before spinning a new version.  I know it's
> a bit weird/silly for such a small series, but even in this case I replied to the
> previous version because I circled back to the "series" while waiting for a build
> to complete.  For small series and/or single patches, unless there's a reason for
> urgency, it's polite to wait a few days between versions to give folks a reasonable
> chance to weigh in before getting hit with a new version.

I am sorry about this. I will keep this in mind for any future work.
Thanks for the advice, I appreciate it.