From: Thomas Gleixner <tglx@linutronix.de>
To: Feng Wu <feng.wu@intel.com>
Cc: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org,
jiang.liu@linux.intel.com
Subject: Re: [v5 3/3] x86, irq: Define a global vector for VT-d Posted-Interrupts
Date: Mon, 18 May 2015 16:17:47 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.11.1505181606380.4225@nanos> (raw)
In-Reply-To: <1431943995-3344-4-git-send-email-feng.wu@intel.com>
On Mon, 18 May 2015, Feng Wu wrote:
> diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h
> index 0f5fb6b..9866065 100644
> --- a/arch/x86/include/asm/hardirq.h
> +++ b/arch/x86/include/asm/hardirq.h
> @@ -14,6 +14,7 @@ typedef struct {
> #endif
> #ifdef CONFIG_HAVE_KVM
> unsigned int kvm_posted_intr_ipis;
> + unsigned int kvm_posted_intr_wakeup_ipis;
So now we have another IPI with statistics and nothing which makes it
accessible. kvm_posted_intr_ipis lacks a printout in
arch_show_interrupts() as well.
> #ifdef CONFIG_HAVE_KVM
> +void (*wakeup_handler_callback)(void);
> +EXPORT_SYMBOL_GPL(wakeup_handler_callback);
> +
The naming sucks. Which wakeup?
As this is kvm specific, it should have a kvm_ prefix. And it should
tell what it actually does:
kvm_posted_intr_wakeup_handler
Hmm?
> /*
> * Handler for POSTED_INTERRUPT_VECTOR.
> */
> @@ -256,6 +259,26 @@ __visible void smp_kvm_posted_intr_ipi(struct pt_regs *regs)
>
> set_irq_regs(old_regs);
> }
> +
> +/*
> + * Handler for POSTED_INTERRUPT_WAKEUP_VECTOR.
> + */
> +__visible void smp_kvm_posted_intr_wakeup_ipi(struct pt_regs *regs)
> +{
> + struct pt_regs *old_regs = set_irq_regs(regs);
> +
> + entering_ack_irq();
> +
> + inc_irq_stat(kvm_posted_intr_wakeup_ipis);
> +
> + if (wakeup_handler_callback)
> + wakeup_handler_callback();
Why do we need a conditional here?
staic void dummy_handler(void) { }
static void *kvm_posted_intr_wakeup_handler = dummy_handler;
void kvm_set_posted_intr_wakeup_handler(void (*handler)(void))
{
if (handler)
kvm_posted_intr_wakeup_handler = handler;
else
kvm_posted_intr_wakeup_handler = dummy_handler;
}
avoids the conditional in the exception handler....
Thanks,
tglx
next prev parent reply other threads:[~2015-05-18 14:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-18 10:13 [v5 0/3] prerequisite changes for VT-d posted-interrupts Feng Wu
2015-05-18 10:13 ` [v5 1/3] genirq: Introduce irq_set_vcpu_affinity() to target an interrupt to a VCPU Feng Wu
2015-05-18 10:13 ` [v5 2/3] x86, irq: Implement irq_set_vcpu_affinity for pci_msi_ir_controller Feng Wu
2015-05-18 10:13 ` [v5 3/3] x86, irq: Define a global vector for VT-d Posted-Interrupts Feng Wu
2015-05-18 14:17 ` Thomas Gleixner [this message]
2015-05-19 1:58 ` Wu, Feng
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=alpine.DEB.2.11.1505181606380.4225@nanos \
--to=tglx@linutronix.de \
--cc=feng.wu@intel.com \
--cc=hpa@zytor.com \
--cc=jiang.liu@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@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
all inboxes | Powered by JetHome®