math64: Always inline u128 version of mul_u64_u64_shr()
authorPeter Zijlstra <peterz@infradead.org>
Fri, 19 May 2023 10:21:05 +0000 (12:21 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 5 Jun 2023 19:11:06 +0000 (21:11 +0200)
commitfc4a0db4149afcdae2527f0d8c376accca34adc9
treeddebe41d81656893a13ec9c901b27b10a5c03f39
parent91b41a237512b569746e1f560a42d9fba077261d
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
include/linux/math64.h