x86/math64: Provide a sane mul_u64_u32_div() implementation for x86_64
authorPeter Zijlstra <peterz@infradead.org>
Wed, 28 Aug 2019 15:39:46 +0000 (17:39 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 3 Sep 2019 06:56:14 +0000 (08:56 +0200)
commitdb4e919d9a119b7c54eb5e5ac9bee5d3eb4cb859
treeebeb54ead3a2f87b0efc5e63d5715fa5ed9a1fb9
parent089cf7f6ecb266b6a4164919a2e69bd2f938374a
x86/math64: Provide a sane mul_u64_u32_div() implementation for x86_64

On x86_64 we can do a u64 * u64 -> u128 widening multiply followed by
a u128 / u64 -> u64 division to implement a sane version of
mul_u64_u32_div().

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/div64.h