summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorWeitaoWang-oc <WeitaoWang-oc@zhaoxin.com>2026-10-17 02:10:16 +0800
committerBorislav Petkov (AMD) <bp@alien8.de>2026-11-19 20:17:47 -0800
commit068d82afd070beb8ea32c8ee64d685af7d3f36e2 (patch)
treeb15baf019a5cd531d91f4810c66df8623a1d58f7 /kernel
parent0833bc1d4ad71144500f6ca8601672580624f24f (diff)
x86/apic/msi: Fix MSI interrupt affinity configuration
The two step update sequence in msi_set_affinity() is required for MSI interrupts which cannot be migrated atomically, i.e. devices which do not provide MSI masking. The MSI message update writes address and data registers separately, so such a device can raise an interrupt in between, which results in a message built from half updated state: a stray interrupt on a stale vector and a possibly lost device interrupt. The update sequence is selected by a per interrupt quirk flag, which is set for interrupts which cannot use reservation mode. Reservation mode is only enabled for maskable interrupts, i.e. devices which provide MSI-X or mask support, so the quirk flag is the inverse of the reservation mode bit. The removal of the quirk flag replaced the flag check with a reservation mode check, but dropped the negation of the removed condition: - if (!irqd_msi_nomask_quirk(irqd) || ...) + if (!irqd_can_reserve(irqd) || ...) As the quirk flag is the inverse of the reservation mode bit, the replacement inverted the condition and selects the wrong update path for every interrupt: non-maskable interrupts take the direct update path again, which reopens the race, while maskable interrupts needlessly go through the two step update. Restore the original condition so that the direct update path is selected when reservation mode is enabled, which also matches the comment above the check: direct update is possible when the MSI is maskable, which is the case when the reservation mode bit is set. [ bp: Massage commit message. ] Fixes: b56ebe7c896d ("x86/apic/msi: Fix misconfigured non-maskable MSI quirk") Signed-off-by: Weitao Wang <WeitaoWang-oc@zhaoxin.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Koichiro Den <den@valinux.co.jp> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@vger.kernel.org # v6.1+ Link: https://patch.msgid.link/20261016181016.3850-1-WeitaoWang-oc@zhaoxin.com
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions