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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 3 Feb 2009 15:13:09 -0800 (PST)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
cc:	Ingo Molnar <mingo@...e.hu>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Jesse Barnes <jesse.barnes@...el.com>,
	Andreas Schwab <schwab@...e.de>, Len Brown <lenb@...nel.org>
Subject: Re: PCI PM: Restore standard config registers of all devices early



On Tue, 3 Feb 2009, Rafael J. Wysocki wrote:
> > 
> >         struct irq_desc *desc;
> >         int irq;
> > 
> >         for_each_irq_desc(i, desc) {
> > 	...
> > 	}
> > 
> > should do the trick.
> 
> So, what do I do in the loop to disable irqs for all devices on the IOAPIC
> level.  Would disable_irq(irq) be sufficient?

Yes. It literally should be something as simple as

	void disable_device_irqs(void)
	{
		struct irq_desc *desc;
		int i;

		for_each_irq_desc(i, desc)
			disable_irq(i);
	}

	void enable_device_irqs(void)
	{
		struct irq_desc *desc;
		int i;

		for_each_irq_desc(i, desc)
			enable_irq(i);
	}

although we might do something smarter eventually (ie start adding tests 
for specific flags etc - at that point we'll also need to mark which 
interrupts we've disabled so that we get the disable/enable nesting 
right).

And it probably makes sense to do this inside kernel/irq/manage.c or 
similar, since any extensions are going to be very aware of irq internals. 
For example, the thing might well end up taking the desc->lock and peek 
inside the descriptor to see if it's really a "device" interrupt or a 
"system" interrupt etc.

		Linus
--
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