Commit 17c51a0e authored by Lu Baolu's avatar Lu Baolu Committed by Joerg Roedel
Browse files

iommu: Separate SVA and IOPF



Add CONFIG_IOMMU_IOPF for page fault handling framework and select it
from its real consumer. Move iopf function declaration from iommu-sva.h
to iommu.h and remove iommu-sva.h as it's empty now.

Consolidate all SVA related code into iommu-sva.c:
- Move iommu_sva_domain_alloc() from iommu.c to iommu-sva.c.
- Move sva iopf handling code from io-pgfault.c to iommu-sva.c.

Consolidate iommu_report_device_fault() and iommu_page_response() into
io-pgfault.c.

Export iopf_free_group() and iopf_group_response() for iopf handlers
implemented in modules. Some functions are renamed with more meaningful
names. No other intentional functionality changes.

Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Tested-by: default avatarYan Zhao <yan.y.zhao@intel.com>
Tested-by: default avatarLongfang Liu <liulongfang@huawei.com>
Link: https://lore.kernel.org/r/20240212012227.119381-11-baolu.lu@linux.intel.com


Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 351ffcb1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -163,6 +163,9 @@ config IOMMU_SVA
	select IOMMU_MM_DATA
	bool

config IOMMU_IOPF
	bool

config FSL_PAMU
	bool "Freescale IOMMU support"
	depends on PCI
@@ -398,6 +401,7 @@ config ARM_SMMU_V3_SVA
	bool "Shared Virtual Addressing support for the ARM SMMUv3"
	depends on ARM_SMMU_V3
	select IOMMU_SVA
	select IOMMU_IOPF
	select MMU_NOTIFIER
	help
	  Support for sharing process address spaces with devices using the
+2 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ 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 io-pgfault.o
obj-$(CONFIG_IOMMU_SVA) += iommu-sva.o
obj-$(CONFIG_IOMMU_IOPF) += io-pgfault.o
obj-$(CONFIG_SPRD_IOMMU) += sprd-iommu.o
obj-$(CONFIG_APPLE_DART) += apple-dart.o
+0 −1
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@
#include <linux/slab.h>

#include "arm-smmu-v3.h"
#include "../../iommu-sva.h"
#include "../../io-pgtable-arm.h"

struct arm_smmu_mmu_notifier {
+0 −1
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@

#include "arm-smmu-v3.h"
#include "../../dma-iommu.h"
#include "../../iommu-sva.h"

static bool disable_bypass = true;
module_param(disable_bypass, bool, 0444);
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ config INTEL_IOMMU_SVM
	depends on X86_64
	select MMU_NOTIFIER
	select IOMMU_SVA
	select IOMMU_IOPF
	help
	  Shared Virtual Memory (SVM) provides a facility for devices
	  to access DMA resources through process address space by
Loading