Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xen: add static initialization of steal_clock op to xen_time_ops

pv_time_ops might be overwritten with xen_time_ops after the
steal_clock operation has been initialized already. To prevent calling
a now uninitialized function pointer add the steal_clock static
initialization to xen_time_ops.

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>

authored by

Juergen Gross and committed by
David Vrabel
d34c30cc ee42d665

+3 -1
+1
arch/x86/xen/time.c
··· 364 364 365 365 static const struct pv_time_ops xen_time_ops __initconst = { 366 366 .sched_clock = xen_clocksource_read, 367 + .steal_clock = xen_steal_clock, 367 368 }; 368 369 369 370 static void __init xen_time_init(void)
+1 -1
drivers/xen/time.c
··· 80 80 return per_cpu(xen_runstate, vcpu).state == RUNSTATE_runnable; 81 81 } 82 82 83 - static u64 xen_steal_clock(int cpu) 83 + u64 xen_steal_clock(int cpu) 84 84 { 85 85 struct vcpu_runstate_info state; 86 86
+1
include/xen/xen-ops.h
··· 29 29 void xen_setup_runstate_info(int cpu); 30 30 void xen_time_setup_guest(void); 31 31 void xen_get_runstate_snapshot(struct vcpu_runstate_info *res); 32 + u64 xen_steal_clock(int cpu); 32 33 33 34 int xen_setup_shutdown_event(void); 34 35