diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/xen/time.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 5158c505bef9..8c9cdfa24657 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c | |||
@@ -200,8 +200,22 @@ static unsigned long xen_get_wallclock(void) | |||
200 | 200 | ||
201 | static int xen_set_wallclock(unsigned long now) | 201 | static int xen_set_wallclock(unsigned long now) |
202 | { | 202 | { |
203 | struct xen_platform_op op; | ||
204 | int rc; | ||
205 | |||
203 | /* do nothing for domU */ | 206 | /* do nothing for domU */ |
204 | return -1; | 207 | if (!xen_initial_domain()) |
208 | return -1; | ||
209 | |||
210 | op.cmd = XENPF_settime; | ||
211 | op.u.settime.secs = now; | ||
212 | op.u.settime.nsecs = 0; | ||
213 | op.u.settime.system_time = xen_clocksource_read(); | ||
214 | |||
215 | rc = HYPERVISOR_dom0_op(&op); | ||
216 | WARN(rc != 0, "XENPF_settime failed: now=%ld\n", now); | ||
217 | |||
218 | return rc; | ||
205 | } | 219 | } |
206 | 220 | ||
207 | static struct clocksource xen_clocksource __read_mostly = { | 221 | static struct clocksource xen_clocksource __read_mostly = { |