ANDROID: KVM: arm64: iommu: Add idmap trace point

Add a trace point for identity mapping callback.

Bug: 277989609
Bug: 278749606

Change-Id: I918a7a22123f5358b27a77dc4e25bbec371b1efb
Signed-off-by: Mostafa Saleh <smostafa@google.com>
This commit is contained in:
Mostafa Saleh
2024-06-11 15:40:53 +00:00
parent b2e3ad4708
commit 9c760a21bb
2 changed files with 17 additions and 0 deletions
+14
View File
@@ -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_ */
+3
View File
@@ -5,6 +5,7 @@
* Copyright (C) 2022 Linaro Ltd.
*/
#include <asm/kvm_hyp.h>
#include <asm/kvm_hypevents.h>
#include <hyp/adjust_pc.h>
@@ -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));