Re: #pragma GCC warnings (was: Re: [PATCH] crypto: drbg - use pragmas for disabling optimization)

2015-06-23 Thread Geert Uytterhoeven
Hi Stephan,

On Tue, Jun 23, 2015 at 3:01 PM, Stephan Mueller  wrote:
>> On Tue, Jun 23, 2015 at 11:17:23AM +0200, Geert Uytterhoeven wrote:
>> > I get that too with m68k-linux-gcc-4.6.3 and m68k-linux-gcc-4.9.0.
>> >
>> > With m68k-linux-gnu-gcc-4.1, which is still my default cross-compiler due
>> > to the good unused warning reporting, I get:
>> >
>> > crypto/jitterentropy.c:235: warning: ignoring #pragma GCC push_options
>> > crypto/jitterentropy.c:236: warning: ignoring #pragma GCC optimize
>> > crypto/jitterentropy.c:266: warning: ignoring #pragma GCC pop_options
>> > crypto/jitterentropy.c:295: warning: ignoring #pragma GCC push_options
>> > crypto/jitterentropy.c:296: warning: ignoring #pragma GCC optimize
>> > crypto/jitterentropy.c:336: warning: ignoring #pragma GCC pop_options
>> > crypto/jitterentropy.c:385: warning: ignoring #pragma GCC push_options
>> > crypto/jitterentropy.c:386: warning: ignoring #pragma GCC optimize
>> > crypto/jitterentropy.c:416: warning: ignoring #pragma GCC pop_options
>> > crypto/jitterentropy.c:517: warning: ignoring #pragma GCC push_options
>> > crypto/jitterentropy.c:518: warning: ignoring #pragma GCC optimize
>> > crypto/jitterentropy.c:580: warning: ignoring #pragma GCC pop_options
>>
>> Stephan, could you look into moving the relevant functions into
>> its own file which can then be compiled with -O0? Obviously any
>> dependency on kernel header files would have to be hidden using
>> functions outside of this file.
>
> I have separated all so far. However, there are two items left where I am not
> sure about:
>
> - asm/types.h: I need __u64

I don't expect any reliance on optimization in , as it should
just add definitions. However, "__u64" is "unsigned long long" everywhere,
so you can just use that.

> - linux/bitops.h: I need rol64
>
> Can I safely include both header files or do I have to hide them too. If yes,
> how would I do that in a way that is satisfactory?

Either open-code rol64() (it's not that complicated), or add a source file that
contains only

#include 
#include 

__u64 outofline_rol64(__u64 word, unsigned int shift)
{
return rol64(word, shift);
}

and call outofline_rol64() from your code.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: #pragma GCC warnings (was: Re: [PATCH] crypto: drbg - use pragmas for disabling optimization)

2015-06-23 Thread Stephan Mueller
Am Dienstag, 23. Juni 2015, 17:21:06 schrieb Herbert Xu:

Hi Herbert,

> On Tue, Jun 23, 2015 at 11:17:23AM +0200, Geert Uytterhoeven wrote:
> > I get that too with m68k-linux-gcc-4.6.3 and m68k-linux-gcc-4.9.0.
> > 
> > With m68k-linux-gnu-gcc-4.1, which is still my default cross-compiler due
> > to the good unused warning reporting, I get:
> > 
> > crypto/jitterentropy.c:235: warning: ignoring #pragma GCC push_options
> > crypto/jitterentropy.c:236: warning: ignoring #pragma GCC optimize
> > crypto/jitterentropy.c:266: warning: ignoring #pragma GCC pop_options
> > crypto/jitterentropy.c:295: warning: ignoring #pragma GCC push_options
> > crypto/jitterentropy.c:296: warning: ignoring #pragma GCC optimize
> > crypto/jitterentropy.c:336: warning: ignoring #pragma GCC pop_options
> > crypto/jitterentropy.c:385: warning: ignoring #pragma GCC push_options
> > crypto/jitterentropy.c:386: warning: ignoring #pragma GCC optimize
> > crypto/jitterentropy.c:416: warning: ignoring #pragma GCC pop_options
> > crypto/jitterentropy.c:517: warning: ignoring #pragma GCC push_options
> > crypto/jitterentropy.c:518: warning: ignoring #pragma GCC optimize
> > crypto/jitterentropy.c:580: warning: ignoring #pragma GCC pop_options
> 
> Stephan, could you look into moving the relevant functions into
> its own file which can then be compiled with -O0? Obviously any
> dependency on kernel header files would have to be hidden using
> functions outside of this file.

I have separated all so far. However, there are two items left where I am not 
sure about:

- asm/types.h: I need __u64

- linux/bitops.h: I need rol64

Can I safely include both header files or do I have to hide them too. If yes, 
how would I do that in a way that is satisfactory?

Thanks.

-- 
Ciao
Stephan
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: #pragma GCC warnings (was: Re: [PATCH] crypto: drbg - use pragmas for disabling optimization)

2015-06-23 Thread Stephan Mueller
Am Dienstag, 23. Juni 2015, 17:21:06 schrieb Herbert Xu:

Hi Herbert,

>On Tue, Jun 23, 2015 at 11:17:23AM +0200, Geert Uytterhoeven wrote:
>> I get that too with m68k-linux-gcc-4.6.3 and m68k-linux-gcc-4.9.0.
>> 
>> With m68k-linux-gnu-gcc-4.1, which is still my default cross-compiler due
>> to the good unused warning reporting, I get:
>> 
>> crypto/jitterentropy.c:235: warning: ignoring #pragma GCC push_options
>> crypto/jitterentropy.c:236: warning: ignoring #pragma GCC optimize
>> crypto/jitterentropy.c:266: warning: ignoring #pragma GCC pop_options
>> crypto/jitterentropy.c:295: warning: ignoring #pragma GCC push_options
>> crypto/jitterentropy.c:296: warning: ignoring #pragma GCC optimize
>> crypto/jitterentropy.c:336: warning: ignoring #pragma GCC pop_options
>> crypto/jitterentropy.c:385: warning: ignoring #pragma GCC push_options
>> crypto/jitterentropy.c:386: warning: ignoring #pragma GCC optimize
>> crypto/jitterentropy.c:416: warning: ignoring #pragma GCC pop_options
>> crypto/jitterentropy.c:517: warning: ignoring #pragma GCC push_options
>> crypto/jitterentropy.c:518: warning: ignoring #pragma GCC optimize
>> crypto/jitterentropy.c:580: warning: ignoring #pragma GCC pop_options
>
>Stephan, could you look into moving the relevant functions into
>its own file which can then be compiled with -O0? Obviously any
>dependency on kernel header files would have to be hidden using
>functions outside of this file.

I will look into it.

Thanks

Ciao
Stephan
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: #pragma GCC warnings (was: Re: [PATCH] crypto: drbg - use pragmas for disabling optimization)

2015-06-23 Thread Herbert Xu
On Tue, Jun 23, 2015 at 11:17:23AM +0200, Geert Uytterhoeven wrote:
> 
> I get that too with m68k-linux-gcc-4.6.3 and m68k-linux-gcc-4.9.0.
> 
> With m68k-linux-gnu-gcc-4.1, which is still my default cross-compiler due
> to the good unused warning reporting, I get:
> 
> crypto/jitterentropy.c:235: warning: ignoring #pragma GCC push_options
> crypto/jitterentropy.c:236: warning: ignoring #pragma GCC optimize
> crypto/jitterentropy.c:266: warning: ignoring #pragma GCC pop_options
> crypto/jitterentropy.c:295: warning: ignoring #pragma GCC push_options
> crypto/jitterentropy.c:296: warning: ignoring #pragma GCC optimize
> crypto/jitterentropy.c:336: warning: ignoring #pragma GCC pop_options
> crypto/jitterentropy.c:385: warning: ignoring #pragma GCC push_options
> crypto/jitterentropy.c:386: warning: ignoring #pragma GCC optimize
> crypto/jitterentropy.c:416: warning: ignoring #pragma GCC pop_options
> crypto/jitterentropy.c:517: warning: ignoring #pragma GCC push_options
> crypto/jitterentropy.c:518: warning: ignoring #pragma GCC optimize
> crypto/jitterentropy.c:580: warning: ignoring #pragma GCC pop_options

Stephan, could you look into moving the relevant functions into
its own file which can then be compiled with -O0? Obviously any
dependency on kernel header files would have to be hidden using
functions outside of this file.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html