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: <20150720192531.GB19855@oracle.com>
Date:	Mon, 20 Jul 2015 21:25:31 +0200
From:	Sowmini Varadhan <sowmini.varadhan@...cle.com>
To:	Rasmus Villemoes <linux@...musvillemoes.dk>
Cc:	Guenter Roeck <linux@...ck-us.net>, linux-kernel@...r.kernel.org,
	akpm@...ux-foundation.org, benh@...nel.crashing.org,
	davem@...emloft.net
Subject: Re: [PATCH] iommu-common: Do not use 64 bit  constant
 0xffffffffffffffffl for computing align_mask

On (07/20/15 19:57), Rasmus Villemoes wrote:
> I highly doubt it. The result is truncated to unsigned long
> anyway. Assuming align_order always has a value between 0 and
> BITS_PER_LONG, GENMASK should be exactly what is wanted.

While GENMASK may do the job, the code is already quite obscure,
so I'm going to stick with the minimal delta to get this right,
namely

-               align_mask = 0xffffffffffffffffl >> (64 - align_order);
+               align_mask = ~0ul >> (BITS_PER_LONG - align_order);

--Sowmini

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ