Skip to contentSkip to conversation

xen: add static initialization of steal_clock op to xen_time_ops

PATCH Applied Juergen Gross 2 participants 3 messages Jul 26, 2016

Subsystems (3)
lore
Share & tools
lore

Juergen Gross

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 arch/x86/xen/time.c   | 1 +
 drivers/xen/time.c    | 2 +-
 include/xen/xen-ops.h | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
arch/x86/xen/time.c +1 -0
index c31006f..a3e8f08 100644
@@ -359,6 +359,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)
drivers/xen/time.c +1 -1
index a7fe35b..e6f9b2b 100644
@@ -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;
 
include/xen/xen-ops.h +1 -0
index 77bf9d1..0d1f9b9 100644
@@ -23,6 +23,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);
 
Signature · 1 line
2.6.6
Applied
#1 lore raw
Quoted 4 lines · Juergen Gross

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.

Applied to for-linus-4.8, thanks.

David

Applied
#2 lore raw
In reply to Juergen Gross
Quoted 4 lines · Juergen Gross

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.

Applied to for-linus-4.8, thanks.

David

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel