From 7f7407f21d51f59a4e17c2d1e8ad8d288cd81639 Mon Sep 17 00:00:00 2001 From: Janghyuck Kim Date: Tue, 3 Apr 2018 20:44:39 +0900 Subject: [PATCH] [COMMON] iommu/exynos: improve SLPD logging When SLPD is allocated and freed, logging for base address is added. Change-Id: I19ea17808278f455b5faf3db3fddffdd9beec73e Signed-off-by: Janghyuck Kim --- drivers/iommu/exynos-iommu-log.c | 4 +++- drivers/iommu/exynos-iommu-log.h | 4 ++-- drivers/iommu/exynos-iommu.c | 9 +++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/iommu/exynos-iommu-log.c b/drivers/iommu/exynos-iommu-log.c index f041982cfe33..da946fa4944f 100644 --- a/drivers/iommu/exynos-iommu-log.c +++ b/drivers/iommu/exynos-iommu-log.c @@ -88,7 +88,9 @@ static void exynos_iommu_debug_log_show(struct seq_file *s, break; case EVENT_SYSMMU_IOMMU_ALLOCSLPD: case EVENT_SYSMMU_IOMMU_FREESLPD: - seq_printf(s, " @ %#010x\n", log->eventdata.addr); + seq_printf(s, " @ [iova:%#010x, entry:%#010x)\n", + log->eventdata.range.start, + log->eventdata.range.end); break; case EVENT_SYSMMU_TLB_INV_RANGE: case EVENT_SYSMMU_IOMMU_UNMAP: diff --git a/drivers/iommu/exynos-iommu-log.h b/drivers/iommu/exynos-iommu-log.h index 91aa215a4641..fa921793b23c 100644 --- a/drivers/iommu/exynos-iommu-log.h +++ b/drivers/iommu/exynos-iommu-log.h @@ -192,8 +192,8 @@ DEFINE_SYSMMU_EVENT_LOG(TLB_INV_ALL) DEFINE_SYSMMU_EVENT_LOG(POWERON) DEFINE_SYSMMU_EVENT_LOG(POWEROFF) -DEFINE_SYSMMU_EVENT_LOG_1ADDR(IOMMU_ALLOCSLPD) -DEFINE_SYSMMU_EVENT_LOG_1ADDR(IOMMU_FREESLPD) +DEFINE_SYSMMU_EVENT_LOG_2ADDR(IOMMU_ALLOCSLPD) +DEFINE_SYSMMU_EVENT_LOG_2ADDR(IOMMU_FREESLPD) DEFINE_SYSMMU_EVENT_LOG_2ADDR(TLB_INV_RANGE) DEFINE_SYSMMU_EVENT_LOG_2ADDR(IOMMU_UNMAP) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index c38f2a1525ea..c2d9de9d3bab 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -979,7 +979,7 @@ static sysmmu_pte_t *alloc_lv2entry(struct exynos_iommu_domain *domain, pgtable_flush(pent, pent + NUM_LV2ENTRIES); pgtable_flush(sent, sent + 1); SYSMMU_EVENT_LOG_IOMMU_ALLOCSLPD(IOMMU_PRIV_TO_LOG(domain), - iova & SECT_MASK); + iova & SECT_MASK, *sent); } else { /* Pre-allocated entry is not used, so free it. */ kmem_cache_free(lv2table_kmem_cache, pent); @@ -1161,11 +1161,12 @@ unmap_flpd: kmem_cache_free(lv2table_kmem_cache, page_entry(sent, 0)); atomic_set(lv2entcnt, 0); - *sent = 0; SYSMMU_EVENT_LOG_IOMMU_FREESLPD( - IOMMU_PRIV_TO_LOG(domain), - iova_from_sent(domain->pgtable, sent)); + IOMMU_PRIV_TO_LOG(domain), + iova_from_sent(domain->pgtable, sent), *sent); + + *sent = 0; } spin_unlock_irqrestore(&domain->pgtablelock, flags); } -- 2.20.1