From: Paolo Bonzini <pbonzini@redhat.com>
To: Steve Rutherford <srutherford@google.com>, kvm@vger.kernel.org
Subject: Re: [PATCH v3 3/4] KVM: x86: Add EOI exit bitmap inference
Date: Wed, 03 Jun 2015 11:16:16 +0200 [thread overview]
Message-ID: <556EC5E0.2050703@redhat.com> (raw)
In-Reply-To: <1433289107-20638-3-git-send-email-srutherford@google.com>
On 03/06/2015 01:51, Steve Rutherford wrote:
> +static inline void kvm_arch_irq_routing_update(struct kvm *kvm)
> +{
> +}
Please add the static inline to all arches instead of putting it in
#ifndef __KVM_HAVE_IOAPIC. It's not related to the existence of an ioapic.
>
> +void kvm_arch_irq_routing_update(struct kvm *kvm)
> +{
> + struct kvm_ioapic *ioapic = kvm->arch.vioapic;
> +
> + if (ioapic)
> + return;
> + if (!lapic_in_kernel(kvm))
> + return;
> + kvm_make_scan_ioapic_request(kvm);
> +}
> +
It's weird to have a function in ioapic.c that only does something if
you _do not_ have an ioapic. :)
> +
> +void kvm_scan_ioapic_routes(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap)
This must stay in arch/x86/kvm/. I'd put both of these in irq_comm.c.
Then you do not need kvm_arch_nr_userspace_ioapic_pins anymore.
Paolo
> +{
> + struct kvm *kvm = vcpu->kvm;
> + struct kvm_kernel_irq_routing_entry *entry;
> + struct kvm_irq_routing_table *table;
> + u32 i, nr_ioapic_pins;
> + int idx;
> +
> + /* kvm->irq_routing must be read after clearing
> + * KVM_SCAN_IOAPIC. */
> + smp_mb();
> + idx = srcu_read_lock(&kvm->irq_srcu);
> + table = kvm->irq_routing;
> + nr_ioapic_pins = min_t(u32, table->nr_rt_entries,
> + kvm_arch_nr_userspace_ioapic_pins(kvm));
> + for (i = 0; i < nr_ioapic_pins; ++i) {
> + hlist_for_each_entry(entry, &table->map[i], link) {
> + u32 dest_id, dest_mode;
> +
> + if (entry->type != KVM_IRQ_ROUTING_MSI)
> + continue;
> + dest_id = (entry->msi.address_lo >> 12) & 0xff;
> + dest_mode = (entry->msi.address_lo >> 2) & 0x1;
> + if (kvm_apic_match_dest(vcpu, NULL, 0, dest_id,
> + dest_mode)) {
> + u32 vector = entry->msi.data & 0xff;
> +
> + __set_bit(vector,
> + (unsigned long *) eoi_exit_bitmap);
> + }
> + }
> + }
> + srcu_read_unlock(&kvm->irq_srcu, idx);
> +}
next prev parent reply other threads:[~2015-06-03 9:16 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-02 23:51 [PATCH v3 1/4] KVM: x86: Split the APIC from the rest of IRQCHIP Steve Rutherford
2015-06-02 23:51 ` [PATCH v3 2/4] KVM: x86: Add KVM exit for IOAPIC EOIs Steve Rutherford
2015-06-03 9:16 ` Paolo Bonzini
2015-06-02 23:51 ` [PATCH v3 3/4] KVM: x86: Add EOI exit bitmap inference Steve Rutherford
2015-06-03 9:16 ` Paolo Bonzini [this message]
2015-06-04 20:39 ` Steve Rutherford
2015-06-08 10:33 ` Wanpeng Li
2015-06-08 14:15 ` Paolo Bonzini
2015-06-09 2:16 ` Wanpeng Li
2015-06-17 8:14 ` Paolo Bonzini
2015-06-02 23:51 ` [PATCH v3 4/4] KVM: x86: Add support for local interrupt requests from userspace Steve Rutherford
2015-06-03 9:38 ` Paolo Bonzini
2015-06-04 20:21 ` Steve Rutherford
2015-06-20 0:41 ` Steve Rutherford
2015-06-21 20:10 ` Paolo Bonzini
2015-06-26 0:26 ` Steve Rutherford
2015-06-26 8:49 ` Paolo Bonzini
2015-06-03 8:54 ` [PATCH v3 1/4] KVM: x86: Split the APIC from the rest of IRQCHIP Paolo Bonzini
2015-06-04 20:38 ` Steve Rutherford
2015-06-05 7:19 ` 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=556EC5E0.2050703@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--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).