summaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/time.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-06 20:15:05 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-06 20:15:05 -0800
commit403299a8515c56db58454c57712f4dc96d6c1fde (patch)
tree1dbcb33c606b03adc7d7fe128ecb3f0c3404ffef /arch/x86/xen/time.c
parentdaedd8708fe7707ed651bb1c83162f25c48a947c (diff)
parentfdb9eb9f155bfc0f8dc2fc88f90448b30c78ad97 (diff)
downloadop-kernel-dev-403299a8515c56db58454c57712f4dc96d6c1fde.zip
op-kernel-dev-403299a8515c56db58454c57712f4dc96d6c1fde.tar.gz
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/time.c')
-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 163b467..0296a95 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 = {
OpenPOWER on IntegriCloud