summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2019-10-17 13:19:01 +0300
committerBen Hutchings <ben@decadent.org.uk>2020-02-11 23:03:20 +0300
commitfbbb175d91ce384972aa4acd486e560c2330a641 (patch)
tree9d3b817362b738af8be48c4f3d51485c35b59abe /fs
parent2984ad34ceacc0952189227e9a42f63704c8c2ba (diff)
downloadlinux-fbbb175d91ce384972aa4acd486e560c2330a641.tar.xz
x86/ioapic: Prevent inconsistent state when moving an interrupt
commit df4393424af3fbdcd5c404077176082a8ce459c4 upstream. There is an issue with threaded interrupts which are marked ONESHOT and using the fasteoi handler: if (IS_ONESHOT()) mask_irq(); .... cond_unmask_eoi_irq() chip->irq_eoi(); if (setaffinity_pending) { mask_ioapic(); ... move_affinity(); unmask_ioapic(); } So if setaffinity is pending the interrupt will be moved and then unconditionally unmasked at the ioapic level, which is wrong in two aspects: 1) It should be kept masked up to the point where the threaded handler finished. 2) The physical chip state and the software masked state are inconsistent Guard both the mask and the unmask with a check for the software masked state. If the line is marked masked then the ioapic line is also masked, so both mask_ioapic() and unmask_ioapic() can be skipped safely. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sebastian Siewior <bigeasy@linutronix.de> Fixes: 3aa551c9b4c4 ("genirq: add threaded interrupt handler support") Link: https://lkml.kernel.org/r/20191017101938.321393687@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org> [bwh: Backported to 3.16: Keep using {,un}mask_iopaic_irq()] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions