lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220730085657.31977-1-yf.wang@mediatek.com>
Date:   Sat, 30 Jul 2022 16:56:55 +0800
From:   <yf.wang@...iatek.com>
To:     Christoph Hellwig <hch@....de>,
        Robin Murphy <robin.murphy@....com>,
        "Marek Szyprowski" <m.szyprowski@...sung.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        "open list:DMA MAPPING HELPERS" <iommu@...ts.linux.dev>,
        open list <linux-kernel@...r.kernel.org>,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-arm-kernel@...ts.infradead.org>,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-mediatek@...ts.infradead.org>
CC:     <wsd_upstream@...iatek.com>, Libo Kang <Libo.Kang@...iatek.com>,
        Ning Li <Ning.Li@...iatek.com>, Yong Wu <Yong.Wu@...iatek.com>,
        Miles Chen <miles.chen@...iatek.com>,
        Yunfei Wang <yf.wang@...iatek.com>
Subject: [PATCH] dma-debug: Remove warning in dma_debug_entry

From: Yunfei Wang <yf.wang@...iatek.com>

The same physical address can be mapped multiple times, and it is not
required to have attributes such as DMA_ATTR_SKIP_CPU_SYNC, but
dma_debug_entry will report an warning if active_cacheline_insert
returns -EEXIST, which can cause a lot of trouble.

For example, if two dma engine share the same dma-buf, the two dma
engine drivers will call the DMA API to map their own dma address
respectively, which is normal follow, but dma_debug_entry will
report an warning.

In addition, if active_cacheline_insert returns -EEXIST, the
active_cacheline_inc_overlap function already has the logic to
check overlapping mappings counter, if it exceeded
ACTIVE_CACHELINE_MAX_OVERLAP overlapping mappings, it already
has a warning.
And also, if warning as panic is turned on, it will cause KE.

So, dma_debug_entry does not need report warning.

Signed-off-by: Yunfei Wang <yf.wang@...iatek.com>
---
 kernel/dma/debug.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c
index 2caafd13f8aa..ad731f7858c9 100644
--- a/kernel/dma/debug.c
+++ b/kernel/dma/debug.c
@@ -566,9 +566,6 @@ static void add_dma_entry(struct dma_debug_entry *entry, unsigned long attrs)
 	if (rc == -ENOMEM) {
 		pr_err_once("cacheline tracking ENOMEM, dma-debug disabled\n");
 		global_disable = true;
-	} else if (rc == -EEXIST && !(attrs & DMA_ATTR_SKIP_CPU_SYNC)) {
-		err_printk(entry->dev, entry,
-			"cacheline tracking EEXIST, overlapping mappings aren't supported\n");
 	}
 }
 
-- 
2.18.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ