mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [GIT pull] irq/urgent for v6.12-rc6
@ 2024-11-03 10:30 Thomas Gleixner
  2024-11-03 10:31 ` [GIT pull] perf/urgent " Thomas Gleixner
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Thomas Gleixner @ 2024-11-03 10:30 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, x86

Linus,

please pull the latest irq/urgent branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq-urgent-2024-11-03

up to:  e6c24e2d05bb: irqchip/gic-v4: Correctly deal with set_affinity on lazily-mapped VPEs

Two fixes for the interrupt subsystem:

  - Fix an off-by-one error in the failure path of msi_domain_alloc(),
    which causes the cleanup loop to terminate early and leaking the first
    allocated interrupt.

  - Handle a corner case in GIC-V4 versus a lazily mapped Virtual
    Processing Element (VPE). If the VPE has not been mapped because the
    guest has not yet emitted a mapping command, then the set_affinity()
    callback returns an error code, which causes the vCPU management to fail.

    Return success in this case without touching the hardware. This will be
    done later when the guest issues the mapping command.


Thanks,

	tglx

------------------>
Jinjie Ruan (1):
      genirq/msi: Fix off-by-one error in msi_domain_alloc()

Marc Zyngier (1):
      irqchip/gic-v4: Correctly deal with set_affinity on lazily-mapped VPEs


 drivers/irqchip/irq-gic-v3-its.c | 14 ++++++++++++--
 kernel/irq/msi.c                 |  2 +-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index ab597e74ba08..52f625e07658 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -3810,8 +3810,18 @@ static int its_vpe_set_affinity(struct irq_data *d,
 	 * Check if we're racing against a VPE being destroyed, for
 	 * which we don't want to allow a VMOVP.
 	 */
-	if (!atomic_read(&vpe->vmapp_count))
-		return -EINVAL;
+	if (!atomic_read(&vpe->vmapp_count)) {
+		if (gic_requires_eager_mapping())
+			return -EINVAL;
+
+		/*
+		 * If we lazily map the VPEs, this isn't an error and
+		 * we can exit cleanly.
+		 */
+		cpu = cpumask_first(mask_val);
+		irq_data_update_effective_affinity(d, cpumask_of(cpu));
+		return IRQ_SET_MASK_OK_DONE;
+	}
 
 	/*
 	 * Changing affinity is mega expensive, so let's be as lazy as
diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index 3a24d6b5f559..396a067a8a56 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -718,7 +718,7 @@ static int msi_domain_alloc(struct irq_domain *domain, unsigned int virq,
 		ret = ops->msi_init(domain, info, virq + i, hwirq + i, arg);
 		if (ret < 0) {
 			if (ops->msi_free) {
-				for (i--; i > 0; i--)
+				for (i--; i >= 0; i--)
 					ops->msi_free(domain, info, virq + i);
 			}
 			irq_domain_free_irqs_top(domain, virq, nr_irqs);


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-11-03 18:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-03 10:30 [GIT pull] irq/urgent for v6.12-rc6 Thomas Gleixner
2024-11-03 10:31 ` [GIT pull] perf/urgent " Thomas Gleixner
2024-11-03 18:29   ` pr-tracker-bot
2024-11-03 10:31 ` [GIT pull] sched/urgent " Thomas Gleixner
2024-11-03 18:29   ` pr-tracker-bot
2024-11-03 10:31 ` [GIT pull] timers/urgent " Thomas Gleixner
2024-11-03 18:29   ` pr-tracker-bot
2024-11-03 10:31 ` [GIT pull] x86/urgent " Thomas Gleixner
2024-11-03 18:29   ` pr-tracker-bot
2024-11-03 18:29 ` [GIT pull] irq/urgent " pr-tracker-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®