linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] KVM: VMX: Unionize vcpu_vmx.exit_reason
@ 2020-03-12 18:45 Sean Christopherson
  2020-03-12 18:45 ` [PATCH 01/10] KVM: nVMX: Move reflection check into nested_vmx_reflect_vmexit() Sean Christopherson
                   ` (9 more replies)
  0 siblings, 10 replies; 33+ messages in thread
From: Sean Christopherson @ 2020-03-12 18:45 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li, Jim Mattson,
	Joerg Roedel, kvm, linux-kernel, Xiaoyao Li

Convert the exit_reason field in struct vcpu_vmx from a vanilla u32 to a
union, (ab)using the union to provide access to the basic exit reason and
flags.

There are three motivating factors for making exit_reason a union:

  - Help avoid bugs where a basic exit reason is compared against the full
    exit reason, e.g. there have been two bugs where MCE_DURING_VMENTRY
    was incorrectly compared against the full exit reason.

  - Clarify the intent of related flows, e.g. exit_reason is used for both
    "basic exit reason" and "full exit reason", and it's not always clear
    which of the two is intended without a fair bit of digging.

  - Prepare for future Intel features, e.g. SGX, that add new exit flags
    that are less restricted than FAILED_VMENTRY, i.e. can be set on what
    is otherwise a standard VM-Exit.

Sean Christopherson (10):
  KVM: nVMX: Move reflection check into nested_vmx_reflect_vmexit()
  KVM: nVMX: Drop a superfluous WARN on reflecting EXTERNAL_INTERRUPT
  KVM: nVMX: Pull exit_reason from vcpu_vmx in
    nested_vmx_exit_reflected()
  KVM: VMX: Convert local exit_reason to u16 in
    nested_vmx_exit_reflected()
  KVM: VMX: Convert local exit_reason to u16 in vmx_handle_exit()
  KVM: nVMX: Convert local exit_reason to u16 in
    ...enter_non_root_mode()
  KVM: nVMX: Cast exit_reason to u16 to check for nested
    EXTERNAL_INTERRUPT
  KVM: nVMX: Rename exit_reason to vm_exit_reason for nested VM-Exit
  KVM: VMX: Cache vmx->exit_reason in local u16 in
    vmx_handle_exit_irqoff()
  KVM: VMX: Convert vcpu_vmx.exit_reason to a union

 arch/x86/kvm/vmx/nested.c | 49 +++++++++++++++++++++++----------------
 arch/x86/kvm/vmx/nested.h | 28 ++++++++++++----------
 arch/x86/kvm/vmx/vmx.c    | 39 +++++++++++++++++--------------
 arch/x86/kvm/vmx/vmx.h    | 25 +++++++++++++++++++-
 4 files changed, 90 insertions(+), 51 deletions(-)

-- 
2.24.1


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2020-03-17 18:01 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-12 18:45 [PATCH 00/10] KVM: VMX: Unionize vcpu_vmx.exit_reason Sean Christopherson
2020-03-12 18:45 ` [PATCH 01/10] KVM: nVMX: Move reflection check into nested_vmx_reflect_vmexit() Sean Christopherson
2020-03-13 12:12   ` Vitaly Kuznetsov
2020-03-17  5:33     ` Sean Christopherson
2020-03-17 16:16       ` Sean Christopherson
2020-03-17 17:00         ` Vitaly Kuznetsov
2020-03-17 17:38           ` Paolo Bonzini
2020-03-17 18:01             ` Sean Christopherson
2020-03-12 18:45 ` [PATCH 02/10] KVM: nVMX: Drop a superfluous WARN on reflecting EXTERNAL_INTERRUPT Sean Christopherson
2020-03-13 12:14   ` Vitaly Kuznetsov
2020-03-12 18:45 ` [PATCH 03/10] KVM: nVMX: Pull exit_reason from vcpu_vmx in nested_vmx_exit_reflected() Sean Christopherson
2020-03-13 12:38   ` Vitaly Kuznetsov
2020-03-12 18:45 ` [PATCH 04/10] KVM: VMX: Convert local exit_reason to u16 " Sean Christopherson
2020-03-13 12:47   ` Vitaly Kuznetsov
2020-03-12 18:45 ` [PATCH 05/10] KVM: VMX: Convert local exit_reason to u16 in vmx_handle_exit() Sean Christopherson
2020-03-13 13:48   ` Vitaly Kuznetsov
2020-03-12 18:45 ` [PATCH 06/10] KVM: nVMX: Convert local exit_reason to u16 in ...enter_non_root_mode() Sean Christopherson
2020-03-13 13:55   ` Vitaly Kuznetsov
2020-03-13 14:00     ` David Laight
2020-03-17  5:29     ` Sean Christopherson
2020-03-17 17:40       ` Paolo Bonzini
2020-03-12 18:45 ` [PATCH 07/10] KVM: nVMX: Cast exit_reason to u16 to check for nested EXTERNAL_INTERRUPT Sean Christopherson
2020-03-13 13:56   ` Vitaly Kuznetsov
2020-03-12 18:45 ` [PATCH 08/10] KVM: nVMX: Rename exit_reason to vm_exit_reason for nested VM-Exit Sean Christopherson
2020-03-13 14:01   ` Vitaly Kuznetsov
2020-03-13 16:17     ` Sean Christopherson
2020-03-12 18:45 ` [PATCH 09/10] KVM: VMX: Cache vmx->exit_reason in local u16 in vmx_handle_exit_irqoff() Sean Christopherson
2020-03-13 14:09   ` Vitaly Kuznetsov
2020-03-17 17:50     ` Paolo Bonzini
2020-03-12 18:45 ` [PATCH 10/10] KVM: VMX: Convert vcpu_vmx.exit_reason to a union Sean Christopherson
2020-03-13 14:18   ` Vitaly Kuznetsov
2020-03-17  5:28     ` Sean Christopherson
2020-03-17 17:51       ` Paolo Bonzini

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).