Re: [PATCH v2 5/5] KVM: nVMX: Enable nested posted interrupt processing.

2015-01-21 Thread Wincy Van
On Wed, Jan 21, 2015 at 4:49 PM, Zhang, Yang Z wrote: + if (vector == vmcs12->posted_intr_nv && + nested_cpu_has_posted_intr(vmcs12)) { + if (vcpu->mode == IN_GUEST_MODE) + apic->send_IPI_mask(get_cpu_mask(vcpu->cpu), +

RE: [PATCH v2 5/5] KVM: nVMX: Enable nested posted interrupt processing.

2015-01-21 Thread Zhang, Yang Z
Wincy Van wrote on 2015-01-21: > On Wed, Jan 21, 2015 at 4:07 PM, Zhang, Yang Z > wrote: >>> + if (vector == vmcs12->posted_intr_nv && + >>> nested_cpu_has_posted_intr(vmcs12)) { + if (vcpu->mode >>> == IN_GUEST_MODE) + apic->send_IPI_mask(get_cpu_mask(vcpu->cpu), +

Re: [PATCH v2 5/5] KVM: nVMX: Enable nested posted interrupt processing.

2015-01-21 Thread Wincy Van
On Wed, Jan 21, 2015 at 4:07 PM, Zhang, Yang Z wrote: >> + if (vector == vmcs12->posted_intr_nv && >> + nested_cpu_has_posted_intr(vmcs12)) { >> + if (vcpu->mode == IN_GUEST_MODE) >> + apic->send_IPI_mask(get_cpu_mask(vcpu->cpu), >> +

RE: [PATCH v2 5/5] KVM: nVMX: Enable nested posted interrupt processing.

2015-01-21 Thread Zhang, Yang Z
Wincy Van wrote on 2015-01-20: > 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

Re: [PATCH v2 5/5] KVM: nVMX: Enable nested posted interrupt processing.

2015-01-21 Thread Wincy Van
On Wed, Jan 21, 2015 at 4:49 PM, Zhang, Yang Z yang.z.zh...@intel.com wrote: + if (vector == vmcs12-posted_intr_nv + nested_cpu_has_posted_intr(vmcs12)) { + if (vcpu-mode == IN_GUEST_MODE) + apic-send_IPI_mask(get_cpu_mask(vcpu-cpu), +

Re: [PATCH v2 5/5] KVM: nVMX: Enable nested posted interrupt processing.

2015-01-21 Thread Wincy Van
On Wed, Jan 21, 2015 at 4:07 PM, Zhang, Yang Z yang.z.zh...@intel.com wrote: + if (vector == vmcs12-posted_intr_nv + nested_cpu_has_posted_intr(vmcs12)) { + if (vcpu-mode == IN_GUEST_MODE) + apic-send_IPI_mask(get_cpu_mask(vcpu-cpu), +

RE: [PATCH v2 5/5] KVM: nVMX: Enable nested posted interrupt processing.

2015-01-21 Thread Zhang, Yang Z
Wincy Van wrote on 2015-01-21: On Wed, Jan 21, 2015 at 4:07 PM, Zhang, Yang Z yang.z.zh...@intel.com wrote: + if (vector == vmcs12-posted_intr_nv + nested_cpu_has_posted_intr(vmcs12)) { + if (vcpu-mode == IN_GUEST_MODE) +

RE: [PATCH v2 5/5] KVM: nVMX: Enable nested posted interrupt processing.

2015-01-21 Thread Zhang, Yang Z
Wincy Van wrote on 2015-01-20: 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

Re: [PATCH v2 5/5] KVM: nVMX: Enable nested posted interrupt processing.

2015-01-20 Thread Wincy Van
On Tue, Jan 20, 2015 at 5:54 PM, Paolo Bonzini wrote: > > > On 20/01/2015 09:48, Wincy Van wrote: >> +static int vmx_deliver_nested_posted_interrupt(struct kvm_vcpu *vcpu, >> + int vector) >> +{ >> + int r = 0; >> + struct vmcs12 *vmcs12;

Re: [PATCH v2 5/5] KVM: nVMX: Enable nested posted interrupt processing.

2015-01-20 Thread Paolo Bonzini
On 20/01/2015 09:48, Wincy Van wrote: > +static int vmx_deliver_nested_posted_interrupt(struct kvm_vcpu *vcpu, > + int vector) > +{ > + int r = 0; > + struct vmcs12 *vmcs12; > + > + /* > +* Since posted intr delivery is

[PATCH v2 5/5] KVM: nVMX: Enable nested posted interrupt processing.

2015-01-20 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 v2 5/5] KVM: nVMX: Enable nested posted interrupt processing.

2015-01-20 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

Re: [PATCH v2 5/5] KVM: nVMX: Enable nested posted interrupt processing.

2015-01-20 Thread Paolo Bonzini
On 20/01/2015 09:48, Wincy Van wrote: +static int vmx_deliver_nested_posted_interrupt(struct kvm_vcpu *vcpu, + int vector) +{ + int r = 0; + struct vmcs12 *vmcs12; + + /* +* Since posted intr delivery is async, +

Re: [PATCH v2 5/5] KVM: nVMX: Enable nested posted interrupt processing.

2015-01-20 Thread Wincy Van
On Tue, Jan 20, 2015 at 5:54 PM, Paolo Bonzini pbonz...@redhat.com wrote: On 20/01/2015 09:48, Wincy Van wrote: +static int vmx_deliver_nested_posted_interrupt(struct kvm_vcpu *vcpu, + int vector) +{ + int r = 0; + struct vmcs12