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:	Sun, 12 Oct 2008 19:12:11 -0400
From:	Arjan van de Ven <arjan@...radead.org>
To:	Andrey Borzenkov <arvidjaar@...l.ru>
Cc:	Oliver Neukum <oliver@...kum.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: when spin_lock_irq (as opposed to spin_lock_irqsave) is
 appropriate?

On Sun, 12 Oct 2008 15:48:00 +0400
Andrey Borzenkov <arvidjaar@...l.ru> wrote:

> On Saturday 11 October 2008, Arjan van de Ven wrote:
> [... very useful explanation omitted ...]
> > Does this answer your question?
> > 
> 
> As Oliver pointed out, part of confusion wa my asumption that _irqsave
> verion saves actual interrupt mask. It actually does not.
> 
> This leaves me with a question - how can I know whether interrupts may
> (not) be disabled at particular point? 

the _irq versions mask the interrupts in the *cpu*!
Not in the hw.
All CPUs have a flag that says "don't give me interrupts right now
please", and the spin_lock_irq(save) functions work on that flag.
And they block all interrupts (except NMI's, which are very special)

> In particular, is it safe to 
> assume that any place marked at "code may sleep" has interrupts
> enabled?

yes.
That's a good rule of thumb ;-)
Anything else is a lot of "depends"



-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org
--
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