Re: [PATCH v4 6/6] KVM: nVMX: Enable nested posted interrupt processing

2015-02-02 Thread Wincy Van
On Tue, Feb 3, 2015 at 9:21 AM, Zhang, Yang Z wrote: > Paolo Bonzini wrote on 2015-02-03: >> >> >> On 02/02/2015 16:33, Wincy Van wrote: >>> static void vmx_accomp_nested_posted_intr(struct kvm_vcpu *vcpu) { >>> struct vcpu_vmx *vmx = to_vmx(vcpu); >>> >>> if (is_guest_mode(vcpu)

RE: [PATCH v4 6/6] KVM: nVMX: Enable nested posted interrupt processing

2015-02-02 Thread Zhang, Yang Z
Paolo Bonzini wrote on 2015-02-03: > > > On 02/02/2015 16:33, Wincy Van wrote: >> static void vmx_accomp_nested_posted_intr(struct kvm_vcpu *vcpu) { >> struct vcpu_vmx *vmx = to_vmx(vcpu); >> >> if (is_guest_mode(vcpu) && >> vmx->nested.posted_intr_nv != -1

Re: [PATCH v4 6/6] KVM: nVMX: Enable nested posted interrupt processing

2015-02-02 Thread Paolo Bonzini
On 02/02/2015 16:33, Wincy Van wrote: > static void vmx_accomp_nested_posted_intr(struct kvm_vcpu *vcpu) > { > struct vcpu_vmx *vmx = to_vmx(vcpu); > > if (is_guest_mode(vcpu) && > vmx->nested.posted_intr_nv != -1 && > pi_test_on(vmx->nested.pi_desc)) >

Re: [PATCH v4 6/6] KVM: nVMX: Enable nested posted interrupt processing

2015-02-02 Thread Wincy Van
On Mon, Feb 2, 2015 at 7:03 PM, Paolo Bonzini wrote: > > > On 28/01/2015 17:02, Wincy Van wrote: >> +static int vmx_deliver_nested_posted_interrupt(struct kvm_vcpu *vcpu, >> + int vector) >> +{ >> + if (is_guest_mode(vcpu) && >> +

Re: [PATCH v4 6/6] KVM: nVMX: Enable nested posted interrupt processing

2015-02-02 Thread Paolo Bonzini
On 28/01/2015 17:02, Wincy Van wrote: > +static int vmx_deliver_nested_posted_interrupt(struct kvm_vcpu *vcpu, > + int vector) > +{ > + if (is_guest_mode(vcpu) && > + vector == to_vmx(vcpu)->nested.posted_intr_nv && > +

RE: [PATCH v4 6/6] KVM: nVMX: Enable nested posted interrupt processing

2015-02-02 Thread Zhang, Yang Z
Paolo Bonzini wrote on 2015-02-03: On 02/02/2015 16:33, Wincy Van wrote: static void vmx_accomp_nested_posted_intr(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); if (is_guest_mode(vcpu) vmx-nested.posted_intr_nv != -1

Re: [PATCH v4 6/6] KVM: nVMX: Enable nested posted interrupt processing

2015-02-02 Thread Paolo Bonzini
On 28/01/2015 17:02, Wincy Van wrote: +static int vmx_deliver_nested_posted_interrupt(struct kvm_vcpu *vcpu, + int vector) +{ + if (is_guest_mode(vcpu) + vector == to_vmx(vcpu)-nested.posted_intr_nv + vcpu-mode ==

Re: [PATCH v4 6/6] KVM: nVMX: Enable nested posted interrupt processing

2015-02-02 Thread Wincy Van
On Tue, Feb 3, 2015 at 9:21 AM, Zhang, Yang Z yang.z.zh...@intel.com wrote: Paolo Bonzini wrote on 2015-02-03: On 02/02/2015 16:33, Wincy Van wrote: static void vmx_accomp_nested_posted_intr(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); if

Re: [PATCH v4 6/6] KVM: nVMX: Enable nested posted interrupt processing

2015-02-02 Thread Wincy Van
On Mon, Feb 2, 2015 at 7:03 PM, Paolo Bonzini pbonz...@redhat.com wrote: On 28/01/2015 17:02, Wincy Van wrote: +static int vmx_deliver_nested_posted_interrupt(struct kvm_vcpu *vcpu, + int vector) +{ + if (is_guest_mode(vcpu) +

Re: [PATCH v4 6/6] KVM: nVMX: Enable nested posted interrupt processing

2015-02-02 Thread Paolo Bonzini
On 02/02/2015 16:33, Wincy Van wrote: static void vmx_accomp_nested_posted_intr(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); if (is_guest_mode(vcpu) vmx-nested.posted_intr_nv != -1 pi_test_on(vmx-nested.pi_desc))

[PATCH v4 6/6] KVM: nVMX: Enable nested posted interrupt processing

2015-01-28 Thread Wincy Van
If vcpu has a interrupt in vmx non-root mode, we will kick that vcpu to inject interrupt timely. With posted interrupt processing, the kick intr is not needed, and interrupts are fully taken care of by hardware. In nested vmx, this feature avoids much more vmexits than non-nested vmx. This patch

[PATCH v4 6/6] KVM: nVMX: Enable nested posted interrupt processing

2015-01-28 Thread Wincy Van
If vcpu has a interrupt in vmx non-root mode, we will kick that vcpu to inject interrupt timely. With posted interrupt processing, the kick intr is not needed, and interrupts are fully taken care of by hardware. In nested vmx, this feature avoids much more vmexits than non-nested vmx. This patch