[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <168079879905.14175.16212926378045082102.stgit@skinsburskii.localdomain>
Date: Thu, 06 Apr 2023 09:33:24 -0700
From: Stanislav Kinsburskii <skinsburskii@...ux.microsoft.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Stanislav Kinsburskii <stanislav.kinsburskii@...il.com>,
"K. Y. Srinivasan" <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>, Dexuan Cui <decui@...rosoft.com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof Wilczyński <kw@...ux.com>,
Rob Herring <robh@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
linux-hyperv@...r.kernel.org, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] PCI: hv: Deal with nested MSHV setup
From: Stanislav Kinsburskii <stanislav.kinsburskii@...il.com>
Running Microsoft hypervisor as nested (i.e., on top of another Microsoft
hypervisor) imposes a different requirement for the PCI-hyperv controller.
In this setup, the interrupt will first come to the nested (L1) hypervisor
from the hypervisor, running on bare metal (L0), and then the L1 hypervisor
will deliver the interrupt to the appropriate CPU of the nested root
partition.
Thus, instead of issuing the RETARGET hypercall to the L0 hypervisor,
MAP_DEVICE_INTERRUPT hypercall should be issued to the L1 hypervisor to
complete the interrupt setup.
Signed-off-by: Stanislav Kinsburskii <stanislav.kinsburskii@...il.com>
CC: "K. Y. Srinivasan" <kys@...rosoft.com>
CC: Haiyang Zhang <haiyangz@...rosoft.com>
CC: Wei Liu <wei.liu@...nel.org>
CC: Dexuan Cui <decui@...rosoft.com>
CC: Lorenzo Pieralisi <lpieralisi@...nel.org>
CC: "Krzysztof Wilczyński" <kw@...ux.com>
CC: Rob Herring <robh@...nel.org>
CC: Bjorn Helgaas <bhelgaas@...gle.com>
CC: linux-hyperv@...r.kernel.org
CC: linux-pci@...r.kernel.org
CC: linux-kernel@...r.kernel.org
---
drivers/pci/controller/pci-hyperv.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
index f33370b75628..61bee8babad4 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -1570,7 +1570,16 @@ static void hv_irq_mask(struct irq_data *data)
static void hv_irq_unmask(struct irq_data *data)
{
- hv_arch_irq_unmask(data);
+ if (hv_nested && hv_root_partition)
+ /*
+ * In case of the nested root partition, the nested hypervisor
+ * is taking care of interrupt remapping and thus the
+ * MAP_DEVICE_INTERRUPT hypercall is required instead of the
+ * RETARGET_INTERRUPT one.
+ */
+ (void)hv_map_msi_interrupt(data, NULL);
+ else
+ hv_arch_irq_unmask(data);
if (data->parent_data->chip->irq_unmask)
irq_chip_unmask_parent(data);
Powered by blists - more mailing lists