All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/4] KVM: x86: Convey the exit reason, etc. to user-space on emulation failure
@ 2021-08-13  7:12 David Edmondson
  2021-08-13  7:12 ` [PATCH v4 1/4] KVM: x86: Clarify the kvm_run.emulation_failure structure layout David Edmondson
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: David Edmondson @ 2021-08-13  7:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jim Mattson, Borislav Petkov, Paolo Bonzini, Vitaly Kuznetsov,
	H. Peter Anvin, Thomas Gleixner, Wanpeng Li, Ingo Molnar,
	Sean Christopherson, Joerg Roedel, David Matlack, x86, kvm,
	David Edmondson

To help when debugging failures in the field, if instruction emulation
fails, report the VM exit reason, etc. to userspace in order that it
can be recorded.

The SGX changes here are compiled but untested.

Sean: if you want me to add your name to patch 3, given that I adopted
your sample code almost unaltered, please say.

v4:
- Update the API for preparing emulation failure report (Sean)
- sgx uses the provided API in all relevant cases (Sean)
- Clarify the intended layout of kvm_run.emulation_failure.

v3:
- Convey any debug data un-flagged after the ABI specified data in
  struct emulation_failure (Sean)
- Obey the ABI protocol in sgx_handle_emulation_failure() (Sean)

v2:
- Improve patch comments (dmatlock)
- Intel should provide the full exit reason (dmatlock)
- Pass a boolean rather than flags (dmatlock)
- Use the helper in kvm_task_switch() and kvm_handle_memory_failure()
  (dmatlock)
- Describe the exit_reason field of the emulation_failure structure
  (dmatlock)

David Edmondson (4):
  KVM: x86: Clarify the kvm_run.emulation_failure structure layout
  KVM: x86: Get exit_reason as part of kvm_x86_ops.get_exit_info
  KVM: x86: On emulation failure, convey the exit reason, etc. to
    userspace
  KVM: x86: SGX must obey the KVM_INTERNAL_ERROR_EMULATION protocol

 arch/x86/include/asm/kvm_host.h | 10 +++--
 arch/x86/kvm/svm/svm.c          |  8 ++--
 arch/x86/kvm/trace.h            |  9 ++--
 arch/x86/kvm/vmx/nested.c       |  2 +-
 arch/x86/kvm/vmx/sgx.c          | 16 +++-----
 arch/x86/kvm/vmx/vmx.c          | 11 +++--
 arch/x86/kvm/x86.c              | 73 ++++++++++++++++++++++++++-------
 include/uapi/linux/kvm.h        | 15 ++++++-
 8 files changed, 100 insertions(+), 44 deletions(-)

-- 
2.30.2


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

end of thread, other threads:[~2021-09-13 13:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13  7:12 [PATCH v4 0/4] KVM: x86: Convey the exit reason, etc. to user-space on emulation failure David Edmondson
2021-08-13  7:12 ` [PATCH v4 1/4] KVM: x86: Clarify the kvm_run.emulation_failure structure layout David Edmondson
2021-08-13  7:12 ` [PATCH v4 2/4] KVM: x86: Get exit_reason as part of kvm_x86_ops.get_exit_info David Edmondson
2021-08-13  7:12 ` [PATCH v4 3/4] KVM: x86: On emulation failure, convey the exit reason, etc. to userspace David Edmondson
2021-09-02 18:39   ` Sean Christopherson
2021-09-13 13:19     ` David Edmondson
2021-08-13  7:12 ` [PATCH v4 4/4] KVM: x86: SGX must obey the KVM_INTERNAL_ERROR_EMULATION protocol David Edmondson
2021-09-02 18:46   ` Sean Christopherson

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.