Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932143AbbERORs (ORCPT ); Mon, 18 May 2015 10:17:48 -0400 Received: from www.linutronix.de ([62.245.132.108]:49392 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932073AbbERORq (ORCPT ); Mon, 18 May 2015 10:17:46 -0400 Date: Mon, 18 May 2015 16:17:47 +0200 (CEST) From: Thomas Gleixner To: Feng Wu 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 In-Reply-To: <1431943995-3344-4-git-send-email-feng.wu@intel.com> Message-ID: References: <1431943995-3344-1-git-send-email-feng.wu@intel.com> <1431943995-3344-4-git-send-email-feng.wu@intel.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1988 Lines: 74 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/