summary refs log tree commit diff
path: root/arch/x86/kernel/cpu/mshyperv.c
diff options
context:
space:
mode:
authorTianyu Lan <Tianyu.Lan@microsoft.com>2019-08-28 16:07:47 +0800
committerThomas Gleixner <tglx@linutronix.de>2019-08-28 12:25:06 +0200
commit41cfe2a2a7f4fad5647031ad3a1da166452b5437 (patch)
treeec9fbb50f1d1598bf2fdaffbd7c87729c668bbcb /arch/x86/kernel/cpu/mshyperv.c
parent60bda037f1dd8151e0c9ee5b09f0c091a0f643cd (diff)
downloadlinux-41cfe2a2a7f4fad5647031ad3a1da166452b5437.tar.gz
x86/hyperv: Hide pv_ops access for CONFIG_PARAVIRT=n
hv_setup_sched_clock() references pv_ops which is only available when
CONFIG_PARAVIRT=Y.

Wrap it into a #ifdef

Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20190828080747.204419-1-Tianyu.Lan@microsoft.com

Diffstat (limited to 'arch/x86/kernel/cpu/mshyperv.c')
-rw-r--r--arch/x86/kernel/cpu/mshyperv.c2
1 files changed, 2 insertions, 0 deletions
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 = {