All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/2] KVM: VMX: Print VM-instruction error when it may be helpful
@ 2022-05-10 22:40 Jim Mattson
  2022-05-10 22:40 ` [PATCH v3 2/2] KVM: VMX: Print VM-instruction error as unsigned Jim Mattson
  2022-05-10 23:50 ` [PATCH v3 1/2] KVM: VMX: Print VM-instruction error when it may be helpful Sean Christopherson
  0 siblings, 2 replies; 5+ messages in thread
From: Jim Mattson @ 2022-05-10 22:40 UTC (permalink / raw)
  To: kvm, pbonzini, seanjc; +Cc: David Matlack, Jim Mattson

From: David Matlack <dmatlack@google.com>

Include the value of the "VM-instruction error" field from the current
VMCS (if any) in the error message for VMCLEAR and VMPTRLD, since each
of these instructions may result in more than one VM-instruction
error. Previously, this field was only reported for VMWRITE errors.

Signed-off-by: David Matlack <dmatlack@google.com>
[Rebased and refactored code; dropped the error number for INVVPID and
INVEPT; reworded commit message.]
Signed-off-by: Jim Mattson <jmattson@google.com>
---
 v1 -> v2: Dropped changes to invvpid_error and invept_error.
 v2 -> v3: Changed printf format character from 'd' to 'u'

 arch/x86/kvm/vmx/vmx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 610355b9ccce..3a76730584cd 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -392,12 +392,14 @@ noinline void vmwrite_error(unsigned long field, unsigned long value)
 
 noinline void vmclear_error(struct vmcs *vmcs, u64 phys_addr)
 {
-	vmx_insn_failed("kvm: vmclear failed: %p/%llx\n", vmcs, phys_addr);
+	vmx_insn_failed("kvm: vmclear failed: %p/%llx err=%u\n",
+			vmcs, phys_addr, vmcs_read32(VM_INSTRUCTION_ERROR));
 }
 
 noinline void vmptrld_error(struct vmcs *vmcs, u64 phys_addr)
 {
-	vmx_insn_failed("kvm: vmptrld failed: %p/%llx\n", vmcs, phys_addr);
+	vmx_insn_failed("kvm: vmptrld failed: %p/%llx err=%u\n",
+			vmcs, phys_addr, vmcs_read32(VM_INSTRUCTION_ERROR));
 }
 
 noinline void invvpid_error(unsigned long ext, u16 vpid, gva_t gva)
-- 
2.36.0.512.ge40c2bad7a-goog


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

end of thread, other threads:[~2022-05-17 20:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-10 22:40 [PATCH v3 1/2] KVM: VMX: Print VM-instruction error when it may be helpful Jim Mattson
2022-05-10 22:40 ` [PATCH v3 2/2] KVM: VMX: Print VM-instruction error as unsigned Jim Mattson
2022-05-10 23:51   ` Sean Christopherson
2022-05-17 20:21     ` Jim Mattson
2022-05-10 23:50 ` [PATCH v3 1/2] KVM: VMX: Print VM-instruction error when it may be helpful 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.