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-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

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 : >>

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

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

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 :

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

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

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

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

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

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

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

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

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

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

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

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". >

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". >