Re: [PATCH v2] KVM: x86: avoid redundant REQ_EVENT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 14, 2016 at 11:29:33PM +0100, Paolo Bonzini wrote:
> 
> 
> On 14/12/2016 11:59, Denis Plotnikov wrote:
> >  
> >  	if ((exit_reason == EXIT_REASON_EXTERNAL_INTERRUPT)
> >  	    && nested_exit_intr_ack_set(vcpu)) {
> > -		int irq = kvm_cpu_get_interrupt(vcpu);
> > +		int irq = kvm_cpu_get_interrupt(vcpu, true);
> >  		WARN_ON(irq < 0);
> 
> I think this is not needed, because all nested vmexits end with a KVM_REQ_EVENT:
> 
>         /*
>          * the KVM_REQ_EVENT optimization bit is only on for one entry, and if
>          * we did not inject a still-pending event to L1 now because of
>          * nested_run_pending, we need to re-enable this bit.
>          */
>         if (vmx->nested.nested_run_pending)
>                 kvm_make_request(KVM_REQ_EVENT, vcpu);

IIRC .nested_run_pending indicates we're emulating vmlaunch/vmresume and
should not vmexit to L1, so this is not exactly "all nested vmexits"...

> This would allow you to always pass false from kvm_cpu_get_interrupt to
> kvm_get_apic_interrupt.  Not sure if the additional complication in vmx.c
> is worth the simplification in lapic.c.  Radim, second opinion? :)

Roman.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux