[PATCH] x86/Hyper-V: Fix reference of pv_ops with CONFIG_PARAVIRT=N

From: lantianyu1986
Date: Wed Aug 28 2019 - 04:07:58 EST


From: Tianyu Lan <Tianyu.Lan@xxxxxxxxxxxxx>

hv_setup_sched_clock() references pv_ops and this should
be under CONFIG_PARAVIRT=Y. Fix it.

Signed-off-by: Tianyu Lan <Tianyu.Lan@xxxxxxxxxxxxx>
---
This patch is based on git://git.kernel.org/pub/scm/linux/
kernel/git/tip/tip.git timers/core.

arch/x86/kernel/cpu/mshyperv.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 53afd33990eb..267daad8c036 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -346,7 +346,9 @@ static void __init ms_hyperv_init_platform(void)

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 = {
--
2.14.5