From: Paolo Bonzini <pbonzini@redhat.com>
To: "Wu, Feng" <feng.wu@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Cc: Steve Rutherford <srutherford@google.com>,
"rkrcmar@redhat.com" <rkrcmar@redhat.com>
Subject: Re: [PATCH 5/9] KVM: x86: unify handling of interrupt window
Date: Thu, 6 Aug 2015 13:55:23 +0200 [thread overview]
Message-ID: <55C34B2B.2050807@redhat.com> (raw)
In-Reply-To: <E959C4978C3B6342920538CF579893F0026776F9@SHSMSX104.ccr.corp.intel.com>
On 06/08/2015 08:50, Wu, Feng wrote:
> Is it possible to adjust the code here and remove the later checking in x86.c?
> In that case, we can avoid calling dm_request_for_irq_injection(vcpu) for
> VM exit.
No, see the dm_request_for_irq_injection() changes in patch 9. In that
patch, you can get a IRQ window open vmexit under broader conditions
(e.g. writing to the local APIC's LVT0 register).
dm_request_for_irq_injection() is called just once, so it is inlined.
After patch 9, it boils down to simply
if (!vcpu->run->request_interrupt_window)
return false;
in the common case of in-kernel irqchip. So it costs just one memory
access and a well-predicted branch.
Paolo
> Basically dm_request_for_irq_injection() did the following checks:
>
> - The same as in handle_interrupt_window() below:
>
> if (!irqchip_in_kernel(vcpu->kvm) &&
> vcpu->run->request_interrupt_window &&
> !kvm_cpu_has_interrupt(vcpu))
>
> - kvm_arch_interrupt_allowed(vcpu), in which, most of the conditions
> are guaranteed by interrupt window exits, the only one I am not sure
> how to handle is ' to_vmx(vcpu)->nested.nested_run_pending'.
next prev parent reply other threads:[~2015-08-06 11:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-05 15:23 [PATCH 0/9] split irqchip series Paolo Bonzini
2015-08-05 15:23 ` [PATCH 1/9] KVM: x86: set TMR when the interrupt is accepted Paolo Bonzini
2015-08-05 15:23 ` [PATCH 2/9] KVM: x86: store IOAPIC-handled vectors in each VCPU Paolo Bonzini
2015-08-05 15:23 ` [PATCH 3/9] KVM: x86: replace vm_has_apicv hook with cpu_uses_apicv Paolo Bonzini
2015-08-05 15:23 ` [PATCH 4/9] KVM: x86: introduce lapic_in_kernel Paolo Bonzini
2015-08-05 15:23 ` [PATCH 5/9] KVM: x86: unify handling of interrupt window Paolo Bonzini
2015-08-06 6:50 ` Wu, Feng
2015-08-06 11:55 ` Paolo Bonzini [this message]
2015-08-05 15:23 ` [PATCH 6/9] KVM: x86: Split the APIC from the rest of IRQCHIP Paolo Bonzini
2015-08-05 15:23 ` [PATCH 7/9] KVM: x86: Add KVM exit for IOAPIC EOIs Paolo Bonzini
2015-08-05 15:23 ` [PATCH 8/9] KVM: x86: Add EOI exit bitmap inference Paolo Bonzini
2015-08-07 5:43 ` Wu, Feng
2015-08-07 7:32 ` Paolo Bonzini
2015-08-07 7:46 ` Wu, Feng
2015-08-07 10:16 ` Paolo Bonzini
2015-08-07 22:55 ` Wu, Feng
2015-08-05 15:23 ` [PATCH 9/9] KVM: x86: Add support for local interrupt requests from userspace 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=55C34B2B.2050807@redhat.com \
--to=pbonzini@redhat.com \
--cc=feng.wu@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rkrcmar@redhat.com \
--cc=srutherford@google.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;
as well as URLs for NNTP newsgroup(s).