[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 5 May 2016 00:03:29 -0400
From: Jeffrey Walton <noloader@...il.com>
To: "Theodore Ts'o" <tytso@....edu>,
Jeffrey Walton <noloader@...il.com>,
"H. Peter Anvin" <hpa@...or.com>, John Denker <jsd@...n.com>,
linux-kernel@...r.kernel.org,
Stephan Mueller <smueller@...onox.de>,
Herbert Xu <herbert@...dor.apana.org.au>,
Andi Kleen <andi@...stfloor.org>,
Sandy Harris <sandyinchina@...il.com>,
cryptography@...edaemon.net, linux-crypto@...r.kernel.org
Subject: Re: better patch for linux/bitops.h
On Wed, May 4, 2016 at 11:50 PM, Theodore Ts'o <tytso@....edu> wrote:
> ...
> But instead of arguing over what works and doesn't, let's just create
> the the test set and just try it on a wide range of compilers and
> architectures, hmmm?
What are the requirements? Here's a short list:
* No undefined behavior
- important because the compiler writers use the C standard
* Compiles to native "rotate IMMEDIATE" if the rotate amount is a
"constant expression" and the machine provides it
- translates to a native rotate instruction if available
- "rotate IMM" can be 3 times faster than "rotate REG"
- do any architectures *not* provide a rotate?
* Compiles to native "rotate REGISTER" if the rotate is variable and
the machine provides it
- do any architectures *not* provide a rotate?
* Constant time
- important to high-integrity code
- Non-security code paths probably don't care
Maybe the first thing to do is provide a different rotates for the
constant-time requirement when its in effect?
Jeff
Powered by blists - more mailing lists