math64, timers: Fix 32bit mul_u64_u32_shr() and friends
authorPeter Zijlstra <peterz@infradead.org>
Fri, 9 Dec 2016 08:30:11 +0000 (09:30 +0100)
committerIngo Molnar <mingo@kernel.org>
Sat, 14 Jan 2017 10:31:50 +0000 (11:31 +0100)
commit9e3d6223d2093a8903c8f570a06284453ee59944
treef6010d541488db907e3fbf0ab56d595694b12c79
parente96f8f18c81b2f5b290206fc0da74b551e82646d
math64, timers: Fix 32bit mul_u64_u32_shr() and friends

It turns out that while GCC-4.4 manages to generate 32x32->64 mult
instructions for the 32bit mul_u64_u32_shr() code, any GCC after that
fails horribly.

Fix this by providing an explicit mul_u32_u32() function which can be
architcture provided.

Reported-by: Chris Metcalf <cmetcalf@mellanox.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Chris Metcalf <cmetcalf@mellanox.com> [for tile]
Cc: Christopher S. Hall <christopher.s.hall@intel.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Liav Rehana <liavr@mellanox.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Parit Bhargava <prarit@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20161209083011.GD15765@worktop.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/tile/include/asm/Kbuild
arch/tile/include/asm/div64.h [new file with mode: 0644]
arch/x86/include/asm/div64.h
include/linux/math64.h