diff --git a/arch/arm64/include/asm/kvm_hypevents.h b/arch/arm64/include/asm/kvm_hypevents.h index 956023650df2..2411436db9f9 100644 --- a/arch/arm64/include/asm/kvm_hypevents.h +++ b/arch/arm64/include/asm/kvm_hypevents.h @@ -125,4 +125,18 @@ HYP_EVENT(selftest, ); #endif +HYP_EVENT(iommu_idmap, + HE_PROTO(u64 from, u64 to, int prot), + HE_STRUCT( + he_field(u64, from) + he_field(u64, to) + he_field(int, prot) + ), + HE_ASSIGN( + __entry->from = from; + __entry->to = to; + __entry->prot = prot; + ), + HE_PRINTK("from=0x%llx to=0x%llx prot=0x%x", __entry->from, __entry->to, __entry->prot) +); #endif /* __ARM64_KVM_HYPEVENTS_H_ */ diff --git a/arch/arm64/kvm/hyp/nvhe/iommu/iommu.c b/arch/arm64/kvm/hyp/nvhe/iommu/iommu.c index 93b0508e9ae5..509c22fc9ca2 100644 --- a/arch/arm64/kvm/hyp/nvhe/iommu/iommu.c +++ b/arch/arm64/kvm/hyp/nvhe/iommu/iommu.c @@ -5,6 +5,7 @@ * Copyright (C) 2022 Linaro Ltd. */ #include +#include #include @@ -478,6 +479,8 @@ void kvm_iommu_host_stage2_idmap(phys_addr_t start, phys_addr_t end, if (!kvm_iommu_is_ready()) return; + trace_iommu_idmap(start, end, prot); + domain = __handle_to_domain(KVM_IOMMU_DOMAIN_IDMAP_ID, false); kvm_iommu_ops->host_stage2_idmap(domain, start, end, pkvm_to_iommu_prot(prot));