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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: 
 <CO6PR18MB40981FD7DB1DA13E851F9EEBB0D02@CO6PR18MB4098.namprd18.prod.outlook.com>
Date: Fri, 28 Jun 2024 13:45:13 +0000
From: Witold Sadowski <wsadowski@...vell.com>
To: Mark Brown <broonie@...nel.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "robh@...nel.org"
	<robh@...nel.org>,
        "krzysztof.kozlowski+dt@...aro.org"
	<krzysztof.kozlowski+dt@...aro.org>,
        "conor+dt@...nel.org"
	<conor+dt@...nel.org>,
        "pthombar@...ence.com" <pthombar@...ence.com>
Subject: RE: [EXTERNAL] Re: [PATCH v9 4/9] spi: cadence: Add Marvell SDMA
 operations

Hi Mark
> 
> > +static void m_ioreadq(void __iomem  *addr, void *buf, int len) {
> > +	u64 tmp_buf;
> > +
> > +	while (len) {
> > +		tmp_buf = readq(addr);
> > +		memcpy(buf, &tmp_buf, len > 8 ? 8 : len);
> > +		len = len > 8 ? len - 8 : 0;
> > +		buf += 8;
> > +	}
> > +}
> 
> Wouldn't it be more efficient and readable to only do the memcpy() for the
> trailing bytes and just do this memcpy() for the final word?

The whole problem is with SDMA end - addr in that case. If code will try to
Read it in non 64b mode, all remaining bits, will be lost.
For example - doing 1B read on that register, will return 1B, but SDMA will
transfer 8B, dropping remaining 7B.
I have tried memcpy approach, and it was not stable.

Regards
Witek 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ