From: "Radim Krčmář" <rkrcmar@redhat.com>
To: James Sullivan <sullivan.james.f@gmail.com>
Cc: kvm@vger.kernel.org, gleb@kernel.org, pbonzini@redhat.com
Subject: Re: [PATCH v3 2/2] kvm: x86: Deliver MSI IRQ to only lowest prio cpu if msi_redir_hint is true
Date: Tue, 17 Mar 2015 15:18:35 +0100 [thread overview]
Message-ID: <20150317141835.GA2103@potion.brq.redhat.com> (raw)
In-Reply-To: <1426555822-3280-3-git-send-email-sullivan.james.f@gmail.com>
2015-03-16 19:30-0600, James Sullivan:
> An MSI interrupt should only be delivered to the lowest priority CPU
> when it has RH=1, regardless of the delivery mode. Modified
> kvm_is_dm_lowest_prio() to check for either irq->delivery_mode == APIC_DM_LOWPRI
> or irq->msi_redir_hint.
>
> Moved kvm_is_dm_lowest_prio() into lapic.h and renamed to
> kvm_lowest_prio_delivery().
>
> Changed a check in kvm_irq_delivery_to_apic_fast() from
> irq->delivery_mode == APIC_DM_LOWPRI to kvm_is_dm_lowest_prio().
>
> Signed-off-by: James Sullivan <sullivan.james.f@gmail.com>
> ---
Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>
> diff --git a/arch/x86/kvm/irq_comm.c b/arch/x86/kvm/irq_comm.c
> @@ -31,6 +31,8 @@
> #include "ioapic.h"
>
> +#include "lapic.h"
> +
(No need for the empty line between them.)
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> @@ -701,8 +701,7 @@ bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src,
> dst = map->logical_map[cid];
>
> bitmap = apic_logical_id(map, mda);
> -
(It's polite to preserve blank lines.)
> - if (irq->delivery_mode == APIC_DM_LOWEST) {
> + if (kvm_lowest_prio_delivery(irq)) {
lapic.c does not directly include lapic.h, (gets pulled via irq.h)
it would be nicer to fix it here, but can also be done later ...
> diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h
> @@ -168,6 +168,12 @@ static inline bool kvm_apic_has_events(struct kvm_vcpu *vcpu)
> +static inline bool kvm_lowest_prio_delivery(struct kvm_lapic_irq *irq)
> +{
> + return (irq->delivery_mode == APIC_DM_LOWEST ||
> + irq->msi_redir_hint);
(These parentheses improve readability?)
next prev parent reply other threads:[~2015-03-17 14:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-17 1:30 [PATCH v3 0/2] kvm: x86: Implement handling of RH=1 for MSI delivery in KVM James Sullivan
2015-03-17 1:30 ` [PATCH v3 1/2] kvm: x86: Extended struct kvm_lapic_irq with msi_redir_hint for MSI delivery James Sullivan
2015-03-17 14:02 ` Radim Krčmář
2015-03-17 1:30 ` [PATCH v3 2/2] kvm: x86: Deliver MSI IRQ to only lowest prio cpu if msi_redir_hint is true James Sullivan
2015-03-17 14:18 ` Radim Krčmář [this message]
2015-03-17 8:19 ` [PATCH v3 0/2] kvm: x86: Implement handling of RH=1 for MSI delivery in KVM Jan Kiszka
2015-03-17 15:33 ` James Sullivan
2015-03-29 2:17 ` James Sullivan
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=20150317141835.GA2103@potion.brq.redhat.com \
--to=rkrcmar@redhat.com \
--cc=gleb@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=sullivan.james.f@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.