* [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* [PATCH v3 2/2] KVM: VMX: Print VM-instruction error as unsigned
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 ` Jim Mattson
2022-05-10 23:51 ` Sean Christopherson
2022-05-10 23:50 ` [PATCH v3 1/2] KVM: VMX: Print VM-instruction error when it may be helpful Sean Christopherson
1 sibling, 1 reply; 5+ messages in thread
From: Jim Mattson @ 2022-05-10 22:40 UTC (permalink / raw)
To: kvm, pbonzini, seanjc; +Cc: 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 <seanjc@google.com>
Signed-off-by: Jim Mattson <jmattson@google.com>
---
arch/x86/kvm/vmx/vmx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 3a76730584cd..f558a14851f1 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -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));
}
--
2.36.0.512.ge40c2bad7a-goog
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v3 2/2] KVM: VMX: Print VM-instruction error as unsigned
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
0 siblings, 1 reply; 5+ messages in thread
From: Sean Christopherson @ 2022-05-10 23:51 UTC (permalink / raw)
To: Jim Mattson; +Cc: kvm, pbonzini
On Tue, May 10, 2022, Jim Mattson wrote:
> 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 <seanjc@google.com>
> Signed-off-by: Jim Mattson <jmattson@google.com>
> ---
Reviewed-by: Sean Christopherson <seanjc@google.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v3 2/2] KVM: VMX: Print VM-instruction error as unsigned
2022-05-10 23:51 ` Sean Christopherson
@ 2022-05-17 20:21 ` Jim Mattson
0 siblings, 0 replies; 5+ messages in thread
From: Jim Mattson @ 2022-05-17 20:21 UTC (permalink / raw)
To: Sean Christopherson; +Cc: kvm, pbonzini
On Tue, May 10, 2022 at 4:51 PM Sean Christopherson <seanjc@google.com> wrote:
>
> On Tue, May 10, 2022, Jim Mattson wrote:
> > 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 <seanjc@google.com>
> > Signed-off-by: Jim Mattson <jmattson@google.com>
> > ---
>
> Reviewed-by: Sean Christopherson <seanjc@google.com>
Paolo?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 1/2] KVM: VMX: Print VM-instruction error when it may be helpful
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:50 ` Sean Christopherson
1 sibling, 0 replies; 5+ messages in thread
From: Sean Christopherson @ 2022-05-10 23:50 UTC (permalink / raw)
To: Jim Mattson; +Cc: kvm, pbonzini, David Matlack
On Tue, May 10, 2022, Jim Mattson wrote:
> 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>
> ---
I do think it'd be worthwhile to add the safe VMREAD variant, but I don't care
enough to hold this up.
Reviewed-by: Sean Christopherson <seanjc@google.com>
^ permalink raw reply [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.