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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 13 Apr 2008 23:11:44 +0100
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Carsten Jacobi <carsten@...c.rwth-aachen.de>
Cc:	Florian Fainelli <florian.fainelli@...ecomint.eu>,
	netdev@...r.kernel.org
Subject: Re: [PATCH] lne390 and Jensen Alphas

On Sun, Apr 13, 2008 at 11:06:46PM +0200, Carsten Jacobi wrote:
> +	/* The mylex lne390 adapter requires 32bit access (see above) for every
> +	 * operation to the shared mem buffer. Since the block buffer is hardly
> +	 * aligned to a 32bit boundary memcpy_toio() will use 16bit
> +	 * operations to access the buffer ... we must use something else here. */
> +
> +	const void *from = buf;
> +	count -= 4;
> +	do {
> +		__raw_writel(*(const u16 *)from | (*(const u16 *)(from+2))<<16,
> +		(unsigned long) shmem);

The last argument of __raw_writel() is void __iomem *, not unsigned long.
WTF is that cast doing that?  Besides, it looks like misspelled
		const __le32 *from = buf;
		...
		__raw_writel(get_unaligned(from), shmem);

> +		(unsigned long) shmem += 4;

Write in C, please.  This isn't - you might as well write something like
	shmem * 2 -= 4;
since result of cast is not an l-value.

Finally, how much of that actually depends on Jensen and how much is
actually "oh, on x86 we use rep movsl in memcpy_toio(), so it ends up
with 32bit accesses"?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ