]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iommu/hyperv: Create hyperv subdirectory under drivers/iommu
authorMukesh R <mrathor@linux.microsoft.com>
Wed, 3 Jun 2026 22:50:10 +0000 (15:50 -0700)
committerWei Liu <wei.liu@kernel.org>
Mon, 8 Jun 2026 05:55:56 +0000 (22:55 -0700)
Create hyperv subdirectory under drivers/iommu in anticipation of more
Hyper-V related files from upcoming PCI passthrough and PV-IOMMU patches.
Also, the current file hyperv-iommu.c actually implements irq remapping on
x86, so rename to more appropriate hv-irq-remap-x86.c and move it under
the new hyperv subdirectory. Since this file implements irq_remap_ops
exposed by drivers/iommu/irq_remapping.h, it cannot be relocated to the
irq directory. This is in sync with other backend directories like amd
and intel there.

Lastly, this file should not be tied to CONFIG_HYPERV_IOMMU, but to
CONFIG_HYPERV and CONFIG_IRQ_REMAP.

Signed-off-by: Mukesh R <mrathor@linux.microsoft.com>
Reviewed-by: Jacob Pan <jacob.pan@linux.microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
MAINTAINERS
drivers/iommu/Kconfig
drivers/iommu/Makefile
drivers/iommu/hyperv/Makefile [new file with mode: 0644]
drivers/iommu/hyperv/hv-irq-remap-x86.c [moved from drivers/iommu/hyperv-iommu.c with 99% similarity]
drivers/iommu/irq_remapping.c

index b539be153f6a4c75c1de9cdfd9884f0b46cbc791..93a7105e9cefd9bdf206187bced2d98a617aa393 100644 (file)
@@ -11988,7 +11988,7 @@ F:      drivers/clocksource/hyperv_timer.c
 F:     drivers/hid/hid-hyperv.c
 F:     drivers/hv/
 F:     drivers/input/serio/hyperv-keyboard.c
-F:     drivers/iommu/hyperv-iommu.c
+F:     drivers/iommu/hyperv/
 F:     drivers/net/ethernet/microsoft/
 F:     drivers/net/hyperv/
 F:     drivers/pci/controller/pci-hyperv-intf.c
index f86262b11416d1fe60effb4f5f62cb1a86b935f3..1becc0f20222349a2dcb4850ab9f10d575d8027e 100644 (file)
@@ -351,15 +351,6 @@ config MTK_IOMMU_V1
 
          if unsure, say N here.
 
-config HYPERV_IOMMU
-       bool "Hyper-V IRQ Handling"
-       depends on HYPERV && X86
-       select IOMMU_API
-       default HYPERV
-       help
-         Stub IOMMU driver to handle IRQs to support Hyper-V Linux
-         guest and root partitions.
-
 config VIRTIO_IOMMU
        tristate "Virtio IOMMU driver"
        depends on VIRTIO
index 0275821f4ef985bc2162ca3ce9c75f4452142451..d9683422aecbd92f9d1b93bbf42428dfaffa8444 100644 (file)
@@ -4,6 +4,7 @@ obj-$(CONFIG_AMD_IOMMU) += amd/
 obj-$(CONFIG_INTEL_IOMMU) += intel/
 obj-$(CONFIG_RISCV_IOMMU) += riscv/
 obj-$(CONFIG_GENERIC_PT) += generic_pt/fmt/
+obj-$(CONFIG_HYPERV) += hyperv/
 obj-$(CONFIG_IOMMU_API) += iommu.o
 obj-$(CONFIG_IOMMU_SUPPORT) += iommu-pages.o
 obj-$(CONFIG_IOMMU_API) += iommu-traces.o
@@ -30,7 +31,6 @@ obj-$(CONFIG_TEGRA_IOMMU_SMMU) += tegra-smmu.o
 obj-$(CONFIG_EXYNOS_IOMMU) += exynos-iommu.o
 obj-$(CONFIG_FSL_PAMU) += fsl_pamu.o fsl_pamu_domain.o
 obj-$(CONFIG_S390_IOMMU) += s390-iommu.o
-obj-$(CONFIG_HYPERV_IOMMU) += hyperv-iommu.o
 obj-$(CONFIG_VIRTIO_IOMMU) += virtio-iommu.o
 obj-$(CONFIG_IOMMU_SVA) += iommu-sva.o
 obj-$(CONFIG_IOMMU_IOPF) += io-pgfault.o
diff --git a/drivers/iommu/hyperv/Makefile b/drivers/iommu/hyperv/Makefile
new file mode 100644 (file)
index 0000000..6ef0ef9
--- /dev/null
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0
+obj-$(CONFIG_IRQ_REMAP) += hv-irq-remap-x86.o
similarity index 99%
rename from drivers/iommu/hyperv-iommu.c
rename to drivers/iommu/hyperv/hv-irq-remap-x86.c
index 479103261ae6a6697edab80a7edc0956e35985d6..4963c9ce05dc5a1eeb7874d6756009c350090568 100644 (file)
@@ -22,9 +22,7 @@
 #include <asm/hypervisor.h>
 #include <asm/mshyperv.h>
 
-#include "irq_remapping.h"
-
-#ifdef CONFIG_IRQ_REMAP
+#include "../irq_remapping.h"
 
 /*
  * According 82093AA IO-APIC spec , IO APIC has a 24-entry Interrupt
@@ -330,5 +328,3 @@ static const struct irq_domain_ops hyperv_root_ir_domain_ops = {
        .alloc = hyperv_root_irq_remapping_alloc,
        .free = hyperv_root_irq_remapping_free,
 };
-
-#endif
index c2443659812a8036b632529a161450c6100ba79d..41bf65e4ea88f4cbfb26718711d1e47ef5367388 100644 (file)
@@ -108,7 +108,7 @@ int __init irq_remapping_prepare(void)
        else if (IS_ENABLED(CONFIG_AMD_IOMMU) &&
                 amd_iommu_irq_ops.prepare() == 0)
                remap_ops = &amd_iommu_irq_ops;
-       else if (IS_ENABLED(CONFIG_HYPERV_IOMMU) &&
+       else if (IS_ENABLED(CONFIG_HYPERV) &&
                 hyperv_irq_remap_ops.prepare() == 0)
                remap_ops = &hyperv_irq_remap_ops;
        else