KVM: arm64: pviommu: Add free_domain() HVC
Add free_domain() HVC.
No special handling needed, just a call to the IOMMU layer.
Signed-off-by: Mostafa Saleh <smostafa@google.com>
diff --git a/arch/arm64/kvm/hyp/nvhe/iommu/pviommu.c b/arch/arm64/kvm/hyp/nvhe/iommu/pviommu.c
index 2ce7efd..cf221e3 100644
--- a/arch/arm64/kvm/hyp/nvhe/iommu/pviommu.c
+++ b/arch/arm64/kvm/hyp/nvhe/iommu/pviommu.c
@@ -187,7 +187,15 @@
static bool pkvm_guest_iommu_free_domain(struct pkvm_hyp_vcpu *hyp_vcpu)
{
- return false;
+ int ret;
+ struct kvm_vcpu *vcpu = &hyp_vcpu->vcpu;
+ u64 iommu_id = smccc_get_arg1(vcpu);
+ u64 domain_id = smccc_get_arg2(vcpu);
+
+ ret = kvm_iommu_free_domain(iommu_id, domain_id, hyp_vcpu);
+
+ smccc_set_retval(vcpu, ret, 0, 0, 0);
+ return true;
}
bool kvm_handle_pviommu_hvc(struct kvm_vcpu *vcpu, u64 *exit_code)