public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Denis Plotnikov <dplotnikov@virtuozzo.com>,
	rkagan@virtuozzo.com, den@virtuozzo.com, rkrcmar@redhat.com
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] KVM: x86: avoid redundant REQ_EVENT
Date: Wed, 14 Dec 2016 23:29:33 +0100	[thread overview]
Message-ID: <b3da88d7-709b-3228-cf3b-3694fd00a97d@redhat.com> (raw)
In-Reply-To: <20161214105908.322638-1-dplotnikov@virtuozzo.com>



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

  parent reply	other threads:[~2016-12-14 22:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-14 10:59 [PATCH v2] KVM: x86: avoid redundant REQ_EVENT Denis Plotnikov
2016-12-14 21:36 ` Radim Krčmář
2016-12-14 22:29 ` Paolo Bonzini [this message]
2016-12-15  7:18   ` Roman Kagan
2016-12-15 14:30     ` Radim Krčmář
2016-12-15 14:32       ` Paolo Bonzini
2016-12-15 14:56         ` Roman Kagan
2016-12-18 21:03           ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b3da88d7-709b-3228-cf3b-3694fd00a97d@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=den@virtuozzo.com \
    --cc=dplotnikov@virtuozzo.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rkagan@virtuozzo.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox