Re: [RFC/RFT PATCH] KVM: nVMX: fixes to nested virt interrupt injection

2017-07-26 Thread Wanpeng Li
2017-07-24 22:20 GMT+08:00 Paolo Bonzini : > There are three issues in nested_vmx_check_exception: > > 1) it is not taking PFEC_MATCH/PFEC_MASK into account, as reported > by Wanpeng Li; > > 2) it should rebuild the interruption info and exit qualification fields > from

Re: [RFC/RFT PATCH] KVM: nVMX: fixes to nested virt interrupt injection

2017-07-26 Thread Wanpeng Li
2017-07-24 22:20 GMT+08:00 Paolo Bonzini : > There are three issues in nested_vmx_check_exception: > > 1) it is not taking PFEC_MATCH/PFEC_MASK into account, as reported > by Wanpeng Li; > > 2) it should rebuild the interruption info and exit qualification fields > from scratch, as reported by Jim

Re: [RFC/RFT PATCH] KVM: nVMX: fixes to nested virt interrupt injection

2017-07-26 Thread Paolo Bonzini
On 26/07/2017 16:55, Jim Mattson wrote: > Hmmm. That field isn't writable on all microarchitectures. You're right... I'll see if there's a simple workaround, or it requires to rework reflection of EXCEPTION_NMI vmexits. The latter would fix PFEC_MASK/MATCH, too... Paolo > On Wed, Jul 26, 2017

Re: [RFC/RFT PATCH] KVM: nVMX: fixes to nested virt interrupt injection

2017-07-26 Thread Paolo Bonzini
On 26/07/2017 16:55, Jim Mattson wrote: > Hmmm. That field isn't writable on all microarchitectures. You're right... I'll see if there's a simple workaround, or it requires to rework reflection of EXCEPTION_NMI vmexits. The latter would fix PFEC_MASK/MATCH, too... Paolo > On Wed, Jul 26, 2017

Re: [RFC/RFT PATCH] KVM: nVMX: fixes to nested virt interrupt injection

2017-07-26 Thread Paolo Bonzini
On 25/07/2017 23:08, Jim Mattson wrote: > > + > + if (vcpu->arch.exception.has_error_code) { > + vmcs_write32(VM_EXIT_INTR_ERROR_CODE, > vcpu->arch.exception.error_code); > > > Should this be vmcs12->vm_exit_intr_error_code > =

Re: [RFC/RFT PATCH] KVM: nVMX: fixes to nested virt interrupt injection

2017-07-26 Thread Paolo Bonzini
On 25/07/2017 23:08, Jim Mattson wrote: > > + > + if (vcpu->arch.exception.has_error_code) { > + vmcs_write32(VM_EXIT_INTR_ERROR_CODE, > vcpu->arch.exception.error_code); > > > Should this be vmcs12->vm_exit_intr_error_code > =

Re: [RFC/RFT PATCH] KVM: nVMX: fixes to nested virt interrupt injection

2017-07-24 Thread Wanpeng Li
2017-07-24 22:44 GMT+08:00 Paolo Bonzini : > On 24/07/2017 16:44, Wanpeng Li wrote: >>> Wanpeng, can you test this on the testcases you had for commit >>> d4912215d103 ("KVM: nVMX: Fix exception injection", 2017-06-05)? >> Yeah, I will try it tomorrow. :) >>

Re: [RFC/RFT PATCH] KVM: nVMX: fixes to nested virt interrupt injection

2017-07-24 Thread Wanpeng Li
2017-07-24 22:44 GMT+08:00 Paolo Bonzini : > On 24/07/2017 16:44, Wanpeng Li wrote: >>> Wanpeng, can you test this on the testcases you had for commit >>> d4912215d103 ("KVM: nVMX: Fix exception injection", 2017-06-05)? >> Yeah, I will try it tomorrow. :) >> >>> Also, do

Re: [RFC/RFT PATCH] KVM: nVMX: fixes to nested virt interrupt injection

2017-07-24 Thread Paolo Bonzini
On 24/07/2017 16:44, Wanpeng Li wrote: >> Wanpeng, can you test this on the testcases you had for commit >> d4912215d103 ("KVM: nVMX: Fix exception injection", 2017-06-05)? > Yeah, I will try it tomorrow. :) > >> Also, do you have a testcase for PFEC matching? > I din't

Re: [RFC/RFT PATCH] KVM: nVMX: fixes to nested virt interrupt injection

2017-07-24 Thread Paolo Bonzini
On 24/07/2017 16:44, Wanpeng Li wrote: >> Wanpeng, can you test this on the testcases you had for commit >> d4912215d103 ("KVM: nVMX: Fix exception injection", 2017-06-05)? > Yeah, I will try it tomorrow. :) > >> Also, do you have a testcase for PFEC matching? > I din't

Re: [RFC/RFT PATCH] KVM: nVMX: fixes to nested virt interrupt injection

2017-07-24 Thread Wanpeng Li
2017-07-24 22:20 GMT+08:00 Paolo Bonzini : > There are three issues in nested_vmx_check_exception: > > 1) it is not taking PFEC_MATCH/PFEC_MASK into account, as reported > by Wanpeng Li; > > 2) it should rebuild the interruption info and exit qualification fields > from

Re: [RFC/RFT PATCH] KVM: nVMX: fixes to nested virt interrupt injection

2017-07-24 Thread Wanpeng Li
2017-07-24 22:20 GMT+08:00 Paolo Bonzini : > There are three issues in nested_vmx_check_exception: > > 1) it is not taking PFEC_MATCH/PFEC_MASK into account, as reported > by Wanpeng Li; > > 2) it should rebuild the interruption info and exit qualification fields > from scratch, as reported by Jim

[RFC/RFT PATCH] KVM: nVMX: fixes to nested virt interrupt injection

2017-07-24 Thread Paolo Bonzini
There are three issues in nested_vmx_check_exception: 1) it is not taking PFEC_MATCH/PFEC_MASK into account, as reported by Wanpeng Li; 2) it should rebuild the interruption info and exit qualification fields from scratch, as reported by Jim Mattson, because the values from the L2->L0 vmexit may

[RFC/RFT PATCH] KVM: nVMX: fixes to nested virt interrupt injection

2017-07-24 Thread Paolo Bonzini
There are three issues in nested_vmx_check_exception: 1) it is not taking PFEC_MATCH/PFEC_MASK into account, as reported by Wanpeng Li; 2) it should rebuild the interruption info and exit qualification fields from scratch, as reported by Jim Mattson, because the values from the L2->L0 vmexit may