[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260109175227.1136782-1-rrendec@redhat.com>
Date: Fri, 9 Jan 2026 12:52:27 -0500
From: Radu Rendec <rrendec@...hat.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Manivannan Sadhasivam <mani@...nel.org>,
Daniel Tsai <danielsftsai@...gle.com>,
Marek Behún <kabel@...nel.org>,
Krishna Chaitanya Chundru <quic_krichai@...cinc.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Rob Herring <robh@...nel.org>,
Krzysztof Wilczyński <kwilczynski@...nel.org>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Jingoo Han <jingoohan1@...il.com>,
Brian Masney <bmasney@...hat.com>,
Eric Chanudet <echanude@...hat.com>,
Alessandro Carminati <acarmina@...hat.com>,
Jared Kangas <jkangas@...hat.com>,
Jon Hunter <jonathanh@...dia.com>,
linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org,
x86@...nel.org,
linux-tegra@...r.kernel.org
Subject: [PATCH] fixup! genirq: Add interrupt redirection infrastructure
The previous version of this patch has two related bugs:
- irq_chip_redirect_set_affinity() doesn't update the effective affinity
mask, which triggers the warning in irq_validate_effective_affinity().
This bug was reported at [1].
- As a result, the cpumask_test_cpu(smp_processor_id(), m) condition in
demux_redirect_remote() is always false, and the interrupt is always
redirected, even if it's already running on the target CPU.
The solution is not ideal because it may lie about the effective
affinity of the demultiplexed ("child") interrupt. If the requested
affinity mask includes multiple CPUs, the effective affinity, in
reality, is the intersection between the requested mask and the
demultiplexing ("parent") interrupt's effective affinity mask, plus
the first CPU in the requested mask.
Accurately describing the effective affinity of the demultiplexed
interrupt is not trivial because it requires keeping track of the
demultiplexing interrupt's effective affinity. That is tricky in the
context of CPU hot(un)plugging, where interrupt migration ordering is
not guaranteed. The solution in the original version of the patch,
which stored the first CPU of the demultiplexing interrupt's effective
affinity in the `target_cpu` field, has its own drawbacks and
limitations.
[1] https://lore.kernel.org/all/44509520-f29b-4b8a-8986-5eae3e022eb7@nvidia.com/
Signed-off-by: Radu Rendec <rrendec@...hat.com>
---
kernel/irq/chip.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 433f1dd2b0ca7..35bc17bc369e0 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -1493,6 +1493,8 @@ int irq_chip_redirect_set_affinity(struct irq_data *data, const struct cpumask *
struct irq_redirect *redir = &irq_data_to_desc(data)->redirect;
WRITE_ONCE(redir->target_cpu, cpumask_first(dest));
+ irq_data_update_effective_affinity(data, dest);
+
return IRQ_SET_MASK_OK;
}
EXPORT_SYMBOL_GPL(irq_chip_redirect_set_affinity);
--
2.52.0
Powered by blists - more mailing lists