diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/xen/hypercall.h | 8 | ||||
-rw-r--r-- | arch/x86/include/asm/xen/interface.h | 1 | ||||
-rw-r--r-- | arch/x86/xen/time.c | 16 |
3 files changed, 24 insertions, 1 deletions
diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h index 417777de5a40..5728852fb90f 100644 --- a/arch/x86/include/asm/xen/hypercall.h +++ b/arch/x86/include/asm/xen/hypercall.h | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <xen/interface/xen.h> | 47 | #include <xen/interface/xen.h> |
48 | #include <xen/interface/sched.h> | 48 | #include <xen/interface/sched.h> |
49 | #include <xen/interface/physdev.h> | 49 | #include <xen/interface/physdev.h> |
50 | #include <xen/interface/platform.h> | ||
50 | 51 | ||
51 | /* | 52 | /* |
52 | * The hypercall asms have to meet several constraints: | 53 | * The hypercall asms have to meet several constraints: |
@@ -301,6 +302,13 @@ HYPERVISOR_set_timer_op(u64 timeout) | |||
301 | } | 302 | } |
302 | 303 | ||
303 | static inline int | 304 | static inline int |
305 | HYPERVISOR_dom0_op(struct xen_platform_op *platform_op) | ||
306 | { | ||
307 | platform_op->interface_version = XENPF_INTERFACE_VERSION; | ||
308 | return _hypercall1(int, dom0_op, platform_op); | ||
309 | } | ||
310 | |||
311 | static inline int | ||
304 | HYPERVISOR_set_debugreg(int reg, unsigned long value) | 312 | HYPERVISOR_set_debugreg(int reg, unsigned long value) |
305 | { | 313 | { |
306 | return _hypercall2(int, set_debugreg, reg, value); | 314 | return _hypercall2(int, set_debugreg, reg, value); |
diff --git a/arch/x86/include/asm/xen/interface.h b/arch/x86/include/asm/xen/interface.h index 5d4922ad4b9b..a1f2db5f1170 100644 --- a/arch/x86/include/asm/xen/interface.h +++ b/arch/x86/include/asm/xen/interface.h | |||
@@ -55,6 +55,7 @@ DEFINE_GUEST_HANDLE(char); | |||
55 | DEFINE_GUEST_HANDLE(int); | 55 | DEFINE_GUEST_HANDLE(int); |
56 | DEFINE_GUEST_HANDLE(long); | 56 | DEFINE_GUEST_HANDLE(long); |
57 | DEFINE_GUEST_HANDLE(void); | 57 | DEFINE_GUEST_HANDLE(void); |
58 | DEFINE_GUEST_HANDLE(uint64_t); | ||
58 | #endif | 59 | #endif |
59 | 60 | ||
60 | #ifndef HYPERVISOR_VIRT_START | 61 | #ifndef HYPERVISOR_VIRT_START |
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 163b4679556e..0296a9522501 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c | |||
@@ -201,8 +201,22 @@ static unsigned long xen_get_wallclock(void) | |||
201 | 201 | ||
202 | static int xen_set_wallclock(unsigned long now) | 202 | static int xen_set_wallclock(unsigned long now) |
203 | { | 203 | { |
204 | struct xen_platform_op op; | ||
205 | int rc; | ||
206 | |||
204 | /* do nothing for domU */ | 207 | /* do nothing for domU */ |
205 | return -1; | 208 | if (!xen_initial_domain()) |
209 | return -1; | ||
210 | |||
211 | op.cmd = XENPF_settime; | ||
212 | op.u.settime.secs = now; | ||
213 | op.u.settime.nsecs = 0; | ||
214 | op.u.settime.system_time = xen_clocksource_read(); | ||
215 | |||
216 | rc = HYPERVISOR_dom0_op(&op); | ||
217 | WARN(rc != 0, "XENPF_settime failed: now=%ld\n", now); | ||
218 | |||
219 | return rc; | ||
206 | } | 220 | } |
207 | 221 | ||
208 | static struct clocksource xen_clocksource __read_mostly = { | 222 | static struct clocksource xen_clocksource __read_mostly = { |