Re: [PATCH RFC] KVM: async_pf: fix async_pf exception injection

2017-06-09 Thread Paolo Bonzini
On 09/06/2017 07:30, Wanpeng Li wrote: > 2017-06-08 19:52 GMT+08:00 Paolo Bonzini : >> >> 3) add an async_page_fault member to vcpu->arch.exception > > Do you think we should also add an async_page_fault field to > x86_exception, then pass down to kvm_inject_page_fault() through > x86_exception?

Re: [PATCH RFC] KVM: async_pf: fix async_pf exception injection

2017-06-08 Thread Wanpeng Li
2017-06-08 19:52 GMT+08:00 Paolo Bonzini : > > 3) add an async_page_fault member to vcpu->arch.exception Do you think we should also add an async_page_fault field to x86_exception, then pass down to kvm_inject_page_fault() through x86_exception? Maybe we should modify kvm_queue_exception_e/kvm_mul

Re: [PATCH RFC] KVM: async_pf: fix async_pf exception injection

2017-06-08 Thread Paolo Bonzini
On 08/06/2017 14:32, Wanpeng Li wrote: >>> I change the >>> condition to "nr == PF_VECTOR && error_code == 0" to intercept async_pf, >>> however, >>> the below bug will be splatted: >> Right, because error_code == 0 is a valid error code. >> >> For stable releases, this should be enough: > > We

Re: [PATCH RFC] KVM: async_pf: fix async_pf exception injection

2017-06-08 Thread Wanpeng Li
2017-06-08 19:52 GMT+08:00 Paolo Bonzini : > > > On 08/06/2017 11:30, Wanpeng Li wrote: >> However, I found that "nr == PF_VECTOR && vmx->apf_reason != 0" never be true >> in nested_vmx_check_exception(). SVM depends on the similar stuff in >> nested_svm_intercept() which makes me confusing how it

Re: [PATCH RFC] KVM: async_pf: fix async_pf exception injection

2017-06-08 Thread Paolo Bonzini
On 08/06/2017 11:30, Wanpeng Li wrote: > However, I found that "nr == PF_VECTOR && vmx->apf_reason != 0" never be true > in nested_vmx_check_exception(). SVM depends on the similar stuff in > nested_svm_intercept() which makes me confusing how it can works. In > addition, > vmx/svm->apf_reaso