LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v3 0/3] kvm: x86: Convey the exit reason, etc. to user-space on emulation failure
@ 2021-07-29 13:39 David Edmondson
  2021-07-29 13:39 ` [PATCH v3 1/3] KVM: x86: kvm_x86_ops.get_exit_info should include the exit reason David Edmondson
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: David Edmondson @ 2021-07-29 13:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Thomas Gleixner, Joerg Roedel, Ingo Molnar, Jim Mattson, kvm,
	Borislav Petkov, David Matlack, Paolo Bonzini, H. Peter Anvin,
	x86, Wanpeng Li, Vitaly Kuznetsov, Sean Christopherson,
	David Edmondson

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

Sean: hopefully this is something like what you intended. If not,
please clarify and I will have another go. The lack of an ABI for the
debug data does feel messy.

The SGX changes here are compiled but untested.

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 (3):
  KVM: x86: kvm_x86_ops.get_exit_info should include the exit reason
  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 | 12 ++++++--
 arch/x86/kvm/svm/svm.c          |  8 +++--
 arch/x86/kvm/trace.h            | 11 +++----
 arch/x86/kvm/vmx/nested.c       |  2 +-
 arch/x86/kvm/vmx/sgx.c          |  8 ++---
 arch/x86/kvm/vmx/vmx.c          | 11 ++++---
 arch/x86/kvm/x86.c              | 53 ++++++++++++++++++++++++++-------
 include/uapi/linux/kvm.h        |  7 +++++
 8 files changed, 79 insertions(+), 33 deletions(-)

-- 
2.30.2


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

end of thread, other threads:[~2021-08-07  0:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-29 13:39 [PATCH v3 0/3] kvm: x86: Convey the exit reason, etc. to user-space on emulation failure David Edmondson
2021-07-29 13:39 ` [PATCH v3 1/3] KVM: x86: kvm_x86_ops.get_exit_info should include the exit reason David Edmondson
2021-07-29 22:27   ` Sean Christopherson
2021-07-30  7:29     ` David Edmondson
2021-07-29 13:39 ` [PATCH v3 2/3] KVM: x86: On emulation failure, convey the exit reason, etc. to userspace David Edmondson
2021-07-30 22:14   ` Sean Christopherson
2021-08-02  7:28     ` David Edmondson
2021-08-02 16:58       ` Sean Christopherson
2021-08-02 17:23         ` David Edmondson
2021-08-07  0:59           ` Sean Christopherson
2021-07-29 13:39 ` [PATCH v3 3/3] KVM: x86: SGX must obey the KVM_INTERNAL_ERROR_EMULATION protocol David Edmondson
2021-07-30 22:17   ` Sean Christopherson
2021-08-02  7:18     ` David Edmondson

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