x86/hyperv: Make hv_setup_sched_clock inline
Subsystems (4)
PATCH 1/1 x86/hyperv: Make hv_setup_sched_clock inline
Make hv_setup_sched_clock inline so the reference to pv_ops works correctly with objtool updates to detect noinstr violations. See https://lore.kernel.org/patchwork/patch/1283635/
--- arch/x86/include/asm/mshyperv.h | 12 ++++++++++++ arch/x86/kernel/cpu/mshyperv.c | 7 ------- include/asm-generic/mshyperv.h | 1 - 3 files changed, 12 insertions(+), 8 deletions(-)
arch/x86/include/asm/mshyperv.h +12 -0
@@ -8,6 +8,7 @@#include <asm/io.h> #include <asm/hyperv-tlfs.h> #include <asm/nospec-branch.h> +#include <asm/paravirt.h> typedef int (*hyperv_fill_flush_list_func)( struct hv_guest_mapping_flush_list *flush,
@@ -54,6 +55,17 @@ typedef int (*hyperv_fill_flush_list_func)(vclocks_set_used (VDSO_CLOCKMODE_HVCLOCK );#define hv_get_raw_timer () rdtsc_ordered() +/* +* Reference to pv_ops must be inline so objtool +* detection of noinstr violations can work correctly. +*/ +static __always_inline void hv_setup_sched_clock(void *sched_clock) +{ +#ifdef CONFIG_PARAVIRT + pv_ops.time.sched_clock = sched_clock; +#endif +} +void hyperv_vector_handler (struct pt_regs *regs);static inline void hv_enable_stimer0_percpu_irq (int irq) {}
arch/x86/kernel/cpu/mshyperv.c +0 -7
@@ -361,13 +361,6 @@ static void __init ms_hyperv_init_platform(void)#endif } -void hv_setup_sched_clock (void *sched_clock) -{ -#ifdef CONFIG_PARAVIRT - pv_ops.time.sched_clock = sched_clock; -#endif -} -const __initconst struct hypervisor_x86 x86_hyper_ms_hyperv = { .name ="Microsoft Hyper-V" , .detect = ms_hyperv_platform,
include/asm-generic/mshyperv.h +0 -1
@@ -168,7 +168,6 @@ static inline int cpumask_to_vpset(struct hv_vpset *vpset,bool hv_is_hyperv_initialized (void );bool hv_is_hibernation_supported (void );void hyperv_cleanup (void ); -void hv_setup_sched_clock (void *sched_clock);#else /* CONFIG_HYPERV */ static inline bool hv_is_hyperv_initialized (void ) {return false; }static inline bool hv_is_hibernation_supported (void ) {return false; }
Signature · 1 line
1.8.3.1
Wei Liu
maintainerQuoted 4 lines · Michael Kelley
Make
hv_setup_sched_clockinline so the reference topv_opsworks correctly with objtool updates to detect noinstr violations. See https://lore.kernel.org/patchwork/patch/1283635/
I read the reference link. This change looks sensible.
I will wait a few days before queueing this up in case other people have an opinion on this.
Wei.
Quoted 5 lines · Michael Kelley
Make
hv_setup_sched_clockinline so the reference topv_opsworks correctly with objtool updates to detect noinstr violations. See https://lore.kernel.org/patchwork/patch/1283635/Signed-off-by Michael Kelley <[email protected]>
Thanks!
Quoted 5 lines · Michael Kelley
Make
hv_setup_sched_clockinline so the reference topv_opsworks correctly with objtool updates to detect noinstr violations. See https://lore.kernel.org/patchwork/patch/1283635/Signed-off-by Michael Kelley <[email protected]>
Quoted 8 lines · Thomas Gleixner
Quoted 5 lines · Michael Kelley
Make
hv_setup_sched_clockinline so the reference topv_opsworks correctly with objtool updates to detect noinstr violations. See https://lore.kernel.org/patchwork/patch/1283635/Signed-off-by Michael Kelley <[email protected]>Acked-by Thomas Gleixner <[email protected]>
Thomas and Peter, thank you for your acks.
I have applied to hyperv-fixes and plan to submit it to Linus in a few days' time.
Thomas, let me know if you want this patch to go through the tip tree. I will revert it from hyperv-fixes if that's the case.
Wei.
Quoted 10 lines · Wei Liu
Quoted 8 lines · Thomas Gleixner
Quoted 5 lines · Michael Kelley
Make
hv_setup_sched_clockinline so the reference topv_opsworks correctly with objtool updates to detect noinstr violations. See https://lore.kernel.org/patchwork/patch/1283635/Signed-off-by Michael Kelley <[email protected]>Acked-by Thomas Gleixner <[email protected]>
Quoted 7 lines
Thomas and Peter, thank you for your acks.
I have applied to hyperv-fixes and plan to submit it to Linus in a few days' time.
Thomas, let me know if you want this patch to go through the tip tree. I will revert it from hyperv-fixes if that's the case.
I acked it so you can pick it up :)