Skip to content

genirq: Sanitize irq_set_affinity callbacks

Thomas Gleixner linux-ia64 lkml xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5ia64: Validate online cpus in irq_set_affinity() callbacksarch/ia64/kernel/msi_ia64.c arch/ia64/sn/kernel/irq.c arch/ia64/sn/kernel/msi_sn.c+4 -70 replies
2/5mips: Validate online cpus in irq_set_affinity() callbacksarch/mips/sibyte/bcm1480/irq.c arch/mips/sibyte/sb1250/irq.c+2 -22 replies
3/5parisc: Validate online cpus in irq_set_affinity() callbacksarch/parisc/kernel/irq.c+1 -10 replies
4/5xen: Validate online cpus in set_affinitydrivers/xen/events/events_base.c+1 -12 replies
5/5irqchip: armanda: Sanitize set_irq_affinity()drivers/irqchip/irq-armada-370-xp.c+5 -339 replies

Reviews trailers per patch

2 of 5 patches have a Reviewed-by or Acked-by.

PatchDavid VrabelGregory CLEMENT
1/5
2/5
3/5
4/5R-b R-b
5/5A-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [patch 0/5] genirq: Sanitize irq_set_affinity callbacks

In my last tree wide sweep of irq controller related oddities I discovered that some controllers have an broken implementation versus selecting a single target cpu from the given cpu mask.

The core merily guarantees that at least one of the cpus in the mask is online.

If the controller callback does not restrict the search for a single target to the online cpus it might run into the following situation:

     Assume 4 cores online: online mask = 0x0f

     Offline Core 1 	    online mask = 0x0d

     Set affinity to 0xe    is valid due to online mask 0xd

     cpumask_first(0xe)     picks core 1, which is offline

The following series takes care of this. The patches should be tagged stable if there are no objections.

I'm pondering to extend the core functionality to select a target cpu before calling into irq_set_affinity() to prevent future copy and paste failures and get rid of all the duplicated code.

Thanks,

tglx