diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h index 60a37ce9bc4f..a926b4bcf385 100644 --- a/arch/arm64/include/asm/kvm_asm.h +++ b/arch/arm64/include/asm/kvm_asm.h @@ -82,7 +82,6 @@ enum __kvm_host_smccc_func { __KVM_HOST_SMCCC_FUNC___pkvm_vcpu_sync_state, __KVM_HOST_SMCCC_FUNC___pkvm_iommu_driver_init, __KVM_HOST_SMCCC_FUNC___pkvm_iommu_register, - __KVM_HOST_SMCCC_FUNC___pkvm_iommu_pm_notify, }; #define DECLARE_KVM_VHE_SYM(sym) extern char sym[] diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index eac0593ffeaf..36cc006f36b0 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -390,16 +390,9 @@ enum pkvm_iommu_driver_id { PKVM_IOMMU_NR_DRIVERS, }; -enum pkvm_iommu_pm_event { - PKVM_IOMMU_PM_SUSPEND, - PKVM_IOMMU_PM_RESUME, -}; - int pkvm_iommu_driver_init(enum pkvm_iommu_driver_id drv_id, void *data, size_t size); int pkvm_iommu_register(struct device *dev, enum pkvm_iommu_driver_id drv_id, phys_addr_t pa, size_t size); -int pkvm_iommu_suspend(struct device *dev); -int pkvm_iommu_resume(struct device *dev); struct vcpu_reset_state { unsigned long pc; diff --git a/arch/arm64/kvm/hyp/include/nvhe/iommu.h b/arch/arm64/kvm/hyp/include/nvhe/iommu.h index 74eccae4d466..2b404d01693f 100644 --- a/arch/arm64/kvm/hyp/include/nvhe/iommu.h +++ b/arch/arm64/kvm/hyp/include/nvhe/iommu.h @@ -7,8 +7,6 @@ #include -struct pkvm_iommu; - struct pkvm_iommu_ops { /* * Global driver initialization called before devices are registered. @@ -25,10 +23,6 @@ struct pkvm_iommu_ops { */ int (*validate)(phys_addr_t base, size_t size); - /* Power management callbacks. Called with host lock held. */ - int (*suspend)(struct pkvm_iommu *dev); - int (*resume)(struct pkvm_iommu *dev); - /* Amount of memory allocated per-device for use by the driver. */ size_t data_size; }; @@ -40,7 +34,6 @@ struct pkvm_iommu { phys_addr_t pa; void *va; size_t size; - bool powered; char data[]; }; @@ -49,8 +42,6 @@ int __pkvm_iommu_register(unsigned long dev_id, enum pkvm_iommu_driver_id drv_id, phys_addr_t dev_pa, size_t dev_size, void *kern_mem_va, size_t mem_size); -int __pkvm_iommu_pm_notify(unsigned long dev_id, - enum pkvm_iommu_pm_event event); int pkvm_iommu_host_stage2_adjust_range(phys_addr_t addr, phys_addr_t *start, phys_addr_t *end); diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-main.c b/arch/arm64/kvm/hyp/nvhe/hyp-main.c index 5d7a3654af46..2e44697612dc 100644 --- a/arch/arm64/kvm/hyp/nvhe/hyp-main.c +++ b/arch/arm64/kvm/hyp/nvhe/hyp-main.c @@ -1001,14 +1001,6 @@ static void handle___pkvm_iommu_register(struct kvm_cpu_context *host_ctxt) dev_size, mem, mem_size); } -static void handle___pkvm_iommu_pm_notify(struct kvm_cpu_context *host_ctxt) -{ - DECLARE_REG(unsigned long, dev_id, host_ctxt, 1); - DECLARE_REG(enum pkvm_iommu_pm_event, event, host_ctxt, 2); - - cpu_reg(host_ctxt, 1) = __pkvm_iommu_pm_notify(dev_id, event); -} - typedef void (*hcall_t)(struct kvm_cpu_context *); #define HANDLE_FUNC(x) [__KVM_HOST_SMCCC_FUNC_##x] = (hcall_t)handle_##x @@ -1044,7 +1036,6 @@ static const hcall_t host_hcall[] = { HANDLE_FUNC(__pkvm_vcpu_sync_state), HANDLE_FUNC(__pkvm_iommu_driver_init), HANDLE_FUNC(__pkvm_iommu_register), - HANDLE_FUNC(__pkvm_iommu_pm_notify), }; static void handle_host_hcall(struct kvm_cpu_context *host_ctxt) diff --git a/arch/arm64/kvm/hyp/nvhe/iommu.c b/arch/arm64/kvm/hyp/nvhe/iommu.c index 4e9a7c39e745..0619096affca 100644 --- a/arch/arm64/kvm/hyp/nvhe/iommu.c +++ b/arch/arm64/kvm/hyp/nvhe/iommu.c @@ -166,19 +166,6 @@ static bool validate_against_existing_iommus(struct pkvm_iommu *dev) return true; } -static struct pkvm_iommu *find_iommu_by_id(unsigned long id) -{ - struct pkvm_iommu *dev; - - assert_host_component_locked(); - - list_for_each_entry(dev, &iommu_list, list) { - if (dev->id == id) - return dev; - } - return NULL; -} - /* * Initialize EL2 IOMMU driver. * @@ -302,30 +289,6 @@ out: return ret; } -int __pkvm_iommu_pm_notify(unsigned long dev_id, enum pkvm_iommu_pm_event event) -{ - struct pkvm_iommu *dev; - int ret; - - host_lock_component(); - dev = find_iommu_by_id(dev_id); - if (dev) { - if (event == PKVM_IOMMU_PM_SUSPEND) { - ret = dev->ops->suspend ? dev->ops->suspend(dev) : 0; - dev->powered = !!ret; - } else if (event == PKVM_IOMMU_PM_RESUME) { - ret = dev->ops->resume ? dev->ops->resume(dev) : 0; - dev->powered = !ret; - } else { - ret = -EINVAL; - } - } else { - ret = -ENODEV; - } - host_unlock_component(); - return ret; -} - /* * Check host memory access against IOMMUs' MMIO regions. * Returns -EPERM if the address is within the bounds of a registered device. diff --git a/arch/arm64/kvm/iommu.c b/arch/arm64/kvm/iommu.c index e13d36ec57e7..a845be0c8fa9 100644 --- a/arch/arm64/kvm/iommu.c +++ b/arch/arm64/kvm/iommu.c @@ -40,17 +40,3 @@ int pkvm_iommu_register(struct device *dev, enum pkvm_iommu_driver_id drv_id, } return ret; } - -int pkvm_iommu_suspend(struct device *dev) -{ - return kvm_call_hyp_nvhe(__pkvm_iommu_pm_notify, dev_to_id(dev), - PKVM_IOMMU_PM_SUSPEND); -} -EXPORT_SYMBOL_GPL(pkvm_iommu_suspend); - -int pkvm_iommu_resume(struct device *dev) -{ - return kvm_call_hyp_nvhe(__pkvm_iommu_pm_notify, dev_to_id(dev), - PKVM_IOMMU_PM_RESUME); -} -EXPORT_SYMBOL_GPL(pkvm_iommu_resume);