[COMMON] iommu/exynos: improve SLPD logging
authorJanghyuck Kim <janghyuck.kim@samsung.com>
Tue, 3 Apr 2018 11:44:39 +0000 (20:44 +0900)
committerJanghyuck Kim <janghyuck.kim@samsung.com>
Mon, 23 Jul 2018 05:39:03 +0000 (14:39 +0900)
When SLPD is allocated and freed, logging for base address is added.

Change-Id: I19ea17808278f455b5faf3db3fddffdd9beec73e
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
drivers/iommu/exynos-iommu-log.c
drivers/iommu/exynos-iommu-log.h
drivers/iommu/exynos-iommu.c

index f041982cfe336cea5fe2c1020b393be1d04a708e..da946fa4944f9be2c681b6c149772bb7c3b4fa2e 100644 (file)
@@ -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:
index 91aa215a464172c6d35c094f821e68a9bce883df..fa921793b23cdbdd2e28bcfce8518d8a2cbaf3cd 100644 (file)
@@ -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)
index c38f2a1525ea7bc6a5b0dffdb85b342659faaa2e..c2d9de9d3babd09380e861ccea4691262190fe7d 100644 (file)
@@ -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);
        }