KVM: VMX: Print VM-instruction error when it may be helpful
PATCH v3 1/2 KVM: VMX: Print VM-instruction error when it may be helpful
From: David Matlack <[email protected]>
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.
[Rebased and refactored code; dropped the error number for INVVPID and INVEPT; reworded commit message.]
---
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(-)
arch/x86/kvm/vmx/vmx.c +4 -2
@@ -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)
Signature · 1 line
2.36.0.512.ge40c2bad7a-goog
PATCH v3 2/2 KVM: VMX: Print VM-instruction error as unsigned
Change the printf format character from 'd' to 'u' for the VM-instruction error in vmwrite_error().
--- arch/x86/kvm/vmx/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/vmx/vmx.c +1 -1
@@ -386,7 +386,7 @@ asmlinkage void vmread_error(unsigned long field, bool fault) noinline void vmwrite_error(unsigned long field, unsigned long value) { -vmx_insn_failed ("kvm: vmwrite failed: field=%lx val=%lx err=%d\n" , +vmx_insn_failed ("kvm: vmwrite failed: field=%lx val=%lx err=%u\n" , field, value,vmcs_read32 (VM_INSTRUCTION_ERROR )); }
Signature · 1 line
2.36.0.512.ge40c2bad7a-goog
Re: [PATCH v3 2/2] KVM: VMX: Print VM-instruction error as unsigned
Quoted 7 lines · Jim Mattson
Change the printf format character from 'd' to 'u' for the VM-instruction error in
vmwrite_error().Fixes 6aa8b732ca01 ("[PATCH] kvm: userspace interface")Reported-by Sean Christopherson <[email protected]>Signed-off-by Jim Mattson <[email protected]>---
Re: [PATCH v3 2/2] KVM: VMX: Print VM-instruction error as unsigned
Quoted 11 lines · Sean Christopherson
Quoted 7 lines · Jim Mattson
Change the printf format character from 'd' to 'u' for the VM-instruction error in
vmwrite_error().Fixes 6aa8b732ca01 ("[PATCH] kvm: userspace interface")Reported-by Sean Christopherson <[email protected]>Signed-off-by Jim Mattson <[email protected]>---
Reviewed-by Sean Christopherson <[email protected]>
Paolo?
Quoted 7 lines · Jim Mattson
From: David Matlack <[email protected]>
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.
Quoted 5 lines
Signed-off-by David Matlack <[email protected]>[Rebased and refactored code; dropped the error number for INVVPID and INVEPT; reworded commit message.]
Signed-off-by Jim Mattson <[email protected]>---
I do think it'd be worthwhile to add the safe VMREAD variant, but I don't care enough to hold this up.