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]
Date:	Thu, 03 Nov 2011 15:20:14 -0200
From:	Mauro Carvalho Chehab <mchehab@...hat.com>
To:	Josh Boyer <jwboyer@...hat.com>
CC:	linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: sb_edac 32-bit compile fail due to 64-bit divide

Em 03-11-2011 12:43, Josh Boyer escreveu:
> On Thu, Nov 03, 2011 at 12:32:31PM -0200, Mauro Carvalho Chehab wrote:
>> Em 03-11-2011 12:07, Josh Boyer escreveu:
>>> Hi,
>>>
>>> It seems the newly added EDAC driver for SandyBridge won't build on
>>> 32-bit x86 because of a 64-bit divide somewhere:
>>>
>>> 	drivers/edac/sb_edac.c: In function 'get_memory_error_data':
>>> 	drivers/edac/sb_edac.c:861:2: warning: left shift count >= width of type
>>> 	[enabled by default]
>>> 	<snip>
>>> 	ERROR: "__udivdi3" [drivers/edac/sb_edac.ko] undefined!
>>> 	make[1]: *** [__modpost] Error 1
>>> 	make: *** [modules] Error 2
>>>
>>> You can find the full build log here:
>>>
>>> http://koji.fedoraproject.org/koji/getfile?taskID=3482579&name=build.log
>>>
>>> Before I go digging into where this is done and what to do about it, I
>>> do want to confirm that it is supposed to work on a 32-bit kernel,
>>> correct?
>>
>> Thanks for pointing it!
>>
>> Well, I didn't test it on a 32-bit kernel. It should work through.
>>
>> It is probably due to those debug lines:
>> 	debugf0("CH#%d RIR#%d INTL#%d, offset %Lu.%03Lu GB (0x%016Lx), tgt: %d, reg=0x%08x\n",
>>         	i, j, k,
>>                 tmp_mb / 1000, tmp_mb % 1000,
>>                 ((u64)tmp_mb) << 20L,
>>                 (u32)RIR_RNK_TGT(reg),
>>                 reg);
>> (same kind of calculus is recurrent at the driver)
> 
> All of that should basically not exist in this build because the debugf*
> macros depend on CONFIG_EDAC_DEBUG, which isn't set in this build.  The
> problem seems to be somewhere else.

I strongly recommend you to enable EDAC_DEBUG if you're building this driver. This
driver is experimental, and it may be blaming the wrong memory DIMMs, as Sandy
Bridge bios allows setting a large myriad of configurations. Among them, only one
were actually tested.

> 
> I would guess line 1056:
> 
> 	addr /= sck_xch;
> 
> addr is a u64.

Ok.

Well, a patch fixing it should be done with debug enabled, to get all cases.

>> Maybe the easiest way would be to write a function that would call do_div() internally,
>> and output a string with something similar to:
>>
>> 	sprintf(msg, "%Lu.%03Lu GB", tmp_mb / 1000, tmp_mb % 1000);
>>
>> Of course, an interim fix would be to make it depend on CONFIG_64BIT or CONFIG_X86_64.
> 
> That would work I guess.  It's up to you.

I prefer a patch fixing the issue. Not sure if I'll have time to work in it today,
as I'm stuck with the second part of media patches for 3.2.

>>
>> Regards,
>> Mauro
> --
> To unsubscribe from this list: send the line "unsubscribe linux-edac" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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