Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <jinankjain@linux.microsoft.com>
Signed-off-by: Jinank Jain <jinankjain@linux.microsoft.com>
Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Signed-off-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Reviewed-by: Roman Kisel <romank@linux.microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/1752261532-7225-4-git-send-email-nunodasneves@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <1752261532-7225-4-git-send-email-nunodasneves@linux.microsoft.com>

authored by

Stanislav Kinsburskii and committed by
Wei Liu
6f490bb4 52a45f87

+16 -2
+16 -2
drivers/pci/controller/pci-hyperv.c
··· 600 600 #define hv_msi_prepare pci_msi_prepare 601 601 602 602 /** 603 - * hv_arch_irq_unmask() - "Unmask" the IRQ by setting its current 603 + * hv_irq_retarget_interrupt() - "Unmask" the IRQ by setting its current 604 604 * affinity. 605 605 * @data: Describes the IRQ 606 606 * ··· 609 609 * is built out of this PCI bus's instance GUID and the function 610 610 * number of the device. 611 611 */ 612 - static void hv_arch_irq_unmask(struct irq_data *data) 612 + static void hv_irq_retarget_interrupt(struct irq_data *data) 613 613 { 614 614 struct msi_desc *msi_desc = irq_data_get_msi_desc(data); 615 615 struct hv_retarget_device_interrupt *params; ··· 713 713 if (!hv_result_success(res) && hbus->state != hv_pcibus_removing) 714 714 dev_err(&hbus->hdev->device, 715 715 "%s() failed: %#llx", __func__, res); 716 + } 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); 716 730 } 717 731 #elif defined(CONFIG_ARM64) 718 732 /*