summaryrefslogtreecommitdiffstats
path: root/arch/x86/xen
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-07 05:15:05 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-07 05:15:05 +0100
commit403299a8515c56db58454c57712f4dc96d6c1fde (patch)
tree1dbcb33c606b03adc7d7fe128ecb3f0c3404ffef /arch/x86/xen
parentMerge branch 'stable/cleanups-3.2' of git://git.kernel.org/pub/scm/linux/kern... (diff)
parentxen/dom0: set wallclock time in Xen (diff)
downloadlinux-403299a8515c56db58454c57712f4dc96d6c1fde.tar.xz
linux-403299a8515c56db58454c57712f4dc96d6c1fde.zip
Merge branch 'upstream/xen-settime' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen
* 'upstream/xen-settime' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen: xen/dom0: set wallclock time in Xen xen: add dom0_op hypercall xen/acpi: Domain0 acpi parser related platform hypercall
Diffstat (limited to 'arch/x86/xen')
-rw-r--r--arch/x86/xen/time.c16
1 files changed, 15 insertions, 1 deletions
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)
static int xen_set_wallclock(unsigned long now)
{
+ struct xen_platform_op op;
+ int rc;
+
/* do nothing for domU */
- return -1;
+ if (!xen_initial_domain())
+ return -1;
+
+ op.cmd = XENPF_settime;
+ op.u.settime.secs = now;
+ op.u.settime.nsecs = 0;
+ op.u.settime.system_time = xen_clocksource_read();
+
+ rc = HYPERVISOR_dom0_op(&op);
+ WARN(rc != 0, "XENPF_settime failed: now=%ld\n", now);
+
+ return rc;
}
static struct clocksource xen_clocksource __read_mostly = {