From 3da3f51b335de90b134efc3f8029ee6c769197f2 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Mon, 14 Feb 2022 18:12:51 +0000 Subject: [PATCH] ANDROID: KVM: arm64: s2mpu: Remove host_stage2_adjust_mmio_range The function is superseded by the generic pkvm_iommu_host_stage2_adjust_range, remove it. Bug: 190463801 Signed-off-by: David Brazdil Change-Id: I7d138a3c2e2497bdc19e6e6e95b7870ac48d890e --- arch/arm64/kvm/hyp/nvhe/iommu/s2mpu.c | 29 --------------------------- 1 file changed, 29 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/iommu/s2mpu.c b/arch/arm64/kvm/hyp/nvhe/iommu/s2mpu.c index 202440d8d5b7..afa17a80d592 100644 --- a/arch/arm64/kvm/hyp/nvhe/iommu/s2mpu.c +++ b/arch/arm64/kvm/hyp/nvhe/iommu/s2mpu.c @@ -351,34 +351,6 @@ static void s2mpu_host_stage2_set_owner(phys_addr_t addr, size_t size, hyp_spin_unlock(&s2mpu_lock); } -static int s2mpu_host_stage2_adjust_mmio_range(phys_addr_t addr, phys_addr_t *start, - phys_addr_t *end) -{ - struct pkvm_iommu *dev; - phys_addr_t dev_start, dev_end, int_start, int_end; - - /* Find the PA interval in the non-empty, sorted list of S2MPUs. */ - int_start = 0; - for_each_s2mpu(dev) { - dev_start = dev->pa; - dev_end = dev_start + S2MPU_MMIO_SIZE; - int_end = dev_start; - - if (dev_start <= addr && addr < dev_end) - return -EPERM; - - if (int_start <= addr && addr < int_end) - break; - - int_start = dev_end; - int_end = PA_MAX; - } - - *start = max(*start, int_start); - *end = min(*end, int_end); - return 0; -} - static bool s2mpu_host_smc_handler(struct kvm_cpu_context *host_ctxt) { DECLARE_REG(u64, fn, host_ctxt, 0); @@ -547,5 +519,4 @@ const struct kvm_iommu_ops kvm_s2mpu_ops = (struct kvm_iommu_ops){ .host_smc_handler = s2mpu_host_smc_handler, .host_mmio_dabt_handler = s2mpu_host_mmio_dabt_handler, .host_stage2_set_owner = s2mpu_host_stage2_set_owner, - .host_stage2_adjust_mmio_range = s2mpu_host_stage2_adjust_mmio_range, };