lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 19 May 2015 01:58:10 +0000
From:	"Wu, Feng" <feng.wu@...el.com>
To:	Thomas Gleixner <tglx@...utronix.de>
CC:	"mingo@...hat.com" <mingo@...hat.com>,
	"hpa@...or.com" <hpa@...or.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"jiang.liu@...ux.intel.com" <jiang.liu@...ux.intel.com>,
	"Wu, Feng" <feng.wu@...el.com>
Subject: RE: [v5 3/3] x86, irq: Define a global vector for VT-d
 Posted-Interrupts



> -----Original Message-----
> From: Thomas Gleixner [mailto:tglx@...utronix.de]
> Sent: Monday, May 18, 2015 10:18 PM
> To: Wu, Feng
> Cc: mingo@...hat.com; hpa@...or.com; linux-kernel@...r.kernel.org;
> jiang.liu@...ux.intel.com
> Subject: Re: [v5 3/3] x86, irq: Define a global vector for VT-d Posted-Interrupts
> 
> 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.
> 

I will add the printouts for these two IPIs.

> >  #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?

Good suggestion!

> 
> >  /*
> >   * 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....

Got it. Conditional branch in a critical path is really a bad thing...

Thanks,
Feng

> 
> Thanks,
> 
> 	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ