From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 4D81025A2DD;
	Tue, 28 Jul 2026 13:51:33 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1785246694; cv=none; b=Wbaw1njpvE0U37QA2nZTaUBDPIy5cbMAlQtC+f12R/WM7tzTK2qD5smkex1D48z/pBtNiriGVwjplJUsB8VfW5D28Mx/n0a+MIPlfhXAyGECqdkqvowrijwcVr5FhMCVCPuQPVUtT+C/nqOjgoTFuYITjBNenn4rrrSGImGvKrs=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1785246694; c=relaxed/simple;
	bh=hRvBtimUkN5HTwmrRjs1Te44eljEyxGDej4qebzkedw=;
	h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pXJU9Eazjj6w0G3D/Xk4IZFZkLyZcy36ibLjRwSY01gOnKc4UQR0VlY/3nIs7WX+ew6OfS1GwaSJxyMY+HBtRnZyUjwWT3qKW4AJu3qwh6j2hzLNuGlPFTE0zZMNzRjTmz492zwEIn2NXb9z3/K4tSjI6APWe8hy+8UmPllLh/Q=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=l4YGstsG; arc=none smtp.client-ip=13.77.154.182
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="l4YGstsG"
Received: from CPC-namja-026ON.redmond.corp.microsoft.com (unknown [4.213.232.16])
	by linux.microsoft.com (Postfix) with ESMTPSA id 265D920B7166;
	Tue, 28 Jul 2026 06:51:04 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 265D920B7166
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1785246671;
	bh=/s0NBGO5Nwu0FBhXzB5m3wygkVQ4fkuc2i5s5t6+ff8=;
	h=From:To:Cc:Subject:Date:From;
	b=l4YGstsGT9GrJUEivZR6SFeqwFcVYMDy4+eExl4Z2eLoduQlU5K0LedDFa9IOEGFv
	 dsPEQjC/cLtgve4mikobwwFImpSnuR4vr2hmcETQcZoziVISfInzbR+kT5Ox30yPYv
	 u1RmwnnetKzXldrOkptQy5HhbUbmgOprGkIbwmeY=
From: Naman Jain <namjain@linux.microsoft.com>
To: "K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Long Li <longli@microsoft.com>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	=?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Joerg Roedel (AMD)" <joro@8bytes.org>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Vasant Hegde <vasant.hegde@amd.com>,
	Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>
Cc: x86@kernel.org,
	Jake Oshins <jakeo@microsoft.com>,
	linux-hyperv@vger.kernel.org,
	linux-pci@vger.kernel.org,
	iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/3] x86/irq: Fix lost interrupts on CPU hot-unplug for Hyper-V PCI/MSI
Date: Tue, 28 Jul 2026 13:51:14 +0000
Message-ID: <20260728135117.2888175-1-namjain@linux.microsoft.com>
X-Mailer: git-send-email 2.43.0
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

On CPU hot-unplug, fixup_irqs() re-injects interrupts that are still
pending in the outgoing CPU's IRR via the irqchip's irq_retrigger()
callback. The Hyper-V vPCI MSI irqchip never installs one, so such a
pending interrupt is silently dropped, leading to lost interrupts, stalls
and "No irq handler for vector" messages.

Patch 1 is the minimal, backportable fix (Fixes:/Cc: stable) that installs
irq_chip_retrigger_hierarchy() on the Hyper-V PCI/MSI chip. Patch 2 then
switches fixup_irqs() to call irq_chip_retrigger_hierarchy() directly, so
the retrigger works for any stacked irqchip without a per-chip callback.
Patch 3 drops the now-redundant irq_retrigger() initializations.
This way, patch 2 and 3 do not need to be backported.

The series follows the original RFC:
Link: https://lore.kernel.org/all/87y0f3jhd6.ffs@fw13/

Naman Jain (3):
  PCI: hv: Set irq_retrigger callback for the Hyper-V PCI MSI irqchip
  x86/irq: Use irq_chip_retrigger_hierarchy() in fixup_irqs()
  x86/irq, iommu/amd, PCI: Drop redundant irq_retrigger inits

 arch/x86/kernel/apic/io_apic.c |  2 --
 arch/x86/kernel/apic/msi.c     |  4 +---
 arch/x86/kernel/hpet.c         |  1 -
 arch/x86/kernel/irq.c          | 23 +++++++----------------
 drivers/iommu/amd/init.c       |  1 -
 5 files changed, 8 insertions(+), 23 deletions(-)


base-commit: 0d33d21e47d9dc66f91e44da3fc9220c74d93df7
-- 
2.43.0


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A37F43CE5C;
	Tue, 28 Jul 2026 13:51:34 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1785246695; cv=none; b=QE48/v3DxZFT2JDAMxaaLdYO3pVrQPgZrNQaWxjktpy1kvYG2/gcy8Js4vMUXC2Y5RZYLoKWyTqzN03ANm5++lz0T/UFaEUQV4R9yaPwMdpr1W3770kt1wVR9DZOCYQUzHTh/uwAtsClvhSii5ug0SYkypqV8g4554ma+Z/lIwo=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1785246695; c=relaxed/simple;
	bh=5XfQmj805/XmiwOZ8dqmwgSoMzSq/PTJ7qFVAPkLUYk=;
	h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
	 MIME-Version; b=KCcH+GIk94hYzsQE0x/PAJ52oXItkSgR7wiM/sqcmcRxRrSiPkwwf1aZTLLmxDYG2SJ+RVwnQ0DsBP+6rSvlB6x9I7+U6BS7jcfhK7k7X/0f/JutnzYAjZP2J+bkdmrQMZ9Pk6YgzFc8B8L04tgxUYLtTI609R90QiTv8hLkfwk=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=eQcWfq3x; arc=none smtp.client-ip=13.77.154.182
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="eQcWfq3x"
Received: from CPC-namja-026ON.redmond.corp.microsoft.com (unknown [4.213.232.16])
	by linux.microsoft.com (Postfix) with ESMTPSA id BF14220B7168;
	Tue, 28 Jul 2026 06:51:11 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BF14220B7168
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1785246677;
	bh=x+f3kT6JGkrjwjmkavcLs41l6RxRSv37aRvm486yieA=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=eQcWfq3xcHHAfAgO0vzNOBIGMS1bwdXHHnmRtUKeigkPvyaxDZdh+SUODqx9pzufI
	 m3DAynjmqGEEHgHk0KQKbKNZN5OMgVmkIyEPGM38bHDTRdLwga0BXYTD8pG1v8Ch61
	 gHlNWziInYFbMxi9WMTTHQXcKYHc27c2hV/87Umc=
From: Naman Jain <namjain@linux.microsoft.com>
To: "K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Long Li <longli@microsoft.com>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	=?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Joerg Roedel (AMD)" <joro@8bytes.org>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Vasant Hegde <vasant.hegde@amd.com>,
	Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>
Cc: x86@kernel.org,
	Jake Oshins <jakeo@microsoft.com>,
	linux-hyperv@vger.kernel.org,
	linux-pci@vger.kernel.org,
	iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] PCI: hv: Set irq_retrigger callback for the Hyper-V PCI MSI irqchip
Date: Tue, 28 Jul 2026 13:51:15 +0000
Message-ID: <20260728135117.2888175-2-namjain@linux.microsoft.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260728135117.2888175-1-namjain@linux.microsoft.com>
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The Hyper-V vPCI MSI irqchip never installs an irq_retrigger() callback.

On CPU hot-unplug fixup_irqs() migrates the interrupts which are affine to
the outgoing CPU to a new target. If an interrupt still has its pending bit
set in the outgoing CPU's IRR at that point, fixup_irqs() resends it on the
new target through the irqchip's irq_retrigger() callback. As the Hyper-V
PCI/MSI chip does not provide that callback, the pending interrupt is
silently dropped, which can result in lost interrupts, stalls and "No irq
handler for vector" messages during CPU hotplug.

Install irq_chip_retrigger_hierarchy() as the irq_retrigger() callback for
the Hyper-V PCI/MSI irqchip, so that a pending interrupt is resent on its
new target CPU via the parent x86 vector domain.

Fixes: 4daace0d8ce85 ("PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs")
Cc: stable@vger.kernel.org
Suggested-by: Long Li <longli@microsoft.com>
Suggested-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
---
 drivers/pci/controller/pci-hyperv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
index cfc8fa403dad6..89816a2bd7cd3 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -2119,6 +2119,7 @@ static bool hv_pcie_init_dev_msi_info(struct device *dev, struct irq_domain *dom
 	info->ops->msi_prepare = hv_msi_prepare;
 
 	chip->irq_set_affinity = irq_chip_set_affinity_parent;
+	chip->irq_retrigger = irq_chip_retrigger_hierarchy;
 
 	if (IS_ENABLED(CONFIG_X86))
 		chip->flags |= IRQCHIP_MOVE_DEFERRED;
-- 
2.43.0


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id C28A044781A;
	Tue, 28 Jul 2026 13:51:40 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1785246702; cv=none; b=amHFaKpSVT0ShN/nEcHlKTN+T58Vv6ka636RSnP2HXQ7eWF49HgaOJtdUAesJAgpncvp+xuI6FH6S1ayF8P1rPdfa2sZ1wiSyZR+dJ+Ht+4LqwzDg2PPlJWsvXtLCIl2J6rzNiAC1jjKX8aW86iWkwFIp4MMv77KRHdTEaaTS4I=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1785246702; c=relaxed/simple;
	bh=QvgcEDzH7vdbYHIOWwG0QplV+8kubx/trXs+/73Q3mU=;
	h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
	 MIME-Version; b=OjGzoLXZMLmsTGVmKICrhuCoaZY1AZ+JtXY3d4atYhjwlcNyzw3KWlJtGMH04nWm+A5zmKOhd129zgt0v5tBczNtYvlisqV8cDnNSQ88ajKXCgRq8EM5l2gAP0FWoaA1x5tQYDGfwz1Ch90AqRON8IQIkO/TD5k7GGN64nlt2Vg=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=srd+kvd2; arc=none smtp.client-ip=13.77.154.182
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="srd+kvd2"
Received: from CPC-namja-026ON.redmond.corp.microsoft.com (unknown [4.213.232.16])
	by linux.microsoft.com (Postfix) with ESMTPSA id 62BD620B7167;
	Tue, 28 Jul 2026 06:51:18 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 62BD620B7167
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1785246684;
	bh=zlvUxyl807mpaJz79O/o1LIPTPKyau6tqsEXJXhXpSc=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=srd+kvd2qPgCOwRxTIfJCXfzw7SZdBl3ZhezAfstWuZuSWCyuQZDTIxS+yxZ3C1Kb
	 KzBCdfmJBG2mYfoGXias8ActLNUvtMkLjRjwKgyKGn0DDgqK5REJTIZe7YsS37J17z
	 oWgIxvfGu1ou7s1O7W+Q1R1eGeTj5Il5bXVcHI7k=
From: Naman Jain <namjain@linux.microsoft.com>
To: "K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Long Li <longli@microsoft.com>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	=?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Joerg Roedel (AMD)" <joro@8bytes.org>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Vasant Hegde <vasant.hegde@amd.com>,
	Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>
Cc: x86@kernel.org,
	Jake Oshins <jakeo@microsoft.com>,
	linux-hyperv@vger.kernel.org,
	linux-pci@vger.kernel.org,
	iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] x86/irq: Use irq_chip_retrigger_hierarchy() in fixup_irqs()
Date: Tue, 28 Jul 2026 13:51:16 +0000
Message-ID: <20260728135117.2888175-3-namjain@linux.microsoft.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260728135117.2888175-1-namjain@linux.microsoft.com>
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

fixup_irqs() re-injects a pending interrupt on its new target CPU by
looking at the outermost domain chip and invoking its irq_retrigger()
callback directly. That only works when the outermost chip happens to
install an irq_retrigger() callback, which is not guaranteed for every
irqchip and could lead to lost interrupts on CPU hot-unplug.

Use irq_chip_retrigger_hierarchy() instead, which walks up the interrupt
hierarchy until it finds a chip that implements irq_retrigger().

While at it, move the loop-local variables into the loop scope and use a
scoped guard for desc->lock.

No functional change intended for chips which already provide an
irq_retrigger() callback on the outermost domain.

Suggested-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
---
 arch/x86/kernel/irq.c | 23 +++++++----------------
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 30122f0b3af96..ef1bdd3c4659a 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -466,11 +466,6 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_posted_msi_notification)
 /* A cpu has been removed from cpu_online_mask.  Reset irq affinities. */
 void fixup_irqs(void)
 {
-	unsigned int vector;
-	struct irq_desc *desc;
-	struct irq_data *data;
-	struct irq_chip *chip;
-
 	irq_migrate_all_off_this_cpu();
 
 	/*
@@ -489,22 +484,18 @@ void fixup_irqs(void)
 	 * vector_lock because the cpu is already marked !online, so
 	 * nothing else will touch it.
 	 */
-	for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
-		if (IS_ERR_OR_NULL(__this_cpu_read(vector_irq[vector])))
+	for (unsigned int vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
+		struct irq_desc *desc = __this_cpu_read(vector_irq[vector]);
+
+		if (IS_ERR_OR_NULL(desc))
 			continue;
 
 		if (is_vector_pending(vector)) {
-			desc = __this_cpu_read(vector_irq[vector]);
-
-			raw_spin_lock(&desc->lock);
-			data = irq_desc_get_irq_data(desc);
-			chip = irq_data_get_irq_chip(data);
-			if (chip->irq_retrigger) {
-				chip->irq_retrigger(data);
+			guard(raw_spinlock)(&desc->lock);
+			if (irq_chip_retrigger_hierarchy(&desc->irq_data))
 				__this_cpu_write(vector_irq[vector], VECTOR_RETRIGGERED);
-			}
-			raw_spin_unlock(&desc->lock);
 		}
+
 		if (__this_cpu_read(vector_irq[vector]) != VECTOR_RETRIGGERED)
 			__this_cpu_write(vector_irq[vector], VECTOR_UNUSED);
 	}
-- 
2.43.0


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 1304244781A;
	Tue, 28 Jul 2026 13:51:47 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1785246709; cv=none; b=dOvtAJ4y8FIx6CgBTdQHahTIc9RuMqI1og8qHsSnZ6Eu+fcYBNLekWNeoJkkO5Zp2dhUgfo/XZEzY2+bhk5hc//0PyjszvZkgqoWyTno4nzmT/+uGWntsm+DkD94e+dXImT6VtTkb4yFQ0BnXODLfIYUTGEBjOkxR5zPnszcwl8=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1785246709; c=relaxed/simple;
	bh=F8JqCEUZCnqauzjAs5jZGcc+J0w+8Ob3vvg8pg8CrcE=;
	h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
	 MIME-Version; b=qfE7L/X5LZDW4V0Bycb1ih48Ilq0wYFOzOlcUjuT7OZ7OBC1ah/l4vyFewra3F5mNkM7iWAHMZDYkbX8LYw0DVt01FKIqC8lkLL/Er5p/Ob+xTtv1DG+4/I9lTCCHBaxGoyayyMWHQ7zhNj/erHQelJUHMM1JLMYEuj+jYb6pUM=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=SkVLcSv+; arc=none smtp.client-ip=13.77.154.182
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="SkVLcSv+"
Received: from CPC-namja-026ON.redmond.corp.microsoft.com (unknown [4.213.232.16])
	by linux.microsoft.com (Postfix) with ESMTPSA id 1836420B7166;
	Tue, 28 Jul 2026 06:51:24 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1836420B7166
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1785246691;
	bh=3H7xhAHQ0X63v5hUyk6AAKnVi6DW/8Wo8Qka+XWg7U4=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
	b=SkVLcSv+x+9HiqsVlCLbqAh4TgXJngvclNnvAIGI1S8CLulntsv2u9q9/KJfwIZNf
	 96znWa0cEUTGPb+Say6wpduWvAv+Ons6517mNP7eRnF04iRU6aZr5vOz++QDboQKMM
	 0C4APx1gXZqgtG7IfRffxovF/qoyXp9zqUY62fUU=
From: Naman Jain <namjain@linux.microsoft.com>
To: "K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>,
	Dexuan Cui <decui@microsoft.com>,
	Long Li <longli@microsoft.com>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	=?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Thomas Gleixner <tglx@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Joerg Roedel (AMD)" <joro@8bytes.org>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Vasant Hegde <vasant.hegde@amd.com>,
	Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>
Cc: x86@kernel.org,
	Jake Oshins <jakeo@microsoft.com>,
	linux-hyperv@vger.kernel.org,
	linux-pci@vger.kernel.org,
	iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] x86/irq, iommu/amd, PCI: Drop redundant irq_retrigger inits
Date: Tue, 28 Jul 2026 13:51:17 +0000
Message-ID: <20260728135117.2888175-4-namjain@linux.microsoft.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260728135117.2888175-1-namjain@linux.microsoft.com>
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

With fixup_irqs() now using irq_chip_retrigger_hierarchy() and the generic
resend path (try_retrigger()) already falling back to it, installing
irq_chip_retrigger_hierarchy() as the irq_retrigger() callback on the
outermost domain chips is no longer required. The hierarchy walk reaches
the x86 vector domain's apic_retrigger_irq() for all of these stacked
domain chips.

Remove the now redundant irq_retrigger() initializations from the outermost
domain interrupt chips.
msi_set_affinity() is the only site that invoked the outermost chip's
irq_retrigger() directly. Convert it to irq_chip_retrigger_hierarchy() so
the x86_init_dev_msi_info() initialization can be dropped as well.

No functional change intended.

Suggested-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
---
 arch/x86/kernel/apic/io_apic.c      | 2 --
 arch/x86/kernel/apic/msi.c          | 4 +---
 arch/x86/kernel/hpet.c              | 1 -
 drivers/iommu/amd/init.c            | 1 -
 drivers/pci/controller/pci-hyperv.c | 1 -
 5 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 7d7175d012288..18f49a251f23b 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1857,7 +1857,6 @@ static struct irq_chip ioapic_chip __read_mostly = {
 	.irq_ack		= irq_chip_ack_parent,
 	.irq_eoi		= ioapic_ack_level,
 	.irq_set_affinity	= ioapic_set_affinity,
-	.irq_retrigger		= irq_chip_retrigger_hierarchy,
 	.irq_get_irqchip_state	= ioapic_irq_get_chip_state,
 	.flags			= IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MOVE_DEFERRED |
 				  IRQCHIP_AFFINITY_PRE_STARTUP,
@@ -1871,7 +1870,6 @@ static struct irq_chip ioapic_ir_chip __read_mostly = {
 	.irq_ack		= irq_chip_ack_parent,
 	.irq_eoi		= ioapic_ir_ack_level,
 	.irq_set_affinity	= ioapic_set_affinity,
-	.irq_retrigger		= irq_chip_retrigger_hierarchy,
 	.irq_get_irqchip_state	= ioapic_irq_get_chip_state,
 	.flags			= IRQCHIP_SKIP_SET_WAKE |
 				  IRQCHIP_AFFINITY_PRE_STARTUP,
diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c
index 66bc5d3e79db3..aad2f15eb2176 100644
--- a/arch/x86/kernel/apic/msi.c
+++ b/arch/x86/kernel/apic/msi.c
@@ -137,7 +137,7 @@ msi_set_affinity(struct irq_data *irqd, const struct cpumask *mask, bool force)
 	 * IRR.
 	 */
 	if (lapic_vector_set_in_irr(cfg->vector))
-		irq_data_get_irq_chip(irqd)->irq_retrigger(irqd);
+		irq_chip_retrigger_hierarchy(irqd);
 
 	return ret;
 }
@@ -246,7 +246,6 @@ static bool x86_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
 	info->ops->msi_prepare		= x86_msi_prepare;
 
 	info->chip->irq_ack		= irq_chip_ack_parent;
-	info->chip->irq_retrigger	= irq_chip_retrigger_hierarchy;
 	info->chip->flags		|= IRQCHIP_SKIP_SET_WAKE |
 					   IRQCHIP_AFFINITY_PRE_STARTUP;
 
@@ -313,7 +312,6 @@ static struct irq_chip dmar_msi_controller = {
 	.irq_mask		= dmar_msi_mask,
 	.irq_ack		= irq_chip_ack_parent,
 	.irq_set_affinity	= msi_domain_set_affinity,
-	.irq_retrigger		= irq_chip_retrigger_hierarchy,
 	.irq_compose_msi_msg	= dmar_msi_compose_msg,
 	.irq_write_msi_msg	= dmar_msi_write_msg,
 	.flags			= IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MOVE_DEFERRED |
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 8dc7b710e1250..2bb7a6f466af3 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -509,7 +509,6 @@ static struct irq_chip hpet_msi_controller __ro_after_init = {
 	.irq_mask = hpet_msi_mask,
 	.irq_ack = irq_chip_ack_parent,
 	.irq_set_affinity = msi_domain_set_affinity,
-	.irq_retrigger = irq_chip_retrigger_hierarchy,
 	.irq_write_msi_msg = hpet_msi_write_msg,
 	.flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_AFFINITY_PRE_STARTUP,
 };
diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
index ea3377e61aa5c..0c362e86a09d9 100644
--- a/drivers/iommu/amd/init.c
+++ b/drivers/iommu/amd/init.c
@@ -2468,7 +2468,6 @@ static struct irq_chip intcapxt_controller = {
 	.irq_unmask		= intcapxt_unmask_irq,
 	.irq_mask		= intcapxt_mask_irq,
 	.irq_ack		= irq_chip_ack_parent,
-	.irq_retrigger		= irq_chip_retrigger_hierarchy,
 	.irq_set_affinity       = intcapxt_set_affinity,
 	.irq_set_wake		= intcapxt_set_wake,
 	.flags			= IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_MOVE_DEFERRED,
diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
index 89816a2bd7cd3..cfc8fa403dad6 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -2119,7 +2119,6 @@ static bool hv_pcie_init_dev_msi_info(struct device *dev, struct irq_domain *dom
 	info->ops->msi_prepare = hv_msi_prepare;
 
 	chip->irq_set_affinity = irq_chip_set_affinity_parent;
-	chip->irq_retrigger = irq_chip_retrigger_hierarchy;
 
 	if (IS_ENABLED(CONFIG_X86))
 		chip->flags |= IRQCHIP_MOVE_DEFERRED;
-- 
2.43.0


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD1003FDBFD;
	Tue, 28 Jul 2026 13:59:06 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1785247148; cv=none; b=Xb39t9MDhqWGuaGEfo85Nsik3HCG5atP+sWQPOq+OYkvE9odzz3QnzXYcprpANvcH09v0P4V/pmZmW9eCcD8GV7VYNsWINWqWTFh3Mt1lCupbmnOD7CRCh8kl6g0SC1GJ8rtOc9J5xGhhwEwZviSQ6kwwqhcQbHbbc4/wXbKN9k=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1785247148; c=relaxed/simple;
	bh=0BGI9+S07Rb5M01DwOuDYzDvFZ8d6L5HKRtiyxRjhhk=;
	h=From:Subject:To:Cc:In-Reply-To:References:Content-Type:Date:
	 Message-Id; b=KuUdv7NyufGo9pMcp/n0q4NPRJxSl/LH2sevX31C23Y8fdIQF9GdQxXcAxynhd+M5q9q5moBer6dc9ZxFjF2SYtz2zKI98BHoQaK6I1kekks4PrZD1d3PB/VQPCWXiWnK9aWe+fZBhNI56ih1aDydr0V9/WluSJrlYboZCU8Awc=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=J0m6SUOE; arc=none smtp.client-ip=100.103.45.18
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="J0m6SUOE"
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 130E71F000E9;
	Tue, 28 Jul 2026 13:59:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1785247146;
	bh=0BGI9+S07Rb5M01DwOuDYzDvFZ8d6L5HKRtiyxRjhhk=;
	h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date;
	b=J0m6SUOEJWtW7i1WPUNT/QF4CXZgF6jj1uW52/Y76nx4dBRO3UDdLehkhEmL1pyO1
	 brnSHPKWNhLvYAhCsKzF3xrX2K6mblH28i/WLsrh08fosfvH/hQuvup3tXpwUIzHmn
	 qbDmobzOs6D14bYV1QTpMMkuRG4wuKGfUZBNyro8jV05xKH7GE8dt7f456ypnes5pP
	 qpPPE35O6U8xipfV7DenHs/bwELXYlFZVhtFBtg03eQBTwxnMNMHRTmQ5Ducxji5B4
	 4SBKLnDs/HyLz+3uZ2RjU8IllhTarUv5KCneNKB3C4l0Iqrc8SuL3bcQYRCA4vikWo
	 Otn/UdN2E+1BA==
From: sashiko-bot@kernel.org
Subject: Re: [PATCH 3/3] x86/irq, iommu/amd, PCI: Drop redundant
 irq_retrigger inits
Reply-To: sashiko-reviews@lists.linux.dev
To: "Naman Jain" <namjain@linux.microsoft.com>
Cc: linux-pci@vger.kernel.org, linux-hyperv@vger.kernel.org
In-Reply-To: <20260728135117.2888175-4-namjain@linux.microsoft.com>
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
 <20260728135117.2888175-4-namjain@linux.microsoft.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Date: Tue, 28 Jul 2026 13:59:05 +0000
Message-Id: <20260728135906.130E71F000E9@smtp.kernel.org>
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>

> With fixup_irqs() now using irq_chip_retrigger_hierarchy() and the generic
> resend path (try_retrigger()) already falling back to it, installing
> irq_chip_retrigger_hierarchy() as the irq_retrigger() callback on the
> outermost domain chips is no longer required. The hierarchy walk reaches
> the x86 vector domain's apic_retrigger_irq() for all of these stacked
> domain chips.
>=20
> Remove the now redundant irq_retrigger() initializations from the outermo=
st
> domain interrupt chips.
> msi_set_affinity() is the only site that invoked the outermost chip's
> irq_retrigger() directly. Convert it to irq_chip_retrigger_hierarchy() so
> the x86_init_dev_msi_info() initialization can be dropped as well.
>=20
> No functional change intended.
>=20
> Suggested-by: Thomas Gleixner <tglx@kernel.org>
> Signed-off-by: Naman Jain <namjain@linux.microsoft.com>

Sashiko has reviewed this patch and found no issues. It looks great!

--=20
Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260728135117.2888=
175-1-namjain@linux.microsoft.com?part=3D3


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 04AE543786A;
	Tue, 28 Jul 2026 14:03:24 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1785247406; cv=none; b=aRjcFKiShdtqoCxOAeU7xshlid6/GKWVRNE9k3p7mji0WlKuUsK4fax89TNTCTZYMGHAWAgxGMJsF9vJnx1sOVK6UdBhnYNzrjs0N8U7LzsB83yA1GK46WTHDXRfINjQDXasL+yx4GX/ybjme+oEJSYPwNKlTnWV1iN759+bXhs=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1785247406; c=relaxed/simple;
	bh=T2NU3pmpi+OjQ7/FNVkJg9qIlm9hOemh0FAHOev63IU=;
	h=From:Subject:To:Cc:In-Reply-To:References:Content-Type:Date:
	 Message-Id; b=IhwdbPz2E6KZefCt3+9vkTw5Quba5LESRfwPVoLwbuohAciq/LglmXHyPQvdsoKkoiJOn4NTU+XRhOvZIO+DYtRrewV6/3MAm0aFE/NzyAFduLiiwVx35jG2lyclaLOrXHdoUA/F9YvSxMto3aMBzN8FEToDWihm6dxAo/fXvsw=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oJuQGIPL; arc=none smtp.client-ip=100.103.45.18
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oJuQGIPL"
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 690D11F000E9;
	Tue, 28 Jul 2026 14:03:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1785247404;
	bh=M6AwQ7+MgGHjdLywKtET4of1Hk2KG/OkpgRG/h1rjvE=;
	h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date;
	b=oJuQGIPLRDO68Qfoh7WUaYzK5cMyKQOKYH8FfFmdYIU5i56Sbz7E42+joleFmuOXE
	 gmPStc7xAgKObVUSRrX9C6XqUBENjQwuVt54uWTlk6bNT80TbQDsq1RfHv758WFcKB
	 zs9ZN641HOerhbABaZeKpP0FQaNlK7YcSbGYUdpXYaOtE2CFRhdZZw28o+DpmpVUuu
	 P8ojTZvyso+QKVAA56S5fw/+fKh8sQ7pXDK2d4ai4qxvQ2kPVXN4ymIf4wut4dBgDq
	 CmyjZAR/EmpWMOGyI05iGVh+7Y2OOns6X6qGYbBx52oiPS/YDB5LIgqsjnNmYxBpce
	 7qGSMbjJMp0AA==
From: sashiko-bot@kernel.org
Subject: Re: [PATCH 2/3] x86/irq: Use irq_chip_retrigger_hierarchy() in
 fixup_irqs()
Reply-To: sashiko-reviews@lists.linux.dev
To: "Naman Jain" <namjain@linux.microsoft.com>
Cc: linux-pci@vger.kernel.org, linux-hyperv@vger.kernel.org
In-Reply-To: <20260728135117.2888175-3-namjain@linux.microsoft.com>
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
 <20260728135117.2888175-3-namjain@linux.microsoft.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Date: Tue, 28 Jul 2026 14:03:23 +0000
Message-Id: <20260728140324.690D11F000E9@smtp.kernel.org>
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(=
s) to consider:
- [High] The patch replaces the direct invocation of the outermost chip's i=
rq_retrigger() callback with irq_chip_retrigger_hierarchy(). However, irq_c=
hip_retrigger_hierarchy() initializes its loop with `data =3D data->parent_=
data`, completely skipping the outermost chip. This breaks interrupt retrig=
gering for flat domains (like native lapic_controller) and any hierarchical=
 domain where the outermost chip directly implements the retrigger callback.
--

--- Patch [2]: [PATCH 2/3] x86/irq: Use irq_chip_retrigger_hierarchy() in f=
ixup_irqs() ---
commit f97e883de2f6626561de48c426194caa41c3e062
Author: Naman Jain <namjain@linux.microsoft.com>
x86/irq: Use irq_chip_retrigger_hierarchy() in fixup_irqs()

This commit modifies fixup_irqs() to use irq_chip_retrigger_hierarchy()
instead of invoking the outermost domain chip's irq_retrigger() callback
directly. It also refactors the loop to use scoped guards for the irq
descriptor lock.

> diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
> index 30122f0b3af96..ef1bdd3c4659a 100644
> --- a/arch/x86/kernel/irq.c
> +++ b/arch/x86/kernel/irq.c
[ ... ]
> @@ -489,22 +484,18 @@ void fixup_irqs(void)
[ ... ]
> -	for (vector =3D FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
> -		if (IS_ERR_OR_NULL(__this_cpu_read(vector_irq[vector])))
> +	for (unsigned int vector =3D FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS=
; vector++) {
> +		struct irq_desc *desc =3D __this_cpu_read(vector_irq[vector]);
> +
> +		if (IS_ERR_OR_NULL(desc))
>  			continue;
> =20
>  		if (is_vector_pending(vector)) {
> -			desc =3D __this_cpu_read(vector_irq[vector]);
> -
> -			raw_spin_lock(&desc->lock);
> -			data =3D irq_desc_get_irq_data(desc);
> -			chip =3D irq_data_get_irq_chip(data);
> -			if (chip->irq_retrigger) {
> -				chip->irq_retrigger(data);
> +			guard(raw_spinlock)(&desc->lock);
> +			if (irq_chip_retrigger_hierarchy(&desc->irq_data))
[Severity: High]
Will this skip the outermost chip and cause a regression for flat domains?

Looking at kernel/irq/chip.c:irq_chip_retrigger_hierarchy(), the loop
initializes by immediately moving to the parent_data:

    int irq_chip_retrigger_hierarchy(struct irq_data *data)
    {
        for (data =3D data->parent_data; data; data =3D data->parent_data)
            if (data->chip && data->chip->irq_retrigger)
                return data->chip->irq_retrigger(data);

        return 0;
    }

By passing &desc->irq_data directly to this function, it seems any retrigger
callback on the outermost chip itself will be bypassed.

Could this lead to dropped hardware interrupts during CPU hot-unplug for
flat domains (like native lapic_controller) or any hierarchical domain where
the outermost chip implements the retrigger callback?

>  				__this_cpu_write(vector_irq[vector], VECTOR_RETRIGGERED);
> -			}
> -			raw_spin_unlock(&desc->lock);
>  		}

--=20
Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260728135117.2888=
175-1-namjain@linux.microsoft.com?part=3D2

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22927435AB3;
	Tue, 28 Jul 2026 14:04:27 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1785247469; cv=none; b=vCHE1ez698tlFXhAqUg5HkPJ4FyDj2UmiOtOC6xAduRzi3/D1FBaKF7Lod//x3kfCfND1MWPa2zCaPiwSaRK6ZRc5VGu4ImhAKaZ1slDyL3Is3SzLhp0jSfAPZNmGlMod23XKQF2VP2AOF5oXcmXXOME+HnVn8i69VM8Gzje9oY=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1785247469; c=relaxed/simple;
	bh=eu6VoR90zzm+rfpqRdKp2PLuYrlRS8U2cJKQaBRU/2s=;
	h=From:Subject:To:Cc:In-Reply-To:References:Content-Type:Date:
	 Message-Id; b=CceSVx7hf5Bb3AB78N4w7rlXf68Yoj9z1CaiPYjpjeE4YVnN3cHAa4pKztOFesMGcCqDdn/5KLY2py/3NMS1udpsB/rKvUNaaascFlDfTbDftXXDVu6gHzUG9pR7I/Z0PODak2AD3YDpC596RKDGoxNbJwI44zb70YazoLJDa2s=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=enDXxXMr; arc=none smtp.client-ip=100.103.45.18
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="enDXxXMr"
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 714311F000E9;
	Tue, 28 Jul 2026 14:04:27 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1785247467;
	bh=7bDgTzWW37Ji9lo8k4jClll2ORwVjCpxFFzgpwR4ErU=;
	h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date;
	b=enDXxXMrIIAbVHG2acGwNzReeX1n1ZtpGtu89bRaVHRkGxxqc54v1qrFS/WjOG6fz
	 perxMvSLS0nlbXHlmlULF+CqamFiDx4x25o2tojrvgAMhYKXmv2mXPfjDEJBqd8PGu
	 lo2Yiu+vHdTnpVx3BZRPIWm5r+txFnzodwq1DFD5oMkEJWUxnrSyFflGG1d0Y5Sn7a
	 cjvKRcxbSFDSffK8XEbzZ0c1vAcpT1JzYjISyEuesdmJmQdhhO0sU5LYCB9EuRS9FL
	 yQPPV/SgfZzKUo7koPqR/FoM5vKpBwdq+qtsM/jMn/eQCL1HUXX0pbnpreWS+OghQe
	 ZWJog/Lux0A4Q==
From: sashiko-bot@kernel.org
Subject: Re: [PATCH 1/3] PCI: hv: Set irq_retrigger callback for the Hyper-V
 PCI MSI irqchip
Reply-To: sashiko-reviews@lists.linux.dev
To: "Naman Jain" <namjain@linux.microsoft.com>
Cc: linux-pci@vger.kernel.org, linux-hyperv@vger.kernel.org
In-Reply-To: <20260728135117.2888175-2-namjain@linux.microsoft.com>
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
 <20260728135117.2888175-2-namjain@linux.microsoft.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Date: Tue, 28 Jul 2026 14:04:27 +0000
Message-Id: <20260728140427.714311F000E9@smtp.kernel.org>
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(=
s) to consider:

Pre-existing issues:
- [High] The fix for dropped pending interrupts during CPU hot-unplug was m=
issed in the sister Hyper-V root partition MSI domain.
--

--- Patch [1]: [PATCH 1/3] PCI: hv: Set irq_retrigger callback for the Hype=
r-V PCI MSI irqchip ---
commit b8b1c843c457dd145f0d360b44f4b1bf34bd8cf5
Author: Naman Jain <namjain@linux.microsoft.com>

PCI: hv: Set irq_retrigger callback for the Hyper-V PCI MSI irqchip

The Hyper-V vPCI MSI irqchip never installs an irq_retrigger() callback.
On CPU hot-unplug fixup_irqs() migrates the interrupts which are affine to
the outgoing CPU to a new target. As the Hyper-V PCI/MSI chip does not
provide that callback, the pending interrupt is silently dropped, which
can result in lost interrupts, stalls and "No irq handler for vector"
messages.

Fixes: 4daace0d8ce85 ("PCI: hv: Add paravirtual PCI front-end for Microsoft=
 Hyper-V VMs")
Cc: stable@vger.kernel.org
Suggested-by: Long Li <longli@microsoft.com>
Suggested-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>

> diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller=
/pci-hyperv.c
> index cfc8fa403dad6..89816a2bd7cd3 100644
> --- a/drivers/pci/controller/pci-hyperv.c
> +++ b/drivers/pci/controller/pci-hyperv.c
> @@ -2119,6 +2119,7 @@ static bool hv_pcie_init_dev_msi_info(struct device=
 *dev, struct irq_domain *dom
>  	info->ops->msi_prepare =3D hv_msi_prepare;
> =20
>  	chip->irq_set_affinity =3D irq_chip_set_affinity_parent;
> +	chip->irq_retrigger =3D irq_chip_retrigger_hierarchy;

[Severity: High]
This isn't a bug introduced by this patch, but does the sister Hyper-V root
partition MSI domain in arch/x86/hyperv/irqdomain.c also need this fix?

Looking at hv_init_dev_msi_info(), it appears to be missing the exact same
callback initialization for the root partition's top-level irq_chip:

arch/x86/hyperv/irqdomain.c:hv_init_dev_msi_info() {
	...
	if (!msi_lib_init_dev_msi_info(dev, domain, real_parent, info))
		return false;

	chip->flags |=3D IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MOVE_DEFERRED;

	info->ops->msi_prepare =3D pci_msi_prepare;

	return true;
}

If a CPU is hot-unplugged while a device MSI interrupt is pending in its
local APIC IRR, could fixup_irqs() fail to resend the pending interrupt
to the new target CPU because this callback is NULL?

This could potentially lead to the same lost interrupts and I/O stalls=20
described in this commit message, just in the root partition MSI domain
instead of the guest paravirtual MSI domain.

> =20
>  	if (IS_ENABLED(CONFIG_X86))
>  		chip->flags |=3D IRQCHIP_MOVE_DEFERRED;
>

--=20
Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260728135117.2888=
175-1-namjain@linux.microsoft.com?part=3D1

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 138B740DFDE;
	Thu, 30 Jul 2026 11:26:31 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1785410793; cv=none; b=JfuAVwcECly9ljD/iq6znYd+R1H+fagdiRXuoh+/IzuaYXCXtE/xpKRzvNjtJiDtTAlPVa4lXlMmNbZyAzjkSSB2nQTT1kZNkMFSRmwKkF6XzY77Wp6UIehae7r2aeAnABomn7cHpm73KmlsDQ5eR1DfvzqgSsISR9V742vXNvc=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1785410793; c=relaxed/simple;
	bh=YBS5CAPrY6XCRXGO24rFetMnYeFYoU1tOAvyI4TL2CU=;
	h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
	 In-Reply-To:Content-Type; b=HwDNVd4JLVpOcO1elvTGpjj+97jte/buPXfdT3lrE9kPK/oDYYf0KZheheRVbtPqnWDe973TuWpnW4cDfQn1BHJofqrbn9hYiY+gvtIab8A3RE58XFAhPaR4+cTUgnz3rd6wy5d1kqCRRoIQ2ucDHiDJxLHD3Mpt0lOYaGyTO6s=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=iDxCbLF3; arc=none smtp.client-ip=13.77.154.182
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="iDxCbLF3"
Received: from [192.168.0.105] (unknown [4.194.122.136])
	by linux.microsoft.com (Postfix) with ESMTPSA id CD33220B7166;
	Thu, 30 Jul 2026 04:26:12 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com CD33220B7166
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1785410774;
	bh=nEtBSGQcZxkgP2yOsZrtiYPwJcVN3ZOuyTNRUYzYGkM=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=iDxCbLF3u9BwvqAxSZ0/CBKQOyLeiA99SkiHnfqSfc/hL/kRp3yE+gLcbBrTLuKna
	 2zj23nDi2EsUrw/1MPi1sa+SktvJsaCopuNeMAENLOzkSdR9BH+CJQTzFd2W5n+vN2
	 dhRHdS7ZnSo+OzzcRO384FGNWKqpFdfelnvICAn4=
Message-ID: <2e798fad-fa8a-46b4-b874-7a178fd123dd@linux.microsoft.com>
Date: Thu, 30 Jul 2026 16:56:25 +0530
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/3] x86/irq: Use irq_chip_retrigger_hierarchy() in
 fixup_irqs()
To: sashiko-reviews@lists.linux.dev
Cc: linux-pci@vger.kernel.org, linux-hyperv@vger.kernel.org
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
 <20260728135117.2888175-3-namjain@linux.microsoft.com>
 <20260728140324.690D11F000E9@smtp.kernel.org>
Content-Language: en-US
From: Naman Jain <namjain@linux.microsoft.com>
In-Reply-To: <20260728140324.690D11F000E9@smtp.kernel.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 7/28/2026 7:33 PM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] The patch replaces the direct invocation of the outermost chip's irq_retrigger() callback with irq_chip_retrigger_hierarchy(). However, irq_chip_retrigger_hierarchy() initializes its loop with `data = data->parent_data`, completely skipping the outermost chip. This breaks interrupt retriggering for flat domains (like native lapic_controller) and any hierarchical domain where the outermost chip directly implements the retrigger callback.
> --
> 
> --- Patch [2]: [PATCH 2/3] x86/irq: Use irq_chip_retrigger_hierarchy() in fixup_irqs() ---
> commit f97e883de2f6626561de48c426194caa41c3e062
> Author: Naman Jain <namjain@linux.microsoft.com>
> x86/irq: Use irq_chip_retrigger_hierarchy() in fixup_irqs()
> 
> This commit modifies fixup_irqs() to use irq_chip_retrigger_hierarchy()
> instead of invoking the outermost domain chip's irq_retrigger() callback
> directly. It also refactors the loop to use scoped guards for the irq
> descriptor lock.
> 
>> diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
>> index 30122f0b3af96..ef1bdd3c4659a 100644
>> --- a/arch/x86/kernel/irq.c
>> +++ b/arch/x86/kernel/irq.c
> [ ... ]
>> @@ -489,22 +484,18 @@ void fixup_irqs(void)
> [ ... ]
>> -	for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
>> -		if (IS_ERR_OR_NULL(__this_cpu_read(vector_irq[vector])))
>> +	for (unsigned int vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
>> +		struct irq_desc *desc = __this_cpu_read(vector_irq[vector]);
>> +
>> +		if (IS_ERR_OR_NULL(desc))
>>   			continue;
>>   
>>   		if (is_vector_pending(vector)) {
>> -			desc = __this_cpu_read(vector_irq[vector]);
>> -
>> -			raw_spin_lock(&desc->lock);
>> -			data = irq_desc_get_irq_data(desc);
>> -			chip = irq_data_get_irq_chip(data);
>> -			if (chip->irq_retrigger) {
>> -				chip->irq_retrigger(data);
>> +			guard(raw_spinlock)(&desc->lock);
>> +			if (irq_chip_retrigger_hierarchy(&desc->irq_data))
> [Severity: High]
> Will this skip the outermost chip and cause a regression for flat domains?
> 
> Looking at kernel/irq/chip.c:irq_chip_retrigger_hierarchy(), the loop
> initializes by immediately moving to the parent_data:
> 
>      int irq_chip_retrigger_hierarchy(struct irq_data *data)
>      {
>          for (data = data->parent_data; data; data = data->parent_data)
>              if (data->chip && data->chip->irq_retrigger)
>                  return data->chip->irq_retrigger(data);
> 
>          return 0;
>      }
> 
> By passing &desc->irq_data directly to this function, it seems any retrigger
> callback on the outermost chip itself will be bypassed.
> 
> Could this lead to dropped hardware interrupts during CPU hot-unplug for
> flat domains (like native lapic_controller) or any hierarchical domain where
> the outermost chip implements the retrigger callback?
> 
>>   				__this_cpu_write(vector_irq[vector], VECTOR_RETRIGGERED);
>> -			}
>> -			raw_spin_unlock(&desc->lock);
>>   		}
> 

I think this is a false positive, considering we are not changing the 
behavior for any of the existing chip->irq_retrigger(data) which come in 
this path (irq_chip_retrigger_hierarchy()).

Regards,
Naman


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 684C7400967;
	Thu, 30 Jul 2026 11:26:34 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1785410795; cv=none; b=A86YSN5l4C1Srzq7KKrMwGPfOKsnVVjEgr3JC5EPRKIScShBBQ3RNlrcPaCWdddThIK5TrNfNDs0GHS1W88y/c1YCN1RLkig0GhWAFdpVrisgv1tYnXvI/Wpi9R9mDvM3xoDZ4lridJOEUBShrm/8fn+jPfAFFegbwpMl2h9l54=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1785410795; c=relaxed/simple;
	bh=jAQYUEH9rp6tkN0ocp40/35LZbc1Iu7rIRMXZgAVKVM=;
	h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
	 In-Reply-To:Content-Type; b=BmS2uNFynhnWMlUXEoWE0e9qsCVsr1W38881ysdRiD+MOGhtAeQO84FWbcPISFYnW67iS1P3ewTceZ++J2TMqc8uCdVlaWE4eR0iYGNJZX8rzggJ7RH4E9DXYvc0WQSaF6Vd/HG3pjkXRvlAynAsbvTtw8On4OWVclo5Lbypknc=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=sXdICoph; arc=none smtp.client-ip=13.77.154.182
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="sXdICoph"
Received: from [192.168.0.105] (unknown [4.194.122.136])
	by linux.microsoft.com (Postfix) with ESMTPSA id 4EFA220B7167;
	Thu, 30 Jul 2026 04:26:15 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4EFA220B7167
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1785410776;
	bh=Vds4LkW3KdTdjeaQxu1TTLzrv4vuQbQinRX0D3ockIk=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=sXdICoph3qcu+kkj01nFVh6dKy1RxyJLbEXCjshWt530ki4FvNkXiQC3qeFUif2jT
	 xjtHBJPzKWLMDwlEdxuqsN4l7fwkPl+klFMu5Yr43/x26e0dFH6d7eK2R/gn+bnBsF
	 01lAj4uPLMoxznpLit7YlUTUX0Az6/Vxr7EPrqBY=
Message-ID: <a9d44162-3c90-44c8-aae7-4813678234a9@linux.microsoft.com>
Date: Thu, 30 Jul 2026 16:56:27 +0530
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/3] PCI: hv: Set irq_retrigger callback for the Hyper-V
 PCI MSI irqchip
To: sashiko-reviews@lists.linux.dev
Cc: linux-pci@vger.kernel.org, linux-hyperv@vger.kernel.org
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
 <20260728135117.2888175-2-namjain@linux.microsoft.com>
 <20260728140427.714311F000E9@smtp.kernel.org>
Content-Language: en-US
From: Naman Jain <namjain@linux.microsoft.com>
In-Reply-To: <20260728140427.714311F000E9@smtp.kernel.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 7/28/2026 7:34 PM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> 
> Pre-existing issues:
> - [High] The fix for dropped pending interrupts during CPU hot-unplug was missed in the sister Hyper-V root partition MSI domain.
> --
> 
> --- Patch [1]: [PATCH 1/3] PCI: hv: Set irq_retrigger callback for the Hyper-V PCI MSI irqchip ---
> commit b8b1c843c457dd145f0d360b44f4b1bf34bd8cf5
> Author: Naman Jain <namjain@linux.microsoft.com>
> 
> PCI: hv: Set irq_retrigger callback for the Hyper-V PCI MSI irqchip
> 
> The Hyper-V vPCI MSI irqchip never installs an irq_retrigger() callback.
> On CPU hot-unplug fixup_irqs() migrates the interrupts which are affine to
> the outgoing CPU to a new target. As the Hyper-V PCI/MSI chip does not
> provide that callback, the pending interrupt is silently dropped, which
> can result in lost interrupts, stalls and "No irq handler for vector"
> messages.
> 
> Fixes: 4daace0d8ce85 ("PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs")
> Cc: stable@vger.kernel.org
> Suggested-by: Long Li <longli@microsoft.com>
> Suggested-by: Thomas Gleixner <tglx@kernel.org>
> Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
> 
>> diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
>> index cfc8fa403dad6..89816a2bd7cd3 100644
>> --- a/drivers/pci/controller/pci-hyperv.c
>> +++ b/drivers/pci/controller/pci-hyperv.c
>> @@ -2119,6 +2119,7 @@ static bool hv_pcie_init_dev_msi_info(struct device *dev, struct irq_domain *dom
>>   	info->ops->msi_prepare = hv_msi_prepare;
>>   
>>   	chip->irq_set_affinity = irq_chip_set_affinity_parent;
>> +	chip->irq_retrigger = irq_chip_retrigger_hierarchy;
> 
> [Severity: High]
> This isn't a bug introduced by this patch, but does the sister Hyper-V root
> partition MSI domain in arch/x86/hyperv/irqdomain.c also need this fix?
> 
> Looking at hv_init_dev_msi_info(), it appears to be missing the exact same
> callback initialization for the root partition's top-level irq_chip:
> 
> arch/x86/hyperv/irqdomain.c:hv_init_dev_msi_info() {
> 	...
> 	if (!msi_lib_init_dev_msi_info(dev, domain, real_parent, info))
> 		return false;
> 
> 	chip->flags |= IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MOVE_DEFERRED;
> 
> 	info->ops->msi_prepare = pci_msi_prepare;
> 
> 	return true;
> }
> 
> If a CPU is hot-unplugged while a device MSI interrupt is pending in its
> local APIC IRR, could fixup_irqs() fail to resend the pending interrupt
> to the new target CPU because this callback is NULL?
> 
> This could potentially lead to the same lost interrupts and I/O stalls
> described in this commit message, just in the root partition MSI domain
> instead of the guest paravirtual MSI domain.
> 
>>   
>>   	if (IS_ENABLED(CONFIG_X86))
>>   		chip->flags |= IRQCHIP_MOVE_DEFERRED;
>>
> 

I am not planning to include this in this series, since this issue is 
not seen in root partition yet and I am not sure if it is applicable 
here. Second patch would anyways fix it going forward, but I am OK 
adding the change for this, if we need.

Regards,
Naman

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 2040242C506;
	Mon,  3 Aug 2026 18:06:10 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1785780371; cv=none; b=kKubrtnj8u+flhLfzsuKBbEXPE9vQX/8Q/pevxBCXgI1OEAiS3nkZ1V2CnPE37Uc5InZhEy1qOPNYitxFbyiWJnt6wK7EkMVCNjciTIFXEelizIMwmn8NJqIYztd9zZPWehDOlknC3OvyBGEsv8SWDk5foCtSWir7Y+ZmYk351Y=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1785780371; c=relaxed/simple;
	bh=c54gsormIwsur8nIUH7Sp2Sm/IFHjGgHIhB9EJH6QaI=;
	h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
	 In-Reply-To:Content-Type; b=eBEmsWdUCYV5vsqoNKWnzz/zTsW0MbaR5gmt+1nUtYByEgHgVhpYHHBQ8Ta9w7SRqt31kyeZfRb3mK36NUbWbIvLVl0d8v/gVuT1RpGvwmp8IpYI2/I756hEWSBA26ZD4OA9d8thjnlP3yvmmSEuMWKA4b5hII2CQAdugkh04HQ=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=Q+QP8Cvz; arc=none smtp.client-ip=13.77.154.182
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="Q+QP8Cvz"
Received: from [192.168.1.71] (unknown [103.172.5.253])
	by linux.microsoft.com (Postfix) with ESMTPSA id 6D5CB20B7168;
	Mon,  3 Aug 2026 11:05:43 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6D5CB20B7168
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1785780350;
	bh=l75URa6NxkEZDaloy4fDYW6DlbosrDiag8Qm0LfpBwg=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=Q+QP8CvzqSWkIrMXYUtxwlqU0y+lWoyrnzWdXWTcGTt+KB+DtNPgCYUrNFtGvzfcZ
	 XI0TCnNSIlpKgWj1MHF/AuH7Ga3fpThj6RGzkMKGyChpJRWMJYlw08jhTQ1g+kRL+W
	 4zYWMrbS/V1RMZR5ZBgfT979jIURyXDIYvCGQNrg=
Message-ID: <9b7dd08d-c007-47ed-9c75-ecfd735f26f8@linux.microsoft.com>
Date: Mon, 3 Aug 2026 23:35:57 +0530
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/3] PCI: hv: Set irq_retrigger callback for the Hyper-V
 PCI MSI irqchip
To: Naman Jain <namjain@linux.microsoft.com>,
 "K. Y. Srinivasan" <kys@microsoft.com>,
 Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>,
 Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>,
 Lorenzo Pieralisi <lpieralisi@kernel.org>,
 =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
 Manivannan Sadhasivam <mani@kernel.org>, Rob Herring <robh@kernel.org>,
 Bjorn Helgaas <bhelgaas@google.com>, Thomas Gleixner <tglx@kernel.org>,
 Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
 Dave Hansen <dave.hansen@linux.intel.com>, "H. Peter Anvin" <hpa@zytor.com>,
 "Joerg Roedel (AMD)" <joro@8bytes.org>,
 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
 Vasant Hegde <vasant.hegde@amd.com>, Will Deacon <will@kernel.org>,
 Robin Murphy <robin.murphy@arm.com>
Cc: x86@kernel.org, Jake Oshins <jakeo@microsoft.com>,
 linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org,
 iommu@lists.linux.dev, linux-kernel@vger.kernel.org
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
 <20260728135117.2888175-2-namjain@linux.microsoft.com>
Content-Language: en-US
From: Aditya Garg <gargaditya@linux.microsoft.com>
In-Reply-To: <20260728135117.2888175-2-namjain@linux.microsoft.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 28-07-2026 19:21, Naman Jain wrote:
> The Hyper-V vPCI MSI irqchip never installs an irq_retrigger() callback.
> 
> On CPU hot-unplug fixup_irqs() migrates the interrupts which are affine to
> the outgoing CPU to a new target. If an interrupt still has its pending bit
> set in the outgoing CPU's IRR at that point, fixup_irqs() resends it on the
> new target through the irqchip's irq_retrigger() callback. As the Hyper-V
> PCI/MSI chip does not provide that callback, the pending interrupt is
> silently dropped, which can result in lost interrupts, stalls and "No irq
> handler for vector" messages during CPU hotplug.
> 
> Install irq_chip_retrigger_hierarchy() as the irq_retrigger() callback for
> the Hyper-V PCI/MSI irqchip, so that a pending interrupt is resent on its
> new target CPU via the parent x86 vector domain.
> 
> Fixes: 4daace0d8ce85 ("PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs")
> Cc: stable@vger.kernel.org
> Suggested-by: Long Li <longli@microsoft.com>
> Suggested-by: Thomas Gleixner <tglx@kernel.org>
> Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
> ---
>   drivers/pci/controller/pci-hyperv.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> index cfc8fa403dad6..89816a2bd7cd3 100644
> --- a/drivers/pci/controller/pci-hyperv.c
> +++ b/drivers/pci/controller/pci-hyperv.c
> @@ -2119,6 +2119,7 @@ static bool hv_pcie_init_dev_msi_info(struct device *dev, struct irq_domain *dom
>   	info->ops->msi_prepare = hv_msi_prepare;
>   
>   	chip->irq_set_affinity = irq_chip_set_affinity_parent;
> +	chip->irq_retrigger = irq_chip_retrigger_hierarchy;
>   
>   	if (IS_ENABLED(CONFIG_X86))
>   		chip->flags |= IRQCHIP_MOVE_DEFERRED;

Reviewed-by: Aditya Garg <gargaditya@linux.microsoft.com>

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id C1768340A6B;
	Tue,  4 Aug 2026 12:16:56 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1785845818; cv=none; b=Pki3PhKSiAx0em1pwo1PZZc1UX0AI6e390BEqyAVE8gRMnLOZtziwEx3rcSDtMsK/TNVDQUQvreq3rYO2Is7bOkMoCse4OEMYV7MJy5EONaAXkmGfTnc59ez0XipgmO6MSXOBWsx3QYIfJd0xSLRJUYM7HLsTiSGlltWXPojdlw=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1785845818; c=relaxed/simple;
	bh=B6/WRddiaYtxSye2QXK20TGfRHU0iPsemPBwQ0yTEdw=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=fzenQeRczw5AIlT+8byg7kUm+1arXmwPP4HwKnwo4LB+iZxTtDO8J3hBdnQysYD9jIkwbvzHkIL4aF6xd8/3d3KhWnxtukTuUkr2HRHpwoxcaidkz4JJYi6gKpU9baH2MmZ3CPpIQssfxYH36uCEHntZasUPgKvwk4VbNvhKDHg=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=j3Zdtqsj; arc=none smtp.client-ip=13.77.154.182
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="j3Zdtqsj"
Received: by linux.microsoft.com (Postfix, from userid 1134)
	id 8155120B7168; Tue,  4 Aug 2026 05:16:36 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8155120B7168
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1785845796;
	bh=aTqXnV7ZBoFAQTtt7IICjqfQNaAMMc/7wWeZF7s6F8M=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=j3ZdtqsjxFxsinSa0gq66Hbv5nOsVFaN/IkBlbFVrNI7CmSYLoxsWWW4VtbEU7vtj
	 2to0kxeiA1Sy25zsRX2edmwbxGxuuHSM/AWyEohK6DPUp9A/WUU2Lwxka/DQFNyY/6
	 dCzACpgmVEp9U7CpC1qPcp/3ZrojV3+ou9fE3lhE=
Date: Tue, 4 Aug 2026 05:16:36 -0700
From: Shradha Gupta <shradhagupta@linux.microsoft.com>
To: Naman Jain <namjain@linux.microsoft.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
	Long Li <longli@microsoft.com>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Rob Herring <robh@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Joerg Roedel (AMD)" <joro@8bytes.org>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Vasant Hegde <vasant.hegde@amd.com>, Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>, x86@kernel.org,
	Jake Oshins <jakeo@microsoft.com>, linux-hyperv@vger.kernel.org,
	linux-pci@vger.kernel.org, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] x86/irq: Fix lost interrupts on CPU hot-unplug for
 Hyper-V PCI/MSI
Message-ID: <anHYJEeHlszuj/38@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260728135117.2888175-1-namjain@linux.microsoft.com>

On Tue, Jul 28, 2026 at 01:51:14PM +0000, Naman Jain wrote:
> On CPU hot-unplug, fixup_irqs() re-injects interrupts that are still
> pending in the outgoing CPU's IRR via the irqchip's irq_retrigger()
> callback. The Hyper-V vPCI MSI irqchip never installs one, so such a
> pending interrupt is silently dropped, leading to lost interrupts, stalls
> and "No irq handler for vector" messages.
> 
> Patch 1 is the minimal, backportable fix (Fixes:/Cc: stable) that installs
> irq_chip_retrigger_hierarchy() on the Hyper-V PCI/MSI chip. Patch 2 then
> switches fixup_irqs() to call irq_chip_retrigger_hierarchy() directly, so
> the retrigger works for any stacked irqchip without a per-chip callback.
> Patch 3 drops the now-redundant irq_retrigger() initializations.
> This way, patch 2 and 3 do not need to be backported.

Thanks Naman, the series looks good to me.

I just have a small nit. In the old code, VECTOR_RETRIGGERED is set
unconditionally after calling chip->irq_retrigger(), regardless of its
return value. In the new code, VECTOR_RETRIGGERED is only set when
irq_chip_retrigger_hierarchy() returns non-zero. So retrigger failures
would now result in VECTOR_UNUSED instead of VECTOR_RETRIGGERED.

In practice this doesn't matter since apic_retrigger_irq() always returns
1, but it is technically a behavior change and I think it is a correct
one. Just that it might be worth noting this in the commit message to
avoid confusion.

Reviewed-by: Shradha Gupta <shradhagupta@linux.microsoft.com>

> 
> The series follows the original RFC:
> Link: https://lore.kernel.org/all/87y0f3jhd6.ffs@fw13/
> 
> Naman Jain (3):
>   PCI: hv: Set irq_retrigger callback for the Hyper-V PCI MSI irqchip
>   x86/irq: Use irq_chip_retrigger_hierarchy() in fixup_irqs()
>   x86/irq, iommu/amd, PCI: Drop redundant irq_retrigger inits
> 
>  arch/x86/kernel/apic/io_apic.c |  2 --
>  arch/x86/kernel/apic/msi.c     |  4 +---
>  arch/x86/kernel/hpet.c         |  1 -
>  arch/x86/kernel/irq.c          | 23 +++++++----------------
>  drivers/iommu/amd/init.c       |  1 -
>  5 files changed, 8 insertions(+), 23 deletions(-)
> 
> 
> base-commit: 0d33d21e47d9dc66f91e44da3fc9220c74d93df7
> -- 
> 2.43.0
> 

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 961F41D47AC;
	Wed,  5 Aug 2026 04:44:02 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1785905044; cv=none; b=MgK234wX+QVOd2uMqKWqyNQly2p8bXw7WZzhxbH3wqDcD3IAZE3BHh0P+TIvBl5ZbPiBhlObGhl+CC4Lqsm/vcOcKLXeqoc3OC/DBrbnpp2WL9oQTLKB+o4gumSdoCjJdQor1uVk6677jdI9PHq/CpOF5+fU7bJLUhfqteKSqTc=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1785905044; c=relaxed/simple;
	bh=n2P6idRe3RqOB1keZ96ibxRUsaj0qnSuENYCvkqZ2E4=;
	h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
	 In-Reply-To:Content-Type; b=XRBs8p05sDqPNU3bucI/PokG2Wv0mzIBx4dKm7eH1Fc8rbFyfJMe7mxRQ4uEQ5hucLYre8cwMP0+SR5aFigS+jklJbPzZhzN/vBz63Rt2TxXTWivpdDYd9NNxKdB5bsdaNxAQKqgq1iD5zzu4koK9AElpYeYAujRsi2lzy8/Bfc=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=VOfJdR5V; arc=none smtp.client-ip=13.77.154.182
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="VOfJdR5V"
Received: from [10.7.58.6] (unknown [4.194.122.162])
	by linux.microsoft.com (Postfix) with ESMTPSA id A423420B7169;
	Tue,  4 Aug 2026 21:43:31 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A423420B7169
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1785905021;
	bh=CRiTfhhHlWQ+Wky5oSEnJr3z9b/fF7IvnlsFt1kRh1o=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=VOfJdR5VPx/n8VqYGq2vionMO1cw1homB43MhJCFnPjYAnK6wgb1aYjSoTI+BKaPw
	 bcWFBRY0CuUsAvuGDeJI0Vwg3rkezK4+Jo/yddqIMF5vmvKtwSXy6y7JUtcYF8hNv6
	 C2z5aex/xEHzLKPraj0lg4auiprjbwRvjj605VoE=
Message-ID: <750adee2-e934-4907-ae54-d01e7d3defc4@linux.microsoft.com>
Date: Wed, 5 Aug 2026 10:13:47 +0530
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/3] x86/irq: Fix lost interrupts on CPU hot-unplug for
 Hyper-V PCI/MSI
To: Shradha Gupta <shradhagupta@linux.microsoft.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>,
 Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>,
 Dexuan Cui <decui@microsoft.com>, Long Li <longli@microsoft.com>,
 Lorenzo Pieralisi <lpieralisi@kernel.org>,
 =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
 Manivannan Sadhasivam <mani@kernel.org>, Rob Herring <robh@kernel.org>,
 Bjorn Helgaas <bhelgaas@google.com>, Thomas Gleixner <tglx@kernel.org>,
 Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
 Dave Hansen <dave.hansen@linux.intel.com>, "H. Peter Anvin" <hpa@zytor.com>,
 "Joerg Roedel (AMD)" <joro@8bytes.org>,
 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
 Vasant Hegde <vasant.hegde@amd.com>, Will Deacon <will@kernel.org>,
 Robin Murphy <robin.murphy@arm.com>, x86@kernel.org,
 Jake Oshins <jakeo@microsoft.com>, linux-hyperv@vger.kernel.org,
 linux-pci@vger.kernel.org, iommu@lists.linux.dev,
 linux-kernel@vger.kernel.org
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
 <anHYJEeHlszuj/38@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
Content-Language: en-US
From: Naman Jain <namjain@linux.microsoft.com>
In-Reply-To: <anHYJEeHlszuj/38@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 8/4/2026 5:46 PM, Shradha Gupta wrote:
> On Tue, Jul 28, 2026 at 01:51:14PM +0000, Naman Jain wrote:
>> On CPU hot-unplug, fixup_irqs() re-injects interrupts that are still
>> pending in the outgoing CPU's IRR via the irqchip's irq_retrigger()
>> callback. The Hyper-V vPCI MSI irqchip never installs one, so such a
>> pending interrupt is silently dropped, leading to lost interrupts, stalls
>> and "No irq handler for vector" messages.
>>
>> Patch 1 is the minimal, backportable fix (Fixes:/Cc: stable) that installs
>> irq_chip_retrigger_hierarchy() on the Hyper-V PCI/MSI chip. Patch 2 then
>> switches fixup_irqs() to call irq_chip_retrigger_hierarchy() directly, so
>> the retrigger works for any stacked irqchip without a per-chip callback.
>> Patch 3 drops the now-redundant irq_retrigger() initializations.
>> This way, patch 2 and 3 do not need to be backported.
> 
> Thanks Naman, the series looks good to me.
> 
> I just have a small nit. In the old code, VECTOR_RETRIGGERED is set
> unconditionally after calling chip->irq_retrigger(), regardless of its
> return value. In the new code, VECTOR_RETRIGGERED is only set when
> irq_chip_retrigger_hierarchy() returns non-zero. So retrigger failures
> would now result in VECTOR_UNUSED instead of VECTOR_RETRIGGERED.
> 
> In practice this doesn't matter since apic_retrigger_irq() always returns
> 1, but it is technically a behavior change and I think it is a correct
> one. Just that it might be worth noting this in the commit message to
> avoid confusion.
> 
> Reviewed-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
> 
>>

Thank you Shradha. I'll address this in the next patch version.

Regards,
Naman


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2020140E5F;
	Mon, 24 Aug 2026 00:14:07 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1787530449; cv=none; b=rt0LXiodLK2O4mYPxoqZDHNoMrA3/jhaGv1qPJc0/FCobNzKqMwl2IYuQr/rCqzCOr17g/6gafS8v7tmXstQ8gt+q8EUFupJuqMTXH71AmcNThUbEe4PxyQLnPeIhVFIvDPpmziSrmlkYMs3HcT5VP9CXPQzpRFk+90BXYtTpDM=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1787530449; c=relaxed/simple;
	bh=vxsH7t+mPViD9HKKDMX23yzinzd+DOPG1IlutqilAk0=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=B0tkVWIM0/55gDcwBxPSJOzNWZUiqCL/bNYQuIOlMUJne75RmYTKHQmHIzjPz42AwwKMwleFPA2bV8yylhgKag6SBHt58aMgp3ytfgJWEwK04P+zrYn3As7VCHj75hH9D1YjGnYDYRU6Gr9mVDsNvN4CcnWBvuk8fEMB7CAo3J4=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FXv8K0iT; arc=none smtp.client-ip=100.103.45.18
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FXv8K0iT"
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 691531F000E9;
	Mon, 24 Aug 2026 00:14:07 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1787530447;
	bh=Rj9/mR/ZBUVYGOpdaibRJ74gieb4xPfeGCWP3MKyAy4=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=FXv8K0iTVgzemjA8Do+dPLLnJeyxZ+jIRo7dyAYaHPf+gzH7xoD7AQtu4wjeGh2qh
	 IgFvUfeYdpjA/SZoJZ8bqVs69SHIxEDaZI9CmK58r2SYmYmruT3f7D5RvWfAE4X7EK
	 mecxD947RjiEEu5MKgNYQ3XYi0oIF9+odcervWRvDWZeQ9AICbCkhFFWZ6FhuhBlRf
	 Q6UhLE6X57zMJbEJlVzYHmzACkOMnZzhytKybvjd6KZAChfs4ldapR66L8hQ3gpKXO
	 d7tZQ3rUDjBLcYBxnpqN7Eyi7wbkppOJ/7U6WYzE/6lEe3ebFZWiGVM/zoiGrNFf91
	 bi0x+67Qc7Z7Q==
Date: Sun, 23 Aug 2026 17:14:06 -0700
From: Wei Liu <wei.liu@kernel.org>
To: Naman Jain <namjain@linux.microsoft.com>
Cc: sashiko-reviews@lists.linux.dev, linux-pci@vger.kernel.org,
	linux-hyperv@vger.kernel.org, Wei Liu <wei.liu@kernel.org>
Subject: Re: [PATCH 1/3] PCI: hv: Set irq_retrigger callback for the Hyper-V
 PCI MSI irqchip
Message-ID: <20260824001406.GC3566091@liuwe-devbox-debian-v2.local>
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
 <20260728135117.2888175-2-namjain@linux.microsoft.com>
 <20260728140427.714311F000E9@smtp.kernel.org>
 <a9d44162-3c90-44c8-aae7-4813678234a9@linux.microsoft.com>
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <a9d44162-3c90-44c8-aae7-4813678234a9@linux.microsoft.com>

On Thu, Jul 30, 2026 at 04:56:27PM +0530, Naman Jain wrote:
> 
> 
> On 7/28/2026 7:34 PM, sashiko-bot@kernel.org wrote:
> > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> > 
> > Pre-existing issues:
> > - [High] The fix for dropped pending interrupts during CPU hot-unplug was missed in the sister Hyper-V root partition MSI domain.
> > --
> > 
> > --- Patch [1]: [PATCH 1/3] PCI: hv: Set irq_retrigger callback for the Hyper-V PCI MSI irqchip ---
> > commit b8b1c843c457dd145f0d360b44f4b1bf34bd8cf5
> > Author: Naman Jain <namjain@linux.microsoft.com>
> > 
> > PCI: hv: Set irq_retrigger callback for the Hyper-V PCI MSI irqchip
> > 
> > The Hyper-V vPCI MSI irqchip never installs an irq_retrigger() callback.
> > On CPU hot-unplug fixup_irqs() migrates the interrupts which are affine to
> > the outgoing CPU to a new target. As the Hyper-V PCI/MSI chip does not
> > provide that callback, the pending interrupt is silently dropped, which
> > can result in lost interrupts, stalls and "No irq handler for vector"
> > messages.
> > 
> > Fixes: 4daace0d8ce85 ("PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs")
> > Cc: stable@vger.kernel.org
> > Suggested-by: Long Li <longli@microsoft.com>
> > Suggested-by: Thomas Gleixner <tglx@kernel.org>
> > Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
> > 
> > > diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> > > index cfc8fa403dad6..89816a2bd7cd3 100644
> > > --- a/drivers/pci/controller/pci-hyperv.c
> > > +++ b/drivers/pci/controller/pci-hyperv.c
> > > @@ -2119,6 +2119,7 @@ static bool hv_pcie_init_dev_msi_info(struct device *dev, struct irq_domain *dom
> > >   	info->ops->msi_prepare = hv_msi_prepare;
> > >   	chip->irq_set_affinity = irq_chip_set_affinity_parent;
> > > +	chip->irq_retrigger = irq_chip_retrigger_hierarchy;
> > 
> > [Severity: High]
> > This isn't a bug introduced by this patch, but does the sister Hyper-V root
> > partition MSI domain in arch/x86/hyperv/irqdomain.c also need this fix?
> > 
> > Looking at hv_init_dev_msi_info(), it appears to be missing the exact same
> > callback initialization for the root partition's top-level irq_chip:
> > 
> > arch/x86/hyperv/irqdomain.c:hv_init_dev_msi_info() {
> > 	...
> > 	if (!msi_lib_init_dev_msi_info(dev, domain, real_parent, info))
> > 		return false;
> > 
> > 	chip->flags |= IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MOVE_DEFERRED;
> > 
> > 	info->ops->msi_prepare = pci_msi_prepare;
> > 
> > 	return true;
> > }
> > 
> > If a CPU is hot-unplugged while a device MSI interrupt is pending in its
> > local APIC IRR, could fixup_irqs() fail to resend the pending interrupt
> > to the new target CPU because this callback is NULL?
> > 
> > This could potentially lead to the same lost interrupts and I/O stalls
> > described in this commit message, just in the root partition MSI domain
> > instead of the guest paravirtual MSI domain.
> > 
> > >   	if (IS_ENABLED(CONFIG_X86))
> > >   		chip->flags |= IRQCHIP_MOVE_DEFERRED;
> > > 
> > 
> 
> I am not planning to include this in this series, since this issue is not
> seen in root partition yet and I am not sure if it is applicable here.
> Second patch would anyways fix it going forward, but I am OK adding the
> change for this, if we need.

What's the downside of fixing the root partition irq domain?

We never really attempted to unplug any CPU from the root partition, so
it is unsurprising that it has not been reported.

Wei

> 
> Regards,
> Naman
> 

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5555C221FD4;
	Mon, 24 Aug 2026 00:15:10 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1787530511; cv=none; b=LlJf2Gfd0p42gz+g9JWZk9OI1xj/SMt84yeKohOLxU8jTlvRf9/KxbbKQsty/Hi3+A2a24Mwi7VWvoUCl4H5CZEBvYoeHoooFKU11Yv30SCCgRvagB4MUyH28/Clykv9gOezhlJIIfC4khTS9Jqgt2ua/Z7pZw8PJZB6CAW/Nwk=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1787530511; c=relaxed/simple;
	bh=pMNSADQiouJzV/Ti6y5BHwS4ZQ41OY6GE3E9eFniJZM=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=fQzQmzjM/h9ToED0NpIF3wpC8ipjSGXOq8chUbXm24qPbBSEbEZP/hYrKxtXaBuEl/hU+2s060XfqyadgT3yYAl6BGyRkxSNH61TBz17oWnQh5+UV69SvOoOSSrgi+yr9KyhWudjZYIlLfgDlkYLbuQBQlkA7VXIIEunIInzEoM=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bblK9nJw; arc=none smtp.client-ip=100.103.45.18
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bblK9nJw"
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 940021F000E9;
	Mon, 24 Aug 2026 00:15:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1787530510;
	bh=Uk/3glVosXfbFUfyQ7G5VBNFPxn4bq7xO5x07CZjVsc=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=bblK9nJwYwqTeLgwKVpFbQALk2fxk2+Uz4lCYBUUYL34guP3OUGMB9oEFnIQk0TQ+
	 8PDiD66xrTrZy2Q8QYvqtx953ZY6819w1Sda6fmBQxa4O7TneU3DPoht+iHXFPqcuU
	 gpXgJX5TkfbDfylLxIB9cLUBpEFAzXwBvYg5PX9JxdZngPXF/PW4YOzRKlHCEz2Nye
	 wq2skTsSSg/xqGFTJbmYHvzRq2t2Y9kSPaT7GPQCiHyKGqHTKZ49ebVG5OXfY1kcto
	 1SsfW1cXL5fN1Sms+tf2wi5RcVAk0d60P/Do9MxYFafZ8FDoo/zQeGEj1k4fch6Z1k
	 Q99LIeYGU1r5Q==
Date: Sun, 23 Aug 2026 17:15:08 -0700
From: Wei Liu <wei.liu@kernel.org>
To: Naman Jain <namjain@linux.microsoft.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
	Long Li <longli@microsoft.com>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Rob Herring <robh@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Joerg Roedel (AMD)" <joro@8bytes.org>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Vasant Hegde <vasant.hegde@amd.com>, Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>, x86@kernel.org,
	Jake Oshins <jakeo@microsoft.com>, linux-hyperv@vger.kernel.org,
	linux-pci@vger.kernel.org, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] x86/irq: Use irq_chip_retrigger_hierarchy() in
 fixup_irqs()
Message-ID: <20260824001508.GD3566091@liuwe-devbox-debian-v2.local>
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
 <20260728135117.2888175-3-namjain@linux.microsoft.com>
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260728135117.2888175-3-namjain@linux.microsoft.com>

On Tue, Jul 28, 2026 at 01:51:16PM +0000, Naman Jain wrote:
> fixup_irqs() re-injects a pending interrupt on its new target CPU by
> looking at the outermost domain chip and invoking its irq_retrigger()
> callback directly. That only works when the outermost chip happens to
> install an irq_retrigger() callback, which is not guaranteed for every
> irqchip and could lead to lost interrupts on CPU hot-unplug.
> 
> Use irq_chip_retrigger_hierarchy() instead, which walks up the interrupt
> hierarchy until it finds a chip that implements irq_retrigger().
> 
> While at it, move the loop-local variables into the loop scope and use a
> scoped guard for desc->lock.
> 
> No functional change intended for chips which already provide an
> irq_retrigger() callback on the outermost domain.
> 
> Suggested-by: Thomas Gleixner <tglx@kernel.org>
> Signed-off-by: Naman Jain <namjain@linux.microsoft.com>

I can pick this up as part of this series but this requires an ack from
Thomas.

Wei

> ---
>  arch/x86/kernel/irq.c | 23 +++++++----------------
>  1 file changed, 7 insertions(+), 16 deletions(-)
> 
> diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
> index 30122f0b3af96..ef1bdd3c4659a 100644
> --- a/arch/x86/kernel/irq.c
> +++ b/arch/x86/kernel/irq.c
> @@ -466,11 +466,6 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_posted_msi_notification)
>  /* A cpu has been removed from cpu_online_mask.  Reset irq affinities. */
>  void fixup_irqs(void)
>  {
> -	unsigned int vector;
> -	struct irq_desc *desc;
> -	struct irq_data *data;
> -	struct irq_chip *chip;
> -
>  	irq_migrate_all_off_this_cpu();
>  
>  	/*
> @@ -489,22 +484,18 @@ void fixup_irqs(void)
>  	 * vector_lock because the cpu is already marked !online, so
>  	 * nothing else will touch it.
>  	 */
> -	for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
> -		if (IS_ERR_OR_NULL(__this_cpu_read(vector_irq[vector])))
> +	for (unsigned int vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
> +		struct irq_desc *desc = __this_cpu_read(vector_irq[vector]);
> +
> +		if (IS_ERR_OR_NULL(desc))
>  			continue;
>  
>  		if (is_vector_pending(vector)) {
> -			desc = __this_cpu_read(vector_irq[vector]);
> -
> -			raw_spin_lock(&desc->lock);
> -			data = irq_desc_get_irq_data(desc);
> -			chip = irq_data_get_irq_chip(data);
> -			if (chip->irq_retrigger) {
> -				chip->irq_retrigger(data);
> +			guard(raw_spinlock)(&desc->lock);
> +			if (irq_chip_retrigger_hierarchy(&desc->irq_data))
>  				__this_cpu_write(vector_irq[vector], VECTOR_RETRIGGERED);
> -			}
> -			raw_spin_unlock(&desc->lock);
>  		}
> +
>  		if (__this_cpu_read(vector_irq[vector]) != VECTOR_RETRIGGERED)
>  			__this_cpu_write(vector_irq[vector], VECTOR_UNUSED);
>  	}
> -- 
> 2.43.0
> 
> 

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF6A021CA03;
	Mon, 24 Aug 2026 00:17:49 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1787530671; cv=none; b=W9XWdKhbrwSv7T7zhpBl3I7Rs82uMbfF4hIFKy0NfNEbuhvK+vUyNOWgcxWCkUD6AwOd6bVbHjaaJNDM8lFl/rv8ISd4iy454tHb18cFqyHlsPn+c0CoRSg6hYF27rwvdClN8kH/OmdEccgvgxFTzhBRS9F1SfI/o3DTpmCWMXo=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1787530671; c=relaxed/simple;
	bh=BtY40Kg/GLDsSSKKNh6oGg1tg/2npmL6pBFdFzoxIWc=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=hAEO12iP7kHOcuPIbKxqv9mdmA88T5vzpBddULpIwgF8hjvze2yCYvolCq/SH3p2NJykDGEWtiIJJ7d+/jVsQyOwfgQXV7slRz+uICUutaQ6x6X408bvbqUUrGgMTCR2kyUKd3JdMtt2kH501UAbP9yX+ycR1M0m7xbBxOnV1EU=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oo+e93B0; arc=none smtp.client-ip=100.103.45.18
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oo+e93B0"
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1788B1F000E9;
	Mon, 24 Aug 2026 00:17:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1787530669;
	bh=JXHLqnpy5FRwrCT7OCsFLqokuLrj12X7U3QZX2dJJzo=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=oo+e93B0kNCXMLZootgv/CEtD1049HiSySlJyyOcZ9/G+/I2QXps6wt+1mTrORktk
	 M57jlWKEhENIMfjegJj3B3KIhopZ5ZrFttI5zB8bZN49Il/qnZ+UmG4E6wVOmtaaH0
	 8wEYGJhbZENHnn/W8SX3e35Othhnl1avBONJk/TT18q3mDbTjMKWBHIHmBg8ziS4fo
	 POHQx6icbEbwgcNdlAIZKmzBeeyyDmd7F4ZaQs7lqi8cg3nm7BGCywOTNXVBd6IOPu
	 R9mhOyJiYLSlJccb1MFE8usET+6hbbAqN1RgAgoUTdN+ztVBLIRjIhwXuhBodI1W8a
	 G6hTFCSWtDEDQ==
Date: Sun, 23 Aug 2026 17:17:47 -0700
From: Wei Liu <wei.liu@kernel.org>
To: Naman Jain <namjain@linux.microsoft.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
	Long Li <longli@microsoft.com>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Rob Herring <robh@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Joerg Roedel (AMD)" <joro@8bytes.org>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Vasant Hegde <vasant.hegde@amd.com>, Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>, x86@kernel.org,
	Jake Oshins <jakeo@microsoft.com>, linux-hyperv@vger.kernel.org,
	linux-pci@vger.kernel.org, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] x86/irq, iommu/amd, PCI: Drop redundant
 irq_retrigger inits
Message-ID: <20260824001747.GE3566091@liuwe-devbox-debian-v2.local>
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
 <20260728135117.2888175-4-namjain@linux.microsoft.com>
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20260728135117.2888175-4-namjain@linux.microsoft.com>

On Tue, Jul 28, 2026 at 01:51:17PM +0000, Naman Jain wrote:
[...]
> diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
> index ea3377e61aa5c..0c362e86a09d9 100644
> --- a/drivers/iommu/amd/init.c
> +++ b/drivers/iommu/amd/init.c
> @@ -2468,7 +2468,6 @@ static struct irq_chip intcapxt_controller = {
>  	.irq_unmask		= intcapxt_unmask_irq,
>  	.irq_mask		= intcapxt_mask_irq,
>  	.irq_ack		= irq_chip_ack_parent,
> -	.irq_retrigger		= irq_chip_retrigger_hierarchy,
>  	.irq_set_affinity       = intcapxt_set_affinity,
>  	.irq_set_wake		= intcapxt_set_wake,
>  	.flags			= IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_MOVE_DEFERRED,
> diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> index 89816a2bd7cd3..cfc8fa403dad6 100644
> --- a/drivers/pci/controller/pci-hyperv.c
> +++ b/drivers/pci/controller/pci-hyperv.c
> @@ -2119,7 +2119,6 @@ static bool hv_pcie_init_dev_msi_info(struct device *dev, struct irq_domain *dom
>  	info->ops->msi_prepare = hv_msi_prepare;
>  
>  	chip->irq_set_affinity = irq_chip_set_affinity_parent;
> -	chip->irq_retrigger = irq_chip_retrigger_hierarchy;

Acked-by: Wei Liu <wei.liu@kernel.org>.

I suppose you do this because the first patch is supposed to be
backported.

Wei

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E5213B38BD;
	Mon, 24 Aug 2026 05:41:22 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1787550083; cv=none; b=tawoX7ojVshY7lSMjBSUHOlWQGS++rW2j2Z+WlIS1uWERUemwODT+OfhgiyZPVV0e2SWVtDUmKauLaLDBYEVMp52gMPiqD4ZvpR4fmI8r7Xp5ZT4fa/78TZ1mLFlAUys0EOXwlKN7WDzj0ilEoEzVh7I/XoA3pnxGyrvsqsCQeY=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1787550083; c=relaxed/simple;
	bh=1goF1hUY2+jfQCM4cCVj2oUgayb2ZOdlIla9d+oA378=;
	h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
	 In-Reply-To:Content-Type; b=iaxsbasWaKLHHpF4luuz1AWWU3zXgvrC0jVcf7YS7pveCPhpdAzQm1CTiELNZq+5eDncLwDILUT3TDDRYAabAGrgOqINQvrHITBHFidhdKxwT08GMRuIzU/6cDEfGxBevk0cPYGLB1HJohvHmqYNnypS4e+cOhQ2MVS5jVQgzl0=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=S9ywES8d; arc=none smtp.client-ip=13.77.154.182
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="S9ywES8d"
Received: from [192.168.1.70] (unknown [4.194.122.170])
	by linux.microsoft.com (Postfix) with ESMTPSA id BC0DF20B7166;
	Sun, 23 Aug 2026 22:40:42 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BC0DF20B7166
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1787550050;
	bh=x7+UMA3lTYEM484uVy7XpCvdDVN+yr3RjRbu9iaBiwM=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=S9ywES8dBBql8h3aG6zB/XC6auDGe6gL+1/f2OQuHWelmaollawN5Xekaiyq8fIfo
	 jxs/lPYEafKGKNlljWwi8N6vw3oTwG1J/+9kx/GfHG0voIQ85Q7mA5w2BMICTYK4zr
	 /k2nkgeUoL2SWejDvb5YLz9I8W/AKUZiPVf+BjRo=
Message-ID: <23b75192-35eb-4e01-9c90-e41ab3510f93@linux.microsoft.com>
Date: Mon, 24 Aug 2026 11:11:09 +0530
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/3] x86/irq: Use irq_chip_retrigger_hierarchy() in
 fixup_irqs()
To: Wei Liu <wei.liu@kernel.org>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>,
 Haiyang Zhang <haiyangz@microsoft.com>, Dexuan Cui <decui@microsoft.com>,
 Long Li <longli@microsoft.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>,
 =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
 Manivannan Sadhasivam <mani@kernel.org>, Rob Herring <robh@kernel.org>,
 Bjorn Helgaas <bhelgaas@google.com>, Thomas Gleixner <tglx@kernel.org>,
 Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
 Dave Hansen <dave.hansen@linux.intel.com>, "H. Peter Anvin" <hpa@zytor.com>,
 "Joerg Roedel (AMD)" <joro@8bytes.org>,
 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
 Vasant Hegde <vasant.hegde@amd.com>, Will Deacon <will@kernel.org>,
 Robin Murphy <robin.murphy@arm.com>, x86@kernel.org,
 Jake Oshins <jakeo@microsoft.com>, linux-hyperv@vger.kernel.org,
 linux-pci@vger.kernel.org, iommu@lists.linux.dev,
 linux-kernel@vger.kernel.org
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
 <20260728135117.2888175-3-namjain@linux.microsoft.com>
 <20260824001508.GD3566091@liuwe-devbox-debian-v2.local>
Content-Language: en-US
From: Naman Jain <namjain@linux.microsoft.com>
In-Reply-To: <20260824001508.GD3566091@liuwe-devbox-debian-v2.local>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 8/24/2026 5:45 AM, Wei Liu wrote:
> On Tue, Jul 28, 2026 at 01:51:16PM +0000, Naman Jain wrote:
>> fixup_irqs() re-injects a pending interrupt on its new target CPU by
>> looking at the outermost domain chip and invoking its irq_retrigger()
>> callback directly. That only works when the outermost chip happens to
>> install an irq_retrigger() callback, which is not guaranteed for every
>> irqchip and could lead to lost interrupts on CPU hot-unplug.
>>
>> Use irq_chip_retrigger_hierarchy() instead, which walks up the interrupt
>> hierarchy until it finds a chip that implements irq_retrigger().
>>
>> While at it, move the loop-local variables into the loop scope and use a
>> scoped guard for desc->lock.
>>
>> No functional change intended for chips which already provide an
>> irq_retrigger() callback on the outermost domain.
>>
>> Suggested-by: Thomas Gleixner <tglx@kernel.org>
>> Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
> 
> I can pick this up as part of this series but this requires an ack from
> Thomas.
> 
> Wei

Hi Wei,
Patch 1 that you picked is same in v1, v2, so that is fine.
But there's v2 for this series, where the rest of the patches are being 
discussed.

https://lore.kernel.org/all/fc7c4d74-d861-4268-8044-fa83748572f4@linux.microsoft.com/

Regards,
Naman

> 
>> ---
>>   arch/x86/kernel/irq.c | 23 +++++++----------------
>>   1 file changed, 7 insertions(+), 16 deletions(-)
>>
>> diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
>> index 30122f0b3af96..ef1bdd3c4659a 100644
>> --- a/arch/x86/kernel/irq.c
>> +++ b/arch/x86/kernel/irq.c
>> @@ -466,11 +466,6 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_posted_msi_notification)
>>   /* A cpu has been removed from cpu_online_mask.  Reset irq affinities. */
>>   void fixup_irqs(void)
>>   {
>> -	unsigned int vector;
>> -	struct irq_desc *desc;
>> -	struct irq_data *data;
>> -	struct irq_chip *chip;
>> -
>>   	irq_migrate_all_off_this_cpu();
>>   
>>   	/*
>> @@ -489,22 +484,18 @@ void fixup_irqs(void)
>>   	 * vector_lock because the cpu is already marked !online, so
>>   	 * nothing else will touch it.
>>   	 */
>> -	for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
>> -		if (IS_ERR_OR_NULL(__this_cpu_read(vector_irq[vector])))
>> +	for (unsigned int vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
>> +		struct irq_desc *desc = __this_cpu_read(vector_irq[vector]);
>> +
>> +		if (IS_ERR_OR_NULL(desc))
>>   			continue;
>>   
>>   		if (is_vector_pending(vector)) {
>> -			desc = __this_cpu_read(vector_irq[vector]);
>> -
>> -			raw_spin_lock(&desc->lock);
>> -			data = irq_desc_get_irq_data(desc);
>> -			chip = irq_data_get_irq_chip(data);
>> -			if (chip->irq_retrigger) {
>> -				chip->irq_retrigger(data);
>> +			guard(raw_spinlock)(&desc->lock);
>> +			if (irq_chip_retrigger_hierarchy(&desc->irq_data))
>>   				__this_cpu_write(vector_irq[vector], VECTOR_RETRIGGERED);
>> -			}
>> -			raw_spin_unlock(&desc->lock);
>>   		}
>> +
>>   		if (__this_cpu_read(vector_irq[vector]) != VECTOR_RETRIGGERED)
>>   			__this_cpu_write(vector_irq[vector], VECTOR_UNUSED);
>>   	}
>> -- 
>> 2.43.0
>>
>>


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id A9C6E3B2FFB;
	Mon, 24 Aug 2026 05:41:55 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1787550116; cv=none; b=rTs9SlqvFcCPZQUCdMMJ5D46V7h+IWVwbygOmadDiJkHSOeIroPm3xfuQU2UpOQenEDo45BxkkQbDHgEdjOEXgfrehGw+WknW08GxaThsqexSBUauNTBpF7vF2J17eWdUX/hpu/yRm+z8qMEQA4vzHgo541PYfIAC5UgqEaSsuk=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1787550116; c=relaxed/simple;
	bh=RCZj70h0+gYIXU+6RyJFQ+PlAyNXP9sJti6tHncp4sA=;
	h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
	 In-Reply-To:Content-Type; b=ilcHjctYbdGUEC/T7uRr/i8GVgX/+HTK/5xiaXVu55vJDMKM+D0A+OIIy6pu7aDiqR5944aOt2MKF2h3H31sr/K9VGNFlww7CEJT6YM70KDU985rw343L6F2UbM4/nSGh3CZJSzqo1JMOMi0YkUgrI2FbovpJ/IvX26Ud2DHo3E=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=kuvk0Vi+; arc=none smtp.client-ip=13.77.154.182
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="kuvk0Vi+"
Received: from [192.168.1.70] (unknown [4.194.122.170])
	by linux.microsoft.com (Postfix) with ESMTPSA id 8F90D20B7166;
	Sun, 23 Aug 2026 22:41:15 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8F90D20B7166
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1787550084;
	bh=je3FEBmIEIOvsJhScsyZLYxCRxTa76SkmSSg/ZomV6U=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=kuvk0Vi+pymQ/UuXARFFGORUloQgEw0Du0vCrFKDWsAIcctqmsAWLgTSTBZ/A+u4r
	 tShGcij72kbJtmcqWmzORHSaFl2uKAU3pEHjPj6h7jnoVU/Sj0C+jwaPFtvkg9LKF1
	 hkYON3p1O9jhoEecOlIokHJ91buXtWTAFCwYfCSA=
Message-ID: <f763801e-04b1-4c38-9625-78da5797d85d@linux.microsoft.com>
Date: Mon, 24 Aug 2026 11:11:42 +0530
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/3] x86/irq, iommu/amd, PCI: Drop redundant irq_retrigger
 inits
To: Wei Liu <wei.liu@kernel.org>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>,
 Haiyang Zhang <haiyangz@microsoft.com>, Dexuan Cui <decui@microsoft.com>,
 Long Li <longli@microsoft.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>,
 =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= <kwilczynski@kernel.org>,
 Manivannan Sadhasivam <mani@kernel.org>, Rob Herring <robh@kernel.org>,
 Bjorn Helgaas <bhelgaas@google.com>, Thomas Gleixner <tglx@kernel.org>,
 Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
 Dave Hansen <dave.hansen@linux.intel.com>, "H. Peter Anvin" <hpa@zytor.com>,
 "Joerg Roedel (AMD)" <joro@8bytes.org>,
 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
 Vasant Hegde <vasant.hegde@amd.com>, Will Deacon <will@kernel.org>,
 Robin Murphy <robin.murphy@arm.com>, x86@kernel.org,
 Jake Oshins <jakeo@microsoft.com>, linux-hyperv@vger.kernel.org,
 linux-pci@vger.kernel.org, iommu@lists.linux.dev,
 linux-kernel@vger.kernel.org
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
 <20260728135117.2888175-4-namjain@linux.microsoft.com>
 <20260824001747.GE3566091@liuwe-devbox-debian-v2.local>
Content-Language: en-US
From: Naman Jain <namjain@linux.microsoft.com>
In-Reply-To: <20260824001747.GE3566091@liuwe-devbox-debian-v2.local>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 8/24/2026 5:47 AM, Wei Liu wrote:
> On Tue, Jul 28, 2026 at 01:51:17PM +0000, Naman Jain wrote:
> [...]
>> diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
>> index ea3377e61aa5c..0c362e86a09d9 100644
>> --- a/drivers/iommu/amd/init.c
>> +++ b/drivers/iommu/amd/init.c
>> @@ -2468,7 +2468,6 @@ static struct irq_chip intcapxt_controller = {
>>   	.irq_unmask		= intcapxt_unmask_irq,
>>   	.irq_mask		= intcapxt_mask_irq,
>>   	.irq_ack		= irq_chip_ack_parent,
>> -	.irq_retrigger		= irq_chip_retrigger_hierarchy,
>>   	.irq_set_affinity       = intcapxt_set_affinity,
>>   	.irq_set_wake		= intcapxt_set_wake,
>>   	.flags			= IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_MOVE_DEFERRED,
>> diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
>> index 89816a2bd7cd3..cfc8fa403dad6 100644
>> --- a/drivers/pci/controller/pci-hyperv.c
>> +++ b/drivers/pci/controller/pci-hyperv.c
>> @@ -2119,7 +2119,6 @@ static bool hv_pcie_init_dev_msi_info(struct device *dev, struct irq_domain *dom
>>   	info->ops->msi_prepare = hv_msi_prepare;
>>   
>>   	chip->irq_set_affinity = irq_chip_set_affinity_parent;
>> -	chip->irq_retrigger = irq_chip_retrigger_hierarchy;
> 
> Acked-by: Wei Liu <wei.liu@kernel.org>.
> 
> I suppose you do this because the first patch is supposed to be
> backported.
> 
> Wei

Yes, exactly.

Regards,
Naman

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id B9EDF33939A;
	Mon, 24 Aug 2026 06:28:02 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1787552884; cv=none; b=qnKh8KJDvDANiww0SoZ50NACWFsehf9+OHGmjVGJGlyiQymuO+3ZoyyLzWPS5ncwV+/Iks2ddHHAswcM9pXPbFSqaorAIJ4yCxEUzg3TUSTTitlhfJvFz/s5ees9IY3vFwAtBjbTam0/85C8nd5gcrkk+JYw4VYqyOXmhpXeheg=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1787552884; c=relaxed/simple;
	bh=LkRtI3pmvjIoVMEzbKSKIuqvH8xMDB+uK0wyKOQxHVQ=;
	h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
	 In-Reply-To:Content-Type; b=X7irFO17FP8DV0mKVIi0YIkon80pvh1zx16FzYNz2dbgB1oEKlDmrmXjfkn7fpEWKWYKJDYlFDGcvnlwEiXGOrp8OW2WBkQq3HoSt/peJmiCDT33DEleJo6zLOzLWeA+Q1xre9CUYf0AjN3Qd/UrJEKzVYaby0oK4nOswDzwISU=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=HwvBEUZE; arc=none smtp.client-ip=13.77.154.182
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="HwvBEUZE"
Received: from [192.168.1.70] (unknown [4.194.122.144])
	by linux.microsoft.com (Postfix) with ESMTPSA id 835B120B7166;
	Sun, 23 Aug 2026 23:27:29 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 835B120B7166
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1787552851;
	bh=O4pr4hYlgjdfgeWFfFKRFT/vKwaQD3nS7Ku4eOeDQ5w=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=HwvBEUZEywrg293E6Up5D+IQNqqle+GOIVLaAS0DJQa8fHA29EFvVURYCtrzITnXb
	 /AyslYGxR00vU4x030h1eMC6XWq/EQ7cEzsDnj/e8M9lUC1KkboMVhJqiUIaDY5eMu
	 hdG5uJzOnzvOJIpZ9JtBXQGJsGkhfEphiC14EASY=
Message-ID: <c165f17f-b214-4a96-a446-6dd4e6cb2161@linux.microsoft.com>
Date: Mon, 24 Aug 2026 11:57:56 +0530
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/3] PCI: hv: Set irq_retrigger callback for the Hyper-V
 PCI MSI irqchip
To: Wei Liu <wei.liu@kernel.org>
Cc: sashiko-reviews@lists.linux.dev, linux-pci@vger.kernel.org,
 linux-hyperv@vger.kernel.org
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
 <20260728135117.2888175-2-namjain@linux.microsoft.com>
 <20260728140427.714311F000E9@smtp.kernel.org>
 <a9d44162-3c90-44c8-aae7-4813678234a9@linux.microsoft.com>
 <20260824001406.GC3566091@liuwe-devbox-debian-v2.local>
Content-Language: en-US
From: Naman Jain <namjain@linux.microsoft.com>
In-Reply-To: <20260824001406.GC3566091@liuwe-devbox-debian-v2.local>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 8/24/2026 5:44 AM, Wei Liu wrote:
> On Thu, Jul 30, 2026 at 04:56:27PM +0530, Naman Jain wrote:
>>
>>
>> On 7/28/2026 7:34 PM, sashiko-bot@kernel.org wrote:
>>> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
>>>
>>> Pre-existing issues:
>>> - [High] The fix for dropped pending interrupts during CPU hot-unplug was missed in the sister Hyper-V root partition MSI domain.
>>> --
>>>
>>> --- Patch [1]: [PATCH 1/3] PCI: hv: Set irq_retrigger callback for the Hyper-V PCI MSI irqchip ---
>>> commit b8b1c843c457dd145f0d360b44f4b1bf34bd8cf5
>>> Author: Naman Jain <namjain@linux.microsoft.com>
>>>
>>> PCI: hv: Set irq_retrigger callback for the Hyper-V PCI MSI irqchip
>>>
>>> The Hyper-V vPCI MSI irqchip never installs an irq_retrigger() callback.
>>> On CPU hot-unplug fixup_irqs() migrates the interrupts which are affine to
>>> the outgoing CPU to a new target. As the Hyper-V PCI/MSI chip does not
>>> provide that callback, the pending interrupt is silently dropped, which
>>> can result in lost interrupts, stalls and "No irq handler for vector"
>>> messages.
>>>
>>> Fixes: 4daace0d8ce85 ("PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs")
>>> Cc: stable@vger.kernel.org
>>> Suggested-by: Long Li <longli@microsoft.com>
>>> Suggested-by: Thomas Gleixner <tglx@kernel.org>
>>> Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
>>>
>>>> diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
>>>> index cfc8fa403dad6..89816a2bd7cd3 100644
>>>> --- a/drivers/pci/controller/pci-hyperv.c
>>>> +++ b/drivers/pci/controller/pci-hyperv.c
>>>> @@ -2119,6 +2119,7 @@ static bool hv_pcie_init_dev_msi_info(struct device *dev, struct irq_domain *dom
>>>>    	info->ops->msi_prepare = hv_msi_prepare;
>>>>    	chip->irq_set_affinity = irq_chip_set_affinity_parent;
>>>> +	chip->irq_retrigger = irq_chip_retrigger_hierarchy;
>>>
>>> [Severity: High]
>>> This isn't a bug introduced by this patch, but does the sister Hyper-V root
>>> partition MSI domain in arch/x86/hyperv/irqdomain.c also need this fix?
>>>
>>> Looking at hv_init_dev_msi_info(), it appears to be missing the exact same
>>> callback initialization for the root partition's top-level irq_chip:
>>>
>>> arch/x86/hyperv/irqdomain.c:hv_init_dev_msi_info() {
>>> 	...
>>> 	if (!msi_lib_init_dev_msi_info(dev, domain, real_parent, info))
>>> 		return false;
>>>
>>> 	chip->flags |= IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MOVE_DEFERRED;
>>>
>>> 	info->ops->msi_prepare = pci_msi_prepare;
>>>
>>> 	return true;
>>> }
>>>
>>> If a CPU is hot-unplugged while a device MSI interrupt is pending in its
>>> local APIC IRR, could fixup_irqs() fail to resend the pending interrupt
>>> to the new target CPU because this callback is NULL?
>>>
>>> This could potentially lead to the same lost interrupts and I/O stalls
>>> described in this commit message, just in the root partition MSI domain
>>> instead of the guest paravirtual MSI domain.
>>>
>>>>    	if (IS_ENABLED(CONFIG_X86))
>>>>    		chip->flags |= IRQCHIP_MOVE_DEFERRED;
>>>>
>>>
>>
>> I am not planning to include this in this series, since this issue is not
>> seen in root partition yet and I am not sure if it is applicable here.
>> Second patch would anyways fix it going forward, but I am OK adding the
>> change for this, if we need.
> 
> What's the downside of fixing the root partition irq domain?

No downside as such. It would be a latent bug, exposed only if we 
exercise hotplug in root partition, which seems like we don't. After 
patch 2 of this series, that would go away anyways. If you tell me, I 
can add a change similar to patch 1, which is backportable, but then I 
would need to remove it similarly in patch 3.

Regards,
Naman

> 
> We never really attempted to unplug any CPU from the root partition, so
> it is unsurprising that it has not been reported.
> 
> Wei
> 
>>
>> Regards,
>> Naman
>>


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB0AD340A6F;
	Mon, 24 Aug 2026 16:59:09 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1787590750; cv=none; b=Vkwhm/nxuIGvzNUuTa3lvNzq++OkYsP0ddwjDzMKUq9P54o9xEbiC1IFJe0b0rjZRzevgwZm6Jjw2jqmvQjunjft7eRPwY+pwzA7/jfA/Ti8NmYH0QkkUz09hdnTciI3gsdOUv7vwuXEUCCf6Sa0QHFsmVNmPMQithuzCYxQZ4c=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1787590750; c=relaxed/simple;
	bh=xbQa7dZ9Yyh1PjOBCsUdSB4J3sIWqKu8xF2eMCloQo8=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=IWJWfrW43B+jdAW4ifa+D5tnZEtqlVSk7UDkBqAAV1mpQWqDcTNU2WawU3kII9EEIKyg90zjQxTVHdnWOMI4FUCxgCtLNc1wkSKx7mHY8KuT/q4BFLaScWhHZ+EVIzm2vMwjZdW7xGOZ//uTAC//r0TRPAVx6SaE2QxyIeNV2Ro=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LnyTdvHz; arc=none smtp.client-ip=100.103.45.18
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LnyTdvHz"
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 375881F000E9;
	Mon, 24 Aug 2026 16:59:09 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1787590749;
	bh=5/BH79+CqA6IIdAR2F8+dBdDhwPn29fwNmv8Nwu8Y+I=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=LnyTdvHz2YraQUh4NvxfioN15s/U8HaegOZT09dZkHuomh1kk5ULHX1nwyhosuOG+
	 bE59RMkdfnFOzqj3/s93kQ7bv4wA4WulnSZBeV4jqvU6SV6zEZBKUbZpqAjhiF2bdx
	 AVJ4FJRALUpQQDeQBriuhCAb7UPCwwWnPj3jZdxtfhx6TMHZ80eEy6LpvU+b8ZY1c0
	 szlVY0UYzNWjyxzd07tBSAhyVEblhTUg7Mc0//rOXJtz1HZA653vnxtWg0WlLQlikc
	 ByMA44TJvzj4F/8kQp4DUibVs5//d50bgGDPN8nCyoBQBAf0eQ7GVib2meMCp4n5C6
	 HsJ21sCD9X6iw==
Date: Mon, 24 Aug 2026 09:59:08 -0700
From: Wei Liu <wei.liu@kernel.org>
To: Naman Jain <namjain@linux.microsoft.com>
Cc: Wei Liu <wei.liu@kernel.org>, sashiko-reviews@lists.linux.dev,
	linux-pci@vger.kernel.org, linux-hyperv@vger.kernel.org
Subject: Re: [PATCH 1/3] PCI: hv: Set irq_retrigger callback for the Hyper-V
 PCI MSI irqchip
Message-ID: <20260824165908.GC3665124@liuwe-devbox-debian-v2.local>
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
 <20260728135117.2888175-2-namjain@linux.microsoft.com>
 <20260728140427.714311F000E9@smtp.kernel.org>
 <a9d44162-3c90-44c8-aae7-4813678234a9@linux.microsoft.com>
 <20260824001406.GC3566091@liuwe-devbox-debian-v2.local>
 <c165f17f-b214-4a96-a446-6dd4e6cb2161@linux.microsoft.com>
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <c165f17f-b214-4a96-a446-6dd4e6cb2161@linux.microsoft.com>

On Mon, Aug 24, 2026 at 11:57:56AM +0530, Naman Jain wrote:
> 
> 
> On 8/24/2026 5:44 AM, Wei Liu wrote:
> > On Thu, Jul 30, 2026 at 04:56:27PM +0530, Naman Jain wrote:
> > > 
> > > 
> > > On 7/28/2026 7:34 PM, sashiko-bot@kernel.org wrote:
> > > > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> > > > 
> > > > Pre-existing issues:
> > > > - [High] The fix for dropped pending interrupts during CPU hot-unplug was missed in the sister Hyper-V root partition MSI domain.
> > > > --
> > > > 
> > > > --- Patch [1]: [PATCH 1/3] PCI: hv: Set irq_retrigger callback for the Hyper-V PCI MSI irqchip ---
> > > > commit b8b1c843c457dd145f0d360b44f4b1bf34bd8cf5
> > > > Author: Naman Jain <namjain@linux.microsoft.com>
> > > > 
> > > > PCI: hv: Set irq_retrigger callback for the Hyper-V PCI MSI irqchip
> > > > 
> > > > The Hyper-V vPCI MSI irqchip never installs an irq_retrigger() callback.
> > > > On CPU hot-unplug fixup_irqs() migrates the interrupts which are affine to
> > > > the outgoing CPU to a new target. As the Hyper-V PCI/MSI chip does not
> > > > provide that callback, the pending interrupt is silently dropped, which
> > > > can result in lost interrupts, stalls and "No irq handler for vector"
> > > > messages.
> > > > 
> > > > Fixes: 4daace0d8ce85 ("PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs")
> > > > Cc: stable@vger.kernel.org
> > > > Suggested-by: Long Li <longli@microsoft.com>
> > > > Suggested-by: Thomas Gleixner <tglx@kernel.org>
> > > > Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
> > > > 
> > > > > diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> > > > > index cfc8fa403dad6..89816a2bd7cd3 100644
> > > > > --- a/drivers/pci/controller/pci-hyperv.c
> > > > > +++ b/drivers/pci/controller/pci-hyperv.c
> > > > > @@ -2119,6 +2119,7 @@ static bool hv_pcie_init_dev_msi_info(struct device *dev, struct irq_domain *dom
> > > > >    	info->ops->msi_prepare = hv_msi_prepare;
> > > > >    	chip->irq_set_affinity = irq_chip_set_affinity_parent;
> > > > > +	chip->irq_retrigger = irq_chip_retrigger_hierarchy;
> > > > 
> > > > [Severity: High]
> > > > This isn't a bug introduced by this patch, but does the sister Hyper-V root
> > > > partition MSI domain in arch/x86/hyperv/irqdomain.c also need this fix?
> > > > 
> > > > Looking at hv_init_dev_msi_info(), it appears to be missing the exact same
> > > > callback initialization for the root partition's top-level irq_chip:
> > > > 
> > > > arch/x86/hyperv/irqdomain.c:hv_init_dev_msi_info() {
> > > > 	...
> > > > 	if (!msi_lib_init_dev_msi_info(dev, domain, real_parent, info))
> > > > 		return false;
> > > > 
> > > > 	chip->flags |= IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MOVE_DEFERRED;
> > > > 
> > > > 	info->ops->msi_prepare = pci_msi_prepare;
> > > > 
> > > > 	return true;
> > > > }
> > > > 
> > > > If a CPU is hot-unplugged while a device MSI interrupt is pending in its
> > > > local APIC IRR, could fixup_irqs() fail to resend the pending interrupt
> > > > to the new target CPU because this callback is NULL?
> > > > 
> > > > This could potentially lead to the same lost interrupts and I/O stalls
> > > > described in this commit message, just in the root partition MSI domain
> > > > instead of the guest paravirtual MSI domain.
> > > > 
> > > > >    	if (IS_ENABLED(CONFIG_X86))
> > > > >    		chip->flags |= IRQCHIP_MOVE_DEFERRED;
> > > > > 
> > > > 
> > > 
> > > I am not planning to include this in this series, since this issue is not
> > > seen in root partition yet and I am not sure if it is applicable here.
> > > Second patch would anyways fix it going forward, but I am OK adding the
> > > change for this, if we need.
> > 
> > What's the downside of fixing the root partition irq domain?
> 
> No downside as such. It would be a latent bug, exposed only if we exercise
> hotplug in root partition, which seems like we don't. After patch 2 of this
> series, that would go away anyways. If you tell me, I can add a change
> similar to patch 1, which is backportable, but then I would need to remove
> it similarly in patch 3.

Yes, please fix that for the root partition, too. Being consistent
across different use cases is going to save us some headache in the
future.

Wei

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 48EC53101A0;
	Tue, 25 Aug 2026 04:42:06 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1787632927; cv=none; b=SLqONQ7/nC/SBtqk+hRVmj3oD+iRBL8sVmdCQLmHr+0fevcEi+mwRkfCn0jFULXSsGA1K9m0Lcceh6InuN+xwb3nVUi5skMjChnARTqkFCNBGwmstVHUHairfpxDHxZF9IhgxhKSf/h16VxUw3cE4x3mbV/hQSM4u2Aj0v0iemE=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1787632927; c=relaxed/simple;
	bh=XE2Ab0GG9kmt8pSqRAwcSHToJNuqWMlTyG0wNh2OK0k=;
	h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
	 In-Reply-To:Content-Type; b=LBJOaejqDuqU4qW8Z1UeZe/Cg7h0Nv2HJgyLNBlFFi8gdKGbFtu3PF1zr24E84KR75gdu6kFqSWmkRRu0J5wKF9w2JYCE9UXdNVyw/7X0zf8MXweiGsq401/9+BUXvLYA4c1jspcV4gItX6TvzXVDMnxnW9cbcSAs9x7IHvFr/o=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=Q1WplNng; arc=none smtp.client-ip=13.77.154.182
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="Q1WplNng"
Received: from [192.168.1.70] (unknown [4.194.122.170])
	by linux.microsoft.com (Postfix) with ESMTPSA id 87D7B20B7166;
	Mon, 24 Aug 2026 21:41:32 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 87D7B20B7166
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
	s=default; t=1787632894;
	bh=2UJlLi20XMSxA7zww1xtzN2KILuXIuj1I5rEPmJqvNE=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=Q1WplNng40iw7ncVS17Q5u1PqVWhUxNiymQEfSN2ArTnRFvLIzqzVvrww0xrEqg1H
	 605U3ofKhG4QG2QZbp5FvZSFQ10JfKF3DhAhyBM/lCbHojurIl9xiwjqRPVpg779RO
	 KCffdDFS9wVMw8jEDoxV6SdBi7lbwZjj4JUZgeh4=
Message-ID: <fb4dfd8a-599d-4c4d-be76-4caef290da23@linux.microsoft.com>
Date: Tue, 25 Aug 2026 10:12:01 +0530
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/3] PCI: hv: Set irq_retrigger callback for the Hyper-V
 PCI MSI irqchip
To: Wei Liu <wei.liu@kernel.org>
Cc: sashiko-reviews@lists.linux.dev, linux-pci@vger.kernel.org,
 linux-hyperv@vger.kernel.org
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
 <20260728135117.2888175-2-namjain@linux.microsoft.com>
 <20260728140427.714311F000E9@smtp.kernel.org>
 <a9d44162-3c90-44c8-aae7-4813678234a9@linux.microsoft.com>
 <20260824001406.GC3566091@liuwe-devbox-debian-v2.local>
 <c165f17f-b214-4a96-a446-6dd4e6cb2161@linux.microsoft.com>
 <20260824165908.GC3665124@liuwe-devbox-debian-v2.local>
Content-Language: en-US
From: Naman Jain <namjain@linux.microsoft.com>
In-Reply-To: <20260824165908.GC3665124@liuwe-devbox-debian-v2.local>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 8/24/2026 10:29 PM, Wei Liu wrote:
> On Mon, Aug 24, 2026 at 11:57:56AM +0530, Naman Jain wrote:
>>
>>
>> On 8/24/2026 5:44 AM, Wei Liu wrote:
>>> On Thu, Jul 30, 2026 at 04:56:27PM +0530, Naman Jain wrote:
>>>>
>>>>
>>>> On 7/28/2026 7:34 PM, sashiko-bot@kernel.org wrote:
>>>>> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
>>>>>
>>>>> Pre-existing issues:
>>>>> - [High] The fix for dropped pending interrupts during CPU hot-unplug was missed in the sister Hyper-V root partition MSI domain.
>>>>> --
>>>>>
>>>>> --- Patch [1]: [PATCH 1/3] PCI: hv: Set irq_retrigger callback for the Hyper-V PCI MSI irqchip ---
>>>>> commit b8b1c843c457dd145f0d360b44f4b1bf34bd8cf5
>>>>> Author: Naman Jain <namjain@linux.microsoft.com>
>>>>>
>>>>> PCI: hv: Set irq_retrigger callback for the Hyper-V PCI MSI irqchip
>>>>>
>>>>> The Hyper-V vPCI MSI irqchip never installs an irq_retrigger() callback.
>>>>> On CPU hot-unplug fixup_irqs() migrates the interrupts which are affine to
>>>>> the outgoing CPU to a new target. As the Hyper-V PCI/MSI chip does not
>>>>> provide that callback, the pending interrupt is silently dropped, which
>>>>> can result in lost interrupts, stalls and "No irq handler for vector"
>>>>> messages.
>>>>>
>>>>> Fixes: 4daace0d8ce85 ("PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs")
>>>>> Cc: stable@vger.kernel.org
>>>>> Suggested-by: Long Li <longli@microsoft.com>
>>>>> Suggested-by: Thomas Gleixner <tglx@kernel.org>
>>>>> Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
>>>>>
>>>>>> diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
>>>>>> index cfc8fa403dad6..89816a2bd7cd3 100644
>>>>>> --- a/drivers/pci/controller/pci-hyperv.c
>>>>>> +++ b/drivers/pci/controller/pci-hyperv.c
>>>>>> @@ -2119,6 +2119,7 @@ static bool hv_pcie_init_dev_msi_info(struct device *dev, struct irq_domain *dom
>>>>>>     	info->ops->msi_prepare = hv_msi_prepare;
>>>>>>     	chip->irq_set_affinity = irq_chip_set_affinity_parent;
>>>>>> +	chip->irq_retrigger = irq_chip_retrigger_hierarchy;
>>>>>
>>>>> [Severity: High]
>>>>> This isn't a bug introduced by this patch, but does the sister Hyper-V root
>>>>> partition MSI domain in arch/x86/hyperv/irqdomain.c also need this fix?
>>>>>
>>>>> Looking at hv_init_dev_msi_info(), it appears to be missing the exact same
>>>>> callback initialization for the root partition's top-level irq_chip:
>>>>>
>>>>> arch/x86/hyperv/irqdomain.c:hv_init_dev_msi_info() {
>>>>> 	...
>>>>> 	if (!msi_lib_init_dev_msi_info(dev, domain, real_parent, info))
>>>>> 		return false;
>>>>>
>>>>> 	chip->flags |= IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MOVE_DEFERRED;
>>>>>
>>>>> 	info->ops->msi_prepare = pci_msi_prepare;
>>>>>
>>>>> 	return true;
>>>>> }
>>>>>
>>>>> If a CPU is hot-unplugged while a device MSI interrupt is pending in its
>>>>> local APIC IRR, could fixup_irqs() fail to resend the pending interrupt
>>>>> to the new target CPU because this callback is NULL?
>>>>>
>>>>> This could potentially lead to the same lost interrupts and I/O stalls
>>>>> described in this commit message, just in the root partition MSI domain
>>>>> instead of the guest paravirtual MSI domain.
>>>>>
>>>>>>     	if (IS_ENABLED(CONFIG_X86))
>>>>>>     		chip->flags |= IRQCHIP_MOVE_DEFERRED;
>>>>>>
>>>>>
>>>>
>>>> I am not planning to include this in this series, since this issue is not
>>>> seen in root partition yet and I am not sure if it is applicable here.
>>>> Second patch would anyways fix it going forward, but I am OK adding the
>>>> change for this, if we need.
>>>
>>> What's the downside of fixing the root partition irq domain?
>>
>> No downside as such. It would be a latent bug, exposed only if we exercise
>> hotplug in root partition, which seems like we don't. After patch 2 of this
>> series, that would go away anyways. If you tell me, I can add a change
>> similar to patch 1, which is backportable, but then I would need to remove
>> it similarly in patch 3.
> 
> Yes, please fix that for the root partition, too. Being consistent
> across different use cases is going to save us some headache in the
> future.
> 
> Wei

Acked.

Regards,
Naman


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B12440EB9C;
	Tue,  1 Sep 2026 14:54:24 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1788274465; cv=none; b=jbgPOJlBCmRH0zD0rZfbBcXWNxR0YMqx4HUJoq9QDMnBVgAP9ajRXf2BlqLanwIiBZbAZTRPp7hZBjCyxs+YTzrI/0EzvQx1144AQ85FXEGoIsKc91ZTFbA8zemNZ+RfLOPQSxsa0/QF7hiS1pq0cqProa1j6mG3+MglT9VTZNc=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1788274465; c=relaxed/simple;
	bh=2yqEFoZRV/gOa/QOao+FpoDyoS0SOeTraFB+BwNzpAw=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=OsSENMNrx1fTModBkoRLiXmfzaKniQrwDogGbAvkf8UIQwPtjAB1vFBOqAu8MmbbU3CkKv5rrlhKpfUQZLTOcGGtvdB2RQAIUDNcmICBNQY03RYyyaSaoESiRkCRQUWs+5S+LIBZASSCeqkxLnkzjPQLc+0EHgbmiEPpkXoVA44=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IC1MTE/t; arc=none smtp.client-ip=100.103.45.18
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IC1MTE/t"
Received: by smtp.kernel.org (Postfix) with ESMTPSA id D34071F00A3A;
	Tue,  1 Sep 2026 14:54:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1788274463;
	bh=D2Aw6+sh/9HCL/pfHHy9+7bmNqAJtyeu2dn/jRsQJgE=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=IC1MTE/tMVT7MfUj42mlnRumBVMs0Rm/xghQWbRQcHvGBNhru2GFH08KM5UhSvayS
	 OALRscp688it1rCVtPNV0IRSPGGmNXq2mjNi7LiNt2WEcFTsPKJ1WzJKsBccr4tsXv
	 tZY0tv2wYn1IjVeCF1Nnt+tZC9sUhqCmIcsHf/zhyscNLrgxVWRM8oDcs68LyjG8vR
	 BxIq4EhT00TQ5qMH9/60r2uYHWsEWZTVUqiOXS2vGF3qZ1HujaBt9h930lqLGdRPat
	 HLEkJMdW+0IBfGakHXd+9uqbqcvWgrQseWY6weoQ0TUlDad0aFyfWblHe8GJyD0QZz
	 DymLFfIyqtr3A==
Date: Tue, 1 Sep 2026 16:53:58 +0200
From: Manivannan Sadhasivam <mani@kernel.org>
To: Naman Jain <namjain@linux.microsoft.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>, 
	Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>, 
	Long Li <longli@microsoft.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>, 
	Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= <kwilczynski@kernel.org>, Rob Herring <robh@kernel.org>, 
	Bjorn Helgaas <bhelgaas@google.com>, Thomas Gleixner <tglx@kernel.org>, 
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, 
	Dave Hansen <dave.hansen@linux.intel.com>, "H. Peter Anvin" <hpa@zytor.com>, 
	"Joerg Roedel (AMD)" <joro@8bytes.org>, Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>, 
	Vasant Hegde <vasant.hegde@amd.com>, Will Deacon <will@kernel.org>, 
	Robin Murphy <robin.murphy@arm.com>, x86@kernel.org, Jake Oshins <jakeo@microsoft.com>, 
	linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, iommu@lists.linux.dev, 
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] x86/irq: Fix lost interrupts on CPU hot-unplug for
 Hyper-V PCI/MSI
Message-ID: <7zu54oo4dx2dwnmu3ckxjbasszn6ayn2kq6kdhu2ce4ltlsmu3@jbzjlk52ydbf>
References: <20260728135117.2888175-1-namjain@linux.microsoft.com>
Precedence: bulk
X-Mailing-List: linux-hyperv@vger.kernel.org
List-Id: <linux-hyperv.vger.kernel.org>
List-Subscribe: <mailto:linux-hyperv+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-hyperv+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20260728135117.2888175-1-namjain@linux.microsoft.com>

On Tue, Jul 28, 2026 at 01:51:14PM +0000, Naman Jain wrote:
> On CPU hot-unplug, fixup_irqs() re-injects interrupts that are still
> pending in the outgoing CPU's IRR via the irqchip's irq_retrigger()
> callback. The Hyper-V vPCI MSI irqchip never installs one, so such a
> pending interrupt is silently dropped, leading to lost interrupts, stalls
> and "No irq handler for vector" messages.
> 
> Patch 1 is the minimal, backportable fix (Fixes:/Cc: stable) that installs
> irq_chip_retrigger_hierarchy() on the Hyper-V PCI/MSI chip. Patch 2 then
> switches fixup_irqs() to call irq_chip_retrigger_hierarchy() directly, so
> the retrigger works for any stacked irqchip without a per-chip callback.
> Patch 3 drops the now-redundant irq_retrigger() initializations.
> This way, patch 2 and 3 do not need to be backported.
> 
> The series follows the original RFC:
> Link: https://lore.kernel.org/all/87y0f3jhd6.ffs@fw13/
> 

Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> # PCI

- Mani

-- 
மணிவண்ணன் சதாசிவம்

