public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: add static initialization of steal_clock op to xen_time_ops
@ 2016-07-26 12:15 Juergen Gross
  2016-07-26 15:26 ` [Xen-devel] " David Vrabel
  0 siblings, 1 reply; 2+ messages in thread
From: Juergen Gross @ 2016-07-26 12:15 UTC (permalink / raw)
  To: xen-devel, linux-kernel; +Cc: boris.ostrovsky, david.vrabel, 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.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/xen/time.c   | 1 +
 drivers/xen/time.c    | 2 +-
 include/xen/xen-ops.h | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index c31006f..a3e8f08 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -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)
diff --git a/drivers/xen/time.c b/drivers/xen/time.c
index a7fe35b..e6f9b2b 100644
--- a/drivers/xen/time.c
+++ b/drivers/xen/time.c
@@ -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;
 
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index 77bf9d1..0d1f9b9 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -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);
 
-- 
2.6.6

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Xen-devel] [PATCH] xen: add static initialization of steal_clock op to xen_time_ops
  2016-07-26 12:15 [PATCH] xen: add static initialization of steal_clock op to xen_time_ops Juergen Gross
@ 2016-07-26 15:26 ` David Vrabel
  0 siblings, 0 replies; 2+ messages in thread
From: David Vrabel @ 2016-07-26 15:26 UTC (permalink / raw)
  To: Juergen Gross, xen-devel, linux-kernel; +Cc: boris.ostrovsky, david.vrabel

On 26/07/16 13:15, Juergen Gross wrote:
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-26 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-26 12:15 [PATCH] xen: add static initialization of steal_clock op to xen_time_ops Juergen Gross
2016-07-26 15:26 ` [Xen-devel] " David Vrabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox