From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v2] KVM: x86: avoid redundant REQ_EVENT Date: Wed, 14 Dec 2016 23:29:33 +0100 Message-ID: References: <20161214105908.322638-1-dplotnikov@virtuozzo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org To: Denis Plotnikov , rkagan@virtuozzo.com, den@virtuozzo.com, rkrcmar@redhat.com Return-path: In-Reply-To: <20161214105908.322638-1-dplotnikov@virtuozzo.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 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); 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? :) Paolo