Skip to content

Commit cd94257

Browse files
committed
Merge tag 'hyperv-fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux
Pull hyper-v fixes from Wei Liu: - fix oops reporting on Hyper-V - make objtool happy * tag 'hyperv-fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: x86/hyperv: Make hv_setup_sched_clock inline Drivers: hv: vmbus: Only notify Hyper-V for die events that are oops
2 parents 8ab4952 + b9d8cf2 commit cd94257

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

arch/x86/include/asm/mshyperv.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <asm/io.h>
99
#include <asm/hyperv-tlfs.h>
1010
#include <asm/nospec-branch.h>
11+
#include <asm/paravirt.h>
1112

1213
typedef int (*hyperv_fill_flush_list_func)(
1314
struct hv_guest_mapping_flush_list *flush,
@@ -54,6 +55,17 @@ typedef int (*hyperv_fill_flush_list_func)(
5455
vclocks_set_used(VDSO_CLOCKMODE_HVCLOCK);
5556
#define hv_get_raw_timer() rdtsc_ordered()
5657

58+
/*
59+
* Reference to pv_ops must be inline so objtool
60+
* detection of noinstr violations can work correctly.
61+
*/
62+
static __always_inline void hv_setup_sched_clock(void *sched_clock)
63+
{
64+
#ifdef CONFIG_PARAVIRT
65+
pv_ops.time.sched_clock = sched_clock;
66+
#endif
67+
}
68+
5769
void hyperv_vector_handler(struct pt_regs *regs);
5870

5971
static inline void hv_enable_stimer0_percpu_irq(int irq) {}

arch/x86/kernel/cpu/mshyperv.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,6 @@ static void __init ms_hyperv_init_platform(void)
361361
#endif
362362
}
363363

364-
void hv_setup_sched_clock(void *sched_clock)
365-
{
366-
#ifdef CONFIG_PARAVIRT
367-
pv_ops.time.sched_clock = sched_clock;
368-
#endif
369-
}
370-
371364
const __initconst struct hypervisor_x86 x86_hyper_ms_hyperv = {
372365
.name = "Microsoft Hyper-V",
373366
.detect = ms_hyperv_platform,

drivers/hv/vmbus_drv.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ static int hyperv_die_event(struct notifier_block *nb, unsigned long val,
8686
struct die_args *die = (struct die_args *)args;
8787
struct pt_regs *regs = die->regs;
8888

89+
/* Don't notify Hyper-V if the die event is other than oops */
90+
if (val != DIE_OOPS)
91+
return NOTIFY_DONE;
92+
8993
/*
9094
* Hyper-V should be notified only once about a panic. If we will be
9195
* doing hyperv_report_panic_msg() later with kmsg data, don't do

include/asm-generic/mshyperv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ void hyperv_report_panic_msg(phys_addr_t pa, size_t size);
168168
bool hv_is_hyperv_initialized(void);
169169
bool hv_is_hibernation_supported(void);
170170
void hyperv_cleanup(void);
171-
void hv_setup_sched_clock(void *sched_clock);
172171
#else /* CONFIG_HYPERV */
173172
static inline bool hv_is_hyperv_initialized(void) { return false; }
174173
static inline bool hv_is_hibernation_supported(void) { return false; }

0 commit comments

Comments
 (0)