Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1681442 > unrolled thread
| Started by | Paolo Bonzini <pbonzini@redhat.com> |
|---|---|
| First post | 2017-07-05 12:40 +0200 |
| Last post | 2017-07-05 14:30 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] KVM: vmx: expose more information for KVM_INTERNAL_ERROR_DELIVERY_EV exits Paolo Bonzini <pbonzini@redhat.com> - 2017-07-05 12:40 +0200
Re: [PATCH] KVM: vmx: expose more information for KVM_INTERNAL_ERROR_DELIVERY_EV exits David Hildenbrand <david@redhat.com> - 2017-07-05 14:30 +0200
Re: [PATCH] KVM: vmx: expose more information for KVM_INTERNAL_ERROR_DELIVERY_EV exits Paolo Bonzini <pbonzini@redhat.com> - 2017-07-05 14:30 +0200
| From | Paolo Bonzini <pbonzini@redhat.com> |
|---|---|
| Date | 2017-07-05 12:40 +0200 |
| Subject | [PATCH] KVM: vmx: expose more information for KVM_INTERNAL_ERROR_DELIVERY_EV exits |
| Message-ID | <tZPSW-537-1@gated-at.bofh.it> |
This exit ended up being reported, but the currently exposed data does not provide
much of a starting point for debugging. In the reported case, the vmexit was
an EPT misconfiguration (MMIO access). Let userspace report ethe exit qualification
and, if relevant, the GPA.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
arch/x86/kvm/vmx.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 6dcc4873e435..4be80c3ac24d 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -8408,9 +8408,15 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu)
exit_reason != EXIT_REASON_TASK_SWITCH)) {
vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_DELIVERY_EV;
- vcpu->run->internal.ndata = 2;
+ vcpu->run->internal.ndata = 3;
vcpu->run->internal.data[0] = vectoring_info;
vcpu->run->internal.data[1] = exit_reason;
+ vcpu->run->internal.data[2] = vcpu->arch.exit_qualification;
+ if (exit_reason == EXIT_REASON_EPT_MISCONFIG) {
+ vcpu->run->internal.ndata++;
+ vcpu->run->internal.data[3] =
+ vmcs_read64(GUEST_PHYSICAL_ADDRESS);
+ }
return 0;
}
--
1.8.3.1
[toc] | [next] | [standalone]
| From | David Hildenbrand <david@redhat.com> |
|---|---|
| Date | 2017-07-05 14:30 +0200 |
| Subject | Re: [PATCH] KVM: vmx: expose more information for KVM_INTERNAL_ERROR_DELIVERY_EV exits |
| Message-ID | <tZRBo-6aJ-23@gated-at.bofh.it> |
| In reply to | #1681442 |
On 05.07.2017 12:38, Paolo Bonzini wrote:
> This exit ended up being reported, but the currently exposed data does not provide
> much of a starting point for debugging. In the reported case, the vmexit was
> an EPT misconfiguration (MMIO access). Let userspace report ethe exit qualification
> and, if relevant, the GPA.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> arch/x86/kvm/vmx.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 6dcc4873e435..4be80c3ac24d 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -8408,9 +8408,15 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu)
> exit_reason != EXIT_REASON_TASK_SWITCH)) {
> vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
> vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_DELIVERY_EV;
> - vcpu->run->internal.ndata = 2;
> + vcpu->run->internal.ndata = 3;
> vcpu->run->internal.data[0] = vectoring_info;
> vcpu->run->internal.data[1] = exit_reason;
> + vcpu->run->internal.data[2] = vcpu->arch.exit_qualification;
> + if (exit_reason == EXIT_REASON_EPT_MISCONFIG) {
> + vcpu->run->internal.ndata++;
> + vcpu->run->internal.data[3] =
> + vmcs_read64(GUEST_PHYSICAL_ADDRESS);
vcpu->run->internal.data[vcpu->run->internal.ndata++] = ...
So we don't have to name the position explicitly.
Whatever you prefer.
Reviewed-by: David Hildenbrand <david@redhat.com>
> + }
> return 0;
> }
>
>
--
Thanks,
David
[toc] | [prev] | [next] | [standalone]
| From | Paolo Bonzini <pbonzini@redhat.com> |
|---|---|
| Date | 2017-07-05 14:30 +0200 |
| Subject | Re: [PATCH] KVM: vmx: expose more information for KVM_INTERNAL_ERROR_DELIVERY_EV exits |
| Message-ID | <tZRBo-6aJ-25@gated-at.bofh.it> |
| In reply to | #1681502 |
On 05/07/2017 14:25, David Hildenbrand wrote:
>> vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_DELIVERY_EV;
>> - vcpu->run->internal.ndata = 2;
>> + vcpu->run->internal.ndata = 3;
>> vcpu->run->internal.data[0] = vectoring_info;
>> vcpu->run->internal.data[1] = exit_reason;
>> + vcpu->run->internal.data[2] = vcpu->arch.exit_qualification;
>> + if (exit_reason == EXIT_REASON_EPT_MISCONFIG) {
>> + vcpu->run->internal.ndata++;
>> + vcpu->run->internal.data[3] =
>> + vmcs_read64(GUEST_PHYSICAL_ADDRESS);
> vcpu->run->internal.data[vcpu->run->internal.ndata++] = ...
I considered that, but it's very long and the initializations above use
numbers. Considering that this is not going to change very often, I
ended up with the hard coded 3.
Paolo
> So we don't have to name the position explicitly.
>
> Whatever you prefer.
>
> Reviewed-by: David Hildenbrand <david@redhat.com>
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web