<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/irq/proc.c, branch v3.19</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.19</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.19'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-12-13T12:33:07Z</updated>
<entry>
<title>genirq: Prevent proc race against freeing of irq descriptors</title>
<updated>2014-12-13T12:33:07Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2014-12-11T22:01:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c291ee622165cb2c8d4e7af63fffd499354a23be'/>
<id>urn:sha1:c291ee622165cb2c8d4e7af63fffd499354a23be</id>
<content type='text'>
Since the rework of the sparse interrupt code to actually free the
unused interrupt descriptors there exists a race between the /proc
interfaces to the irq subsystem and the code which frees the interrupt
descriptor.

CPU0				CPU1
				show_interrupts()
				  desc = irq_to_desc(X);
free_desc(desc)
  remove_from_radix_tree();
  kfree(desc);
				  raw_spinlock_irq(&amp;desc-&gt;lock);

/proc/interrupts is the only interface which can actively corrupt
kernel memory via the lock access. /proc/stat can only read from freed
memory. Extremly hard to trigger, but possible.

The interfaces in /proc/irq/N/ are not affected by this because the
removal of the proc file is serialized in procfs against concurrent
readers/writers. The removal happens before the descriptor is freed.

For architectures which have CONFIG_SPARSE_IRQ=n this is a non issue
as the descriptor is never freed. It's merely cleared out with the irq
descriptor lock held. So any concurrent proc access will either see
the old correct value or the cleared out ones.

Protect the lookup and access to the irq descriptor in
show_interrupts() with the sparse_irq_lock.

Provide kstat_irqs_usr() which is protecting the lookup and access
with sparse_irq_lock and switch /proc/stat to use it.

Document the existing kstat_irqs interfaces so it's clear that the
caller needs to take care about protection. The users of these
interfaces are either not affected due to SPARSE_IRQ=n or already
protected against removal.

Fixes: 1f5a5b87f78f "genirq: Implement a sane sparse_irq allocator"
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>genirq: procfs: Make smp_affinity values go+r</title>
<updated>2014-03-19T11:34:29Z</updated>
<author>
<name>Chema Gonzalez</name>
<email>chema@google.com</email>
</author>
<published>2014-03-14T02:50:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bab5c790cc64adb1ede54b4077444375108ac8da'/>
<id>urn:sha1:bab5c790cc64adb1ede54b4077444375108ac8da</id>
<content type='text'>
Includes:
- /proc/irq/default_smp_affinity
- /proc/irq/*/affinity_hint
- /proc/irq/*/smp_affinity
- /proc/irq/*/smp_affinity_list

Users can distill the same information by reading /proc/interrupts.

Signed-off-by: Chema Gonzalez &lt;chema@google.com&gt;
Cc: Eric Dumazet &lt;edumazet@google.com&gt;
Link: http://lkml.kernel.org/r/1394765455-1217-1-git-send-email-chema@google.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>irqdomain: Include hwirq number in /proc/interrupts</title>
<updated>2013-06-24T13:02:42Z</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@secretlab.ca</email>
</author>
<published>2012-01-26T23:29:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c12d2f42a96d72cffa4d9335ca455a2243333c79'/>
<id>urn:sha1:c12d2f42a96d72cffa4d9335ca455a2243333c79</id>
<content type='text'>
Add the hardware interrupt number to the output of /proc/interrupts.
It is often important to have access to the hardware interrupt number because
it identifies exactly how an interrupt signal is wired up to the interrupt
controller.  This is especially important when using irq_domains since irq
numbers get dynamically allocated in that case, and have no relation to the
actual hardware number.

Note: This output is currently conditional on whether or not the irq_domain
pointer is set; however hwirq could still be used without irq_domain.  It
may be worthwhile to always output the hwirq number regardless of the
domain pointer.

Signed-off-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Tested-by: Olof Johansson &lt;olof@lixom.net&gt;
Cc: Ben Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>proc: Supply a function to remove a proc entry by PDE</title>
<updated>2013-05-01T21:29:46Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2013-04-12T16:27:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a8ca16ea7b0abb0a7e49492d1123b715f0ec62e8'/>
<id>urn:sha1:a8ca16ea7b0abb0a7e49492d1123b715f0ec62e8</id>
<content type='text'>
Supply a function (proc_remove()) to remove a proc entry (and any subtree
rooted there) by proc_dir_entry pointer rather than by name and (optionally)
root dir entry pointer.  This allows us to eliminate all remaining pde-&gt;name
accesses outside of procfs.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Grant Likely &lt;grant.likely@linaro.or&gt;
cc: linux-acpi@vger.kernel.org
cc: openipmi-developer@lists.sourceforge.net
cc: devicetree-discuss@lists.ozlabs.org
cc: linux-pci@vger.kernel.org
cc: netdev@vger.kernel.org
cc: netfilter-devel@vger.kernel.org
cc: alsa-devel@alsa-project.org
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>procfs: new helper - PDE_DATA(inode)</title>
<updated>2013-04-09T18:13:32Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2013-03-31T22:16:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d9dda78bad879595d8c4220a067fc029d6484a16'/>
<id>urn:sha1:d9dda78bad879595d8c4220a067fc029d6484a16</id>
<content type='text'>
The only part of proc_dir_entry the code outside of fs/proc
really cares about is PDE(inode)-&gt;data.  Provide a helper
for that; static inline for now, eventually will be moved
to fs/proc, along with the knowledge of struct proc_dir_entry
layout.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>new helper: file_inode(file)</title>
<updated>2013-02-23T04:31:31Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2013-01-23T22:07:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=496ad9aa8ef448058e36ca7a787c61f2e63f0f54'/>
<id>urn:sha1:496ad9aa8ef448058e36ca7a787c61f2e63f0f54</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>irq: Remove smp_affinity_list when unregister irq proc</title>
<updated>2011-05-26T11:15:28Z</updated>
<author>
<name>Yinghai Lu</name>
<email>yinghai@kernel.org</email>
</author>
<published>2011-05-26T05:09:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=def945eeb920b94e710574454043f080831aefe5'/>
<id>urn:sha1:def945eeb920b94e710574454043f080831aefe5</id>
<content type='text'>
commit 4b06042(bitmap, irq: add smp_affinity_list interface to
/proc/irq) causes the following warning:

[  274.239500] WARNING: at fs/proc/generic.c:850 remove_proc_entry+0x24c/0x27a()
[  274.251761] remove_proc_entry: removing non-empty directory 'irq/184',
    	       leaking at least 'smp_affinity_list'

Remove the new file in the exit path.

Signed-off-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Cc: Mike Travis &lt;travis@sgi.com&gt;
Link: http://lkml.kernel.org/r/4DDDE094.6050505@kernel.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>bitmap, irq: add smp_affinity_list interface to /proc/irq</title>
<updated>2011-05-25T15:39:45Z</updated>
<author>
<name>Mike Travis</name>
<email>travis@sgi.com</email>
</author>
<published>2011-05-25T00:13:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4b060420a596095869a6d7849caa798d23839cd1'/>
<id>urn:sha1:4b060420a596095869a6d7849caa798d23839cd1</id>
<content type='text'>
Manually adjusting the smp_affinity for IRQ's becomes unwieldy when the
cpu count is large.

Setting smp affinity to cpus 256 to 263 would be:

	echo 000000ff,00000000,00000000,00000000,00000000,00000000,00000000,00000000 &gt; smp_affinity

instead of:

	echo 256-263 &gt; smp_affinity_list

Think about what it looks like for cpus around say, 4088 to 4095.

We already have many alternate "list" interfaces:

/sys/devices/system/cpu/cpuX/indexY/shared_cpu_list
/sys/devices/system/cpu/cpuX/topology/thread_siblings_list
/sys/devices/system/cpu/cpuX/topology/core_siblings_list
/sys/devices/system/node/nodeX/cpulist
/sys/devices/pci***/***/local_cpulist

Add a companion interface, smp_affinity_list to use cpu lists instead of
cpu maps.  This conforms to other companion interfaces where both a map
and a list interface exists.

This required adding a bitmap_parselist_user() function in a manner
similar to the bitmap_parse_user() function.

[akpm@linux-foundation.org: make __bitmap_parselist() static]
Signed-off-by: Mike Travis &lt;travis@sgi.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jack Steiner &lt;steiner@sgi.com&gt;
Cc: Lee Schermerhorn &lt;lee.schermerhorn@hp.com&gt;
Cc: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>genirq: Fix typo CONFIG_GENIRC_IRQ_SHOW_LEVEL</title>
<updated>2011-05-02T19:16:37Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2011-04-30T20:56:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=94b2c363dcf732a4edab4ed66041cb36e7f28fbf'/>
<id>urn:sha1:94b2c363dcf732a4edab4ed66041cb36e7f28fbf</id>
<content type='text'>
commit ab7798ffcf98b11a9525cf65bacdae3fd58d357f ("genirq: Expand generic
show_interrupts()") added the Kconfig option GENERIC_IRQ_SHOW_LEVEL to
accomodate PowerPC, but this doesn't actually enable the functionality due
to a typo in the #ifdef check.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: Linux/PPC Development &lt;linuxppc-dev@lists.ozlabs.org&gt;
Link: http://lkml.kernel.org/r/%3Calpine.DEB.2.00.1104302251370.19068%40ayla.of.borg%3E
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>alpha: Use generic show_interrupts()</title>
<updated>2011-03-29T12:47:58Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2011-03-25T21:20:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a6e120ed42004d6051fff7c3233e2554f12ccecb'/>
<id>urn:sha1:a6e120ed42004d6051fff7c3233e2554f12ccecb</id>
<content type='text'>
The only subtle difference is that alpha uses ACTUAL_NR_IRQS and
prints the IRQF_DISABLED flag.

Change the generic implementation to deal with ACTUAL_NR_IRQS if
defined.

The IRQF_DISABLED printing is pointless, as we nowadays run all
interrupts with irqs disabled.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
</feed>
