Skip to content

Commit 6f490bb

Browse files
Stanislav Kinsburskiiliuw
authored andcommitted
PCI: hv: Use the correct hypercall for unmasking interrupts on nested
Running as nested root on MSHV imposes a different requirement for the pci-hyperv controller. In this setup, the interrupt will first come to the L1 (nested) hypervisor, which will deliver it to the appropriate root CPU. Instead of issuing the RETARGET hypercall, issue the MAP_DEVICE_INTERRUPT hypercall to L1 to complete the setup. Rename hv_arch_irq_unmask() to hv_irq_retarget_interrupt(). Co-developed-by: Jinank Jain <[email protected]> Signed-off-by: Jinank Jain <[email protected]> Signed-off-by: Stanislav Kinsburskii <[email protected]> Signed-off-by: Nuno Das Neves <[email protected]> Reviewed-by: Roman Kisel <[email protected]> Reviewed-by: Michael Kelley <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Link: https://lore.kernel.org/r/1752261532-7225-4-git-send-email-nunodasneves@linux.microsoft.com Signed-off-by: Wei Liu <[email protected]> Message-ID: <1752261532-7225-4-git-send-email-nunodasneves@linux.microsoft.com>
1 parent 52a45f8 commit 6f490bb

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

drivers/pci/controller/pci-hyperv.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ static unsigned int hv_msi_get_int_vector(struct irq_data *data)
600600
#define hv_msi_prepare pci_msi_prepare
601601

602602
/**
603-
* hv_arch_irq_unmask() - "Unmask" the IRQ by setting its current
603+
* hv_irq_retarget_interrupt() - "Unmask" the IRQ by setting its current
604604
* affinity.
605605
* @data: Describes the IRQ
606606
*
@@ -609,7 +609,7 @@ static unsigned int hv_msi_get_int_vector(struct irq_data *data)
609609
* is built out of this PCI bus's instance GUID and the function
610610
* number of the device.
611611
*/
612-
static void hv_arch_irq_unmask(struct irq_data *data)
612+
static void hv_irq_retarget_interrupt(struct irq_data *data)
613613
{
614614
struct msi_desc *msi_desc = irq_data_get_msi_desc(data);
615615
struct hv_retarget_device_interrupt *params;
@@ -714,6 +714,20 @@ static void hv_arch_irq_unmask(struct irq_data *data)
714714
dev_err(&hbus->hdev->device,
715715
"%s() failed: %#llx", __func__, res);
716716
}
717+
718+
static void hv_arch_irq_unmask(struct irq_data *data)
719+
{
720+
if (hv_root_partition())
721+
/*
722+
* In case of the nested root partition, the nested hypervisor
723+
* is taking care of interrupt remapping and thus the
724+
* MAP_DEVICE_INTERRUPT hypercall is required instead of
725+
* RETARGET_INTERRUPT.
726+
*/
727+
(void)hv_map_msi_interrupt(data, NULL);
728+
else
729+
hv_irq_retarget_interrupt(data);
730+
}
717731
#elif defined(CONFIG_ARM64)
718732
/*
719733
* SPI vectors to use for vPCI; arch SPIs range is [32, 1019], but leaving a bit

0 commit comments

Comments
 (0)