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>] [day] [month] [year] [list]
Message-ID: <20251027004657.562787-1-den@valinux.co.jp>
Date: Mon, 27 Oct 2025 09:46:57 +0900
From: Koichiro Den <den@...inux.co.jp>
To: dmaengine@...r.kernel.org,
	linux-renesas-soc@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: vkoul@...nel.org,
	geert+renesas@...der.be,
	magnus.damm@...il.com,
	kuninori.morimoto.gx@...esas.com
Subject: [PATCH] dmaengine: sh: rcar-dmac: Enable 1-byte transfer size for memcpy

Empirical testing shows that rcar-dmac engine can handle byte-aligned
addresses without issues. Relax the driver by reducing
RCAR_DMAC_MEMCPY_XFER_SIZE from 4 to 1 byte so that memcpy can run on
unaligned buffers.

One practical user is ntb_netdev + ntb_transport. On its TX path,
skb->data often ends up 2 bytes off a 4-byte boundary due to the 16-byte
headroom alignment (HH_DATA_MOD) combined with a 14-byte Ethernet header
push, yielding a 4n+2 start address, falling back to CPU memcpy. With
this change, rcar-dmac can be used there as well.

In local testing, hacking skb->data to be 4-byte aligned while keeping
RCAR_DMAC_MEMCPY_XFER_SIZE = 4 did not produce a measurable throughput
difference compared to the unaligned case with this change, suggesting
the previous 4-byte constraint was not performance-driven on the tested
systems.

Signed-off-by: Koichiro Den <den@...inux.co.jp>
---
 drivers/dma/sh/rcar-dmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 0c45ce8c74aa..c4d6c2f9a26b 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -303,7 +303,7 @@ struct rcar_dmac_of_data {
 #define RCAR_GEN4_DMACHCLR		0x0100
 
 /* Hardcode the MEMCPY transfer size to 4 bytes. */
-#define RCAR_DMAC_MEMCPY_XFER_SIZE	4
+#define RCAR_DMAC_MEMCPY_XFER_SIZE	1
 
 /* -----------------------------------------------------------------------------
  * Device access
-- 
2.48.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ