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: <AANLkTi==5umTtLWSoLfLPjHYAVpnPNHN-uzq7q2t-nfr@mail.gmail.com>
Date:	Thu, 12 Aug 2010 13:26:37 -0700
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Larry Finger <Larry.Finger@...inger.net>
Cc:	Jason Wessel <jason.wessel@...driver.com>,
	John Stultz <johnstul@...ibm.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: Problem with commit deda2e81961e96be4f2c09328baca4710a2fd1a0

On Thu, Aug 12, 2010 at 1:18 PM, Larry Finger <Larry.Finger@...inger.net> wrote:
>
> With the above commit, building an i386 version of the kernel results in the
> following from the build:
>
> kernel/built-in.o: In function `logarithmic_accumulation':
> /home/finger/linux-realtek/kernel/time/timekeeping.c:715: undefined reference to
> `__umoddi3'
> /home/finger/linux-realtek/kernel/time/timekeeping.c:715: undefined reference to
> `__udivdi3'
> make: *** [.tmp_vmlinux1] Error 1
>
> Reverting the patch allows the system to build correctly.

Damn. It's your compiler turning a while-loop into a divide. Which
likely isn't even an optimization, but whatever.

John: I think that while-loop needs to be something like

   if (raw_nsecs >= NSEC_PER_SEC) {
      u64 raw_secs = raw_nsecs;
      raw_nsecs = do_div(raw_secs, NSEC_PER_SEC);
      raw_time.tv_sec += taw_secs;
  }
  raw_time.tc_nsec = raw_nsecs;

which is sad and overly complicated, but the simple thing seems to get
messed up by the compiler.

Untested. Maybe I got the complex do_div() semantics wrong. Somebody
needs to check.

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