Re: [PATCH] KVM: nVMX: Fix exception injection

2017-07-24 Thread Paolo Bonzini
On 23/07/2017 03:11, Jim Mattson wrote: >>> In the situation you describe, the #PF causes a synthesized VM-exit >>> from L2 to L1 directly, not indirectly. From the SDM: >>> >>>An exception causes a VM exit directly if the bit corresponding to >>> that exception is set in the exception bitmap.

Re: [PATCH] KVM: nVMX: Fix exception injection

2017-07-22 Thread Jim Mattson
I think the ancillary data for #DB and #PF should be added to kvm_queued_exception and plumbed through to where it's needed. Vector number and error code are not sufficient to describe a #DB or #PF. On Sat, Jul 22, 2017 at 5:29 PM, Wanpeng Li wrote: > 2017-07-22 22:25 GMT+08:00 Jim Mattson : >> O

Re: [PATCH] KVM: nVMX: Fix exception injection

2017-07-22 Thread Wanpeng Li
2017-07-22 22:25 GMT+08:00 Jim Mattson : > On Fri, Jul 21, 2017 at 1:39 AM, Wanpeng Li wrote: >> Hi Jim, >> 2017-07-21 3:16 GMT+08:00 Jim Mattson : >>> On Wed, Jul 19, 2017 at 7:31 PM, Wanpeng Li wrote: Hi Jim, 2017-07-19 2:47 GMT+08:00 Jim Mattson : > Why do we expect the VM_EXIT_I

Re: [PATCH] KVM: nVMX: Fix exception injection

2017-07-22 Thread Jim Mattson
On Fri, Jul 21, 2017 at 1:39 AM, Wanpeng Li wrote: > Hi Jim, > 2017-07-21 3:16 GMT+08:00 Jim Mattson : >> On Wed, Jul 19, 2017 at 7:31 PM, Wanpeng Li wrote: >>> Hi Jim, >>> 2017-07-19 2:47 GMT+08:00 Jim Mattson : Why do we expect the VM_EXIT_INTR_INFO and EXIT_QUALIFICATION fields of th

Re: [PATCH] KVM: nVMX: Fix exception injection

2017-07-21 Thread Wanpeng Li
Hi Jim, 2017-07-21 3:16 GMT+08:00 Jim Mattson : > On Wed, Jul 19, 2017 at 7:31 PM, Wanpeng Li wrote: >> Hi Jim, >> 2017-07-19 2:47 GMT+08:00 Jim Mattson : >>> Why do we expect the VM_EXIT_INTR_INFO and EXIT_QUALIFICATION fields >>> of the VMCS to have the correct values for the injected exception?

Re: [PATCH] KVM: nVMX: Fix exception injection

2017-07-20 Thread Jim Mattson
On Wed, Jul 19, 2017 at 7:31 PM, Wanpeng Li wrote: > Hi Jim, > 2017-07-19 2:47 GMT+08:00 Jim Mattson : >> Why do we expect the VM_EXIT_INTR_INFO and EXIT_QUALIFICATION fields >> of the VMCS to have the correct values for the injected exception? > > Good point, I think we should synthesize VM_EXIT_

Re: [PATCH] KVM: nVMX: Fix exception injection

2017-07-19 Thread Wanpeng Li
Hi Jim, 2017-07-19 2:47 GMT+08:00 Jim Mattson : > Why do we expect the VM_EXIT_INTR_INFO and EXIT_QUALIFICATION fields > of the VMCS to have the correct values for the injected exception? Good point, I think we should synthesize VM_EXIT_INTR_INFO and EXIT_QUALIFICATION manually, I will post a patc

Re: [PATCH] KVM: nVMX: Fix exception injection

2017-07-18 Thread Jim Mattson
Why do we expect the VM_EXIT_INTR_INFO and EXIT_QUALIFICATION fields of the VMCS to have the correct values for the injected exception? On Mon, Jun 5, 2017 at 5:19 AM, Wanpeng Li wrote: > 2017-06-05 20:07 GMT+08:00 Paolo Bonzini : >> >> >> On 03/06/2017 05:21, Wanpeng Li wrote: >>> Commit 0b6ac34

Re: [PATCH] KVM: nVMX: Fix exception injection

2017-06-05 Thread Wanpeng Li
2017-06-05 20:07 GMT+08:00 Paolo Bonzini : > > > On 03/06/2017 05:21, Wanpeng Li wrote: >> Commit 0b6ac343fc (KVM: nVMX: Correct handling of exception injection) >> mentioned >> that "KVM wants to inject page-faults which it got to the guest. This >> function >> assumes it is called with the exit

Re: [PATCH] KVM: nVMX: Fix exception injection

2017-06-05 Thread Paolo Bonzini
On 03/06/2017 05:21, Wanpeng Li wrote: > Commit 0b6ac343fc (KVM: nVMX: Correct handling of exception injection) > mentioned > that "KVM wants to inject page-faults which it got to the guest. This > function > assumes it is called with the exit reason in vmcs02 being a #PF exception". > Commi

[PATCH] KVM: nVMX: Fix exception injection

2017-06-02 Thread Wanpeng Li
From: Wanpeng Li WARNING: CPU: 3 PID: 2840 at arch/x86/kvm/vmx.c:10966 nested_vmx_vmexit+0xdcd/0xde0 [kvm_intel] CPU: 3 PID: 2840 Comm: qemu-system-x86 Tainted: G OE 4.12.0-rc3+ #23 RIP: 0010:nested_vmx_vmexit+0xdcd/0xde0 [kvm_intel] Call Trace: ? kvm_check_async_pf_completion