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] [day] [month] [year] [list]
Date:	Tue, 26 Feb 2008 16:34:04 -0800
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	David Brownell <david-b@...bell.net>, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.arm.linux.org.uk
Subject: Re: (regression) kernel/timeconst.h bugs with HZ=128

Andrew Morton wrote:
> On Tue, 26 Feb 2008 10:32:24 -0800 David Brownell <david-b@...bell.net> wrote:
> 
>> I see these warnings on 32 bit ARM systems:
>>
>>   CC      kernel/time.o
>> kernel/time.c: In function 'msecs_to_jiffies':
>> kernel/time.c:472: warning: integer constant is too large for 'long' type
>> kernel/time.c: In function 'usecs_to_jiffies':
>> kernel/time.c:487: warning: integer constant is too large for 'long' type
>>
>> Line 472: 
>> 	return ((u64)MSEC_TO_HZ_MUL32 * m + MSEC_TO_HZ_ADJ32)
>> line 487:
>> 	return ((u64)USEC_TO_HZ_MUL32 * u + USEC_TO_HZ_ADJ32)
>>
>> The problem seems to be that these constants from kernel/timeconst.h
>> have too many digits:
>>
>> #define ONLY_THIRTYTWO_BITS	0x01234567
>>
>> #define MSEC_TO_HZ_ADJ32        0x3f7ced916
>> #define USEC_TO_HZ_ADJ32        0xfffbce4217d
>>
>> Those *_ADJ32 constants should have "ULL" suffixes, yes?
>> Adding that by hand resolves the problem, but only until
>> the next time that header file gets regenerated.
>>
>> Someone with observable Perl-fu should fix this ...
>>
> 

<barf>

The real issue is that we don't have any equivalent to the UINTxx_C() 
creation macros in Linux, and even though we're using a cast -- which is 
totally correct -- makes gcc issue a (spurious) warning.

The right thing would be to create _C() macros and use those in the C 
code, i.e. UINT64_C(MSEC_TO_HZ_MUL32).

I'll write up a patch, but probably not today.

	-hpa
--
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