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>
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index fd7cd6f..67356d2 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -364,6 +364,7 @@
static const struct pv_time_ops xen_time_ops __initconst = {
.sched_clock = xen_clocksource_read,
+ .steal_clock = xen_steal_clock,
};
static void __init xen_time_init(void)
diff --git a/drivers/xen/time.c b/drivers/xen/time.c
index 48c3f69..ac5f23f 100644
--- a/drivers/xen/time.c
+++ b/drivers/xen/time.c
@@ -80,7 +80,7 @@
return per_cpu(xen_runstate, vcpu).state == RUNSTATE_runnable;
}
-static u64 xen_steal_clock(int cpu)
+u64 xen_steal_clock(int cpu)
{
struct vcpu_runstate_info state;
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index c9c532d..9a37c541 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -29,6 +29,7 @@
void xen_setup_runstate_info(int cpu);
void xen_time_setup_guest(void);
void xen_get_runstate_snapshot(struct vcpu_runstate_info *res);
+u64 xen_steal_clock(int cpu);
int xen_setup_shutdown_event(void);