summaryrefslogtreecommitdiff
path: root/include/linux/math64.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2023-05-19 13:21:05 +0300
committerPeter Zijlstra <peterz@infradead.org>2023-06-05 22:11:06 +0300
commitfc4a0db4149afcdae2527f0d8c376accca34adc9 (patch)
treeddebe41d81656893a13ec9c901b27b10a5c03f39 /include/linux/math64.h
parent91b41a237512b569746e1f560a42d9fba077261d (diff)
downloadlinux-fc4a0db4149afcdae2527f0d8c376accca34adc9.tar.xz
math64: Always inline u128 version of mul_u64_u64_shr()
In order to prevent the following complaint from happening, always inline the u128 variant of mul_u64_u64_shr() -- which is what x86_64 will use. vmlinux.o: warning: objtool: read_hv_sched_clock_tsc+0x5a: call to mul_u64_u64_shr.constprop.0() leaves .noinstr.text section It should compile into something like: asm("mul %[mul];" "shrd %rdx, %rax, %cl" : "+&a" (a) : "c" shift, [mul] "r" (mul) : "d"); Which is silly not to inline, but it happens. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Michael Kelley <mikelley@microsoft.com> # Hyper-V Link: https://lore.kernel.org/r/20230519102715.637420396@infradead.org
Diffstat (limited to 'include/linux/math64.h')
-rw-r--r--include/linux/math64.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/math64.h b/include/linux/math64.h
index 8b9191a2849e..bf74478926d4 100644
--- a/include/linux/math64.h
+++ b/include/linux/math64.h
@@ -168,7 +168,7 @@ static __always_inline u64 mul_u64_u32_shr(u64 a, u32 mul, unsigned int shift)
#endif /* mul_u64_u32_shr */
#ifndef mul_u64_u64_shr
-static inline u64 mul_u64_u64_shr(u64 a, u64 mul, unsigned int shift)
+static __always_inline u64 mul_u64_u64_shr(u64 a, u64 mul, unsigned int shift)
{
return (u64)(((unsigned __int128)a * mul) >> shift);
}