]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xen: add static initialization of steal_clock op to xen_time_ops
authorJuergen Gross <jgross@suse.com>
Tue, 26 Jul 2016 12:15:11 +0000 (14:15 +0200)
committerBob Liu <bob.liu@oracle.com>
Thu, 20 Oct 2016 08:03:48 +0000 (04:03 -0400)
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>
(cherry picked from commit d34c30cc1fa80f509500ff192ea6bc7d30671061)
Signed-off-by: Bob Liu <bob.liu@oracle.com>
Orabug: 24820937

arch/x86/xen/time.c
drivers/xen/time.c
include/xen/xen-ops.h

index ae8a641d4bd1569054835a9241f447166d3e7849..d0d4ec3a102f2f38bba1a89fb886ee1accf80fcb 100644 (file)
@@ -376,6 +376,7 @@ void xen_timer_resume(void)
 
 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)
index 48c3f698306798bbdcdd42763262d80bf3cec173..ac5f23fcafc23939bb518375d853c3af99e896d9 100644 (file)
@@ -80,7 +80,7 @@ bool xen_vcpu_stolen(int vcpu)
        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;
 
index c9c532d5662370a39f3ffffece328a5e7d23592c..9a37c541822f6093aa86188484e5a6463e214e96 100644 (file)
@@ -29,6 +29,7 @@ bool xen_vcpu_stolen(int vcpu);
 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);