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]
Message-ID: <20160708235846.GA3529@lerouge>
Date:	Sat, 9 Jul 2016 01:58:47 +0200
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Rik van Riel <riel@...hat.com>
Cc:	Paolo Bonzini <pbonzini@...hat.com>, linux-kernel@...r.kernel.org,
	peterz@...radead.org, mingo@...nel.org, fweisbec@...hat.com,
	wanpeng.li@...mail.com, efault@....de, tglx@...utronix.de,
	rkrcmar@...hat.com
Subject: Re: [PATCH 4/4] irqtime: drop local_irq_save/restore from
 irqtime_account_irq

On Fri, Jul 08, 2016 at 11:56:49AM -0400, Rik van Riel wrote:
> On Fri, 2016-07-08 at 16:34 +0200, Paolo Bonzini wrote:
> > I'm looking at an upstream tree, without your patches applied,
> > but it seems to me that irqtime_account_irq is always called with
> > interrupts disabled:
> > 
> > irqtime_account_irq
> > 	-> account_irq_enter_time
> > 		-> __irq_enter
> > 			-> HARDIRQ_ENTER	[1]
> > 			-> irq_enter		[3]
> > 		-> __do_softirq			[1]
> > 	-> account_irq_exit_time
> > 		-> __do_softirq			[1]
> > 		-> __irq_exit
> > 			-> HARDIRQ_EXIT		[1]
> > 		-> irq_exit			[2]
> > 
> > 	[1] = does local_irq_disable/enable
> > 	[2] = contains WARN_ON_ONCE(!irqs_disabled())
> > 	[3] = calls rcu_irq_enter(), which checks irqs_disabled()
> > 
> > I don't think your first two patches change this, so perhaps it's
> > enough
> > to remove that local_irq-save/restore?  Either this, or
> > ENEEDWEEKEND...

Good catch Paolo!

> 
> I think you are right!
> 
> __do_softirq() calls account_irq_enter_time() with irqs
> already disabled, and also has irqs disabled when it
> calls account_irq_exit_time()
> 
> This appears to be true for both ksoftirqd and softirq
> from irq context.

Indeed! And irq_enter()/irq_exit() have irqs disabled requirements.

The other users are __irq_enter() and __irq_exit() called by
lockdep selftests which takes care about it too.

I just did a boot test with a WARN_ON_ONCE(!irqs_disabled())
on account_irq_enter_time() and it triggered no issue.

> 
> This could simplify my patch series a lot :)

Definetly! ;-)

Would you mind resending it?

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ