diff --git a/arch/arm64/include/asm/kvm_hyp.h b/arch/arm64/include/asm/kvm_hyp.h index bf1ca0e6b97f..92a614b36625 100644 --- a/arch/arm64/include/asm/kvm_hyp.h +++ b/arch/arm64/include/asm/kvm_hyp.h @@ -133,6 +133,7 @@ extern unsigned int kvm_nvhe_sym(kvm_arm_vmid_bits); extern bool kvm_nvhe_sym(smccc_trng_available); struct kvm_iommu_ops { int (*init)(void); + bool (*host_smc_handler)(struct kvm_cpu_context *host_ctxt); }; extern struct kvm_iommu_ops kvm_iommu_ops; diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-main.c b/arch/arm64/kvm/hyp/nvhe/hyp-main.c index cf14b4ed6a83..9e4dd62c1c58 100644 --- a/arch/arm64/kvm/hyp/nvhe/hyp-main.c +++ b/arch/arm64/kvm/hyp/nvhe/hyp-main.c @@ -1194,6 +1194,8 @@ static void handle_host_smc(struct kvm_cpu_context *host_ctxt) bool handled; handled = kvm_host_psci_handler(host_ctxt); + if (!handled && kvm_iommu_ops.host_smc_handler) + handled = kvm_iommu_ops.host_smc_handler(host_ctxt); if (!handled) handled = kvm_host_ffa_handler(host_ctxt); if (!handled)