From f4d03430a2e32c34007b4e02dcf8e6844c48292a Mon Sep 17 00:00:00 2001 From: Mostafa Saleh Date: Fri, 20 Dec 2024 14:36:12 +0000 Subject: [PATCH] ANDROID: iommu/arm-smmu-v3-kvm: Move files out of KVM In Preparation of having SMMUv3 driver as an EL2 module move its files to drivers/iommu/... No functional change intended. Bug: 357781595 Bug: 384432312 Change-Id: I7c62d287103c6b2461d65d2cbe799a465ebd54f7 Signed-off-by: Mostafa Saleh --- arch/arm64/kvm/hyp/nvhe/Makefile | 8 +++++--- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-kvm.c | 3 +-- .../iommu/arm/arm-smmu-v3/pkvm}/arm-smmu-v3.c | 3 ++- .../iommu/arm/arm-smmu-v3/pkvm}/arm_smmu_v3.h | 0 .../iommu/arm/arm-smmu-v3/pkvm}/io-pgtable-arm.c | 3 ++- 5 files changed, 10 insertions(+), 7 deletions(-) rename {arch/arm64/kvm/hyp/nvhe/iommu => drivers/iommu/arm/arm-smmu-v3/pkvm}/arm-smmu-v3.c (99%) rename {include/kvm => drivers/iommu/arm/arm-smmu-v3/pkvm}/arm_smmu_v3.h (100%) rename {arch/arm64/kvm/hyp/nvhe/iommu => drivers/iommu/arm/arm-smmu-v3/pkvm}/io-pgtable-arm.c (99%) diff --git a/arch/arm64/kvm/hyp/nvhe/Makefile b/arch/arm64/kvm/hyp/nvhe/Makefile index e4f662b1447f..75c4a5777bac 100644 --- a/arch/arm64/kvm/hyp/nvhe/Makefile +++ b/arch/arm64/kvm/hyp/nvhe/Makefile @@ -16,9 +16,11 @@ hyp-obj-$(CONFIG_TRACING) += clock.o events.o trace.o hyp-obj-$(CONFIG_MODULES) += modules.o hyp-obj-y += $(lib-objs) -hyp-obj-$(CONFIG_ARM_SMMU_V3_PKVM) += iommu/arm-smmu-v3.o -hyp-obj-$(CONFIG_ARM_SMMU_V3_PKVM) += iommu/io-pgtable-arm.o \ - ../../../../../drivers/iommu/io-pgtable-arm-common.o +# There is no way to compile these separately as calling Makefile.nvhe again would +# create duplicate sections +hyp-obj-$(CONFIG_ARM_SMMU_V3_PKVM) += ../../../../../drivers/iommu/arm/arm-smmu-v3/pkvm/arm-smmu-v3.o +hyp-obj-$(CONFIG_ARM_SMMU_V3_PKVM) += ../../../../../drivers/iommu/arm/arm-smmu-v3/pkvm/io-pgtable-arm.o +hyp-obj-$(CONFIG_ARM_SMMU_V3_PKVM) += ../../../../../drivers/iommu/io-pgtable-arm-common.o $(obj)/hyp.lds: $(src)/hyp.lds.S FORCE $(call if_changed_dep,cpp_lds_S) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-kvm.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-kvm.c index e987c273ff3c..ebff2ff5a7ef 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-kvm.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-kvm.c @@ -13,9 +13,8 @@ #include #include -#include - #include "arm-smmu-v3.h" +#include "pkvm/arm_smmu_v3.h" extern struct kvm_iommu_ops kvm_nvhe_sym(smmu_ops); diff --git a/arch/arm64/kvm/hyp/nvhe/iommu/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/pkvm/arm-smmu-v3.c similarity index 99% rename from arch/arm64/kvm/hyp/nvhe/iommu/arm-smmu-v3.c rename to drivers/iommu/arm/arm-smmu-v3/pkvm/arm-smmu-v3.c index 22e4b021cf48..230f2d69e386 100644 --- a/arch/arm64/kvm/hyp/nvhe/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/pkvm/arm-smmu-v3.c @@ -6,7 +6,6 @@ */ #include #include -#include #include #include #include @@ -15,6 +14,8 @@ #include #include +#include "arm_smmu_v3.h" + #define ARM_SMMU_POLL_TIMEOUT_US 100000 /* 100ms arbitrary timeout */ size_t __ro_after_init kvm_hyp_arm_smmu_v3_count; diff --git a/include/kvm/arm_smmu_v3.h b/drivers/iommu/arm/arm-smmu-v3/pkvm/arm_smmu_v3.h similarity index 100% rename from include/kvm/arm_smmu_v3.h rename to drivers/iommu/arm/arm-smmu-v3/pkvm/arm_smmu_v3.h diff --git a/arch/arm64/kvm/hyp/nvhe/iommu/io-pgtable-arm.c b/drivers/iommu/arm/arm-smmu-v3/pkvm/io-pgtable-arm.c similarity index 99% rename from arch/arm64/kvm/hyp/nvhe/iommu/io-pgtable-arm.c rename to drivers/iommu/arm/arm-smmu-v3/pkvm/io-pgtable-arm.c index aa5bf7c0ed03..898500b3ba52 100644 --- a/arch/arm64/kvm/hyp/nvhe/iommu/io-pgtable-arm.c +++ b/drivers/iommu/arm/arm-smmu-v3/pkvm/io-pgtable-arm.c @@ -4,7 +4,6 @@ */ #include #include -#include #include #include #include @@ -13,6 +12,8 @@ #include #include +#include "arm_smmu_v3.h" + int arm_lpae_map_exists(void) { return -EEXIST;