Commit 403299a8 authored by Linus Torvalds's avatar Linus Torvalds

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
parents daedd870 fdb9eb9f
...@@ -76,6 +76,7 @@ DEFINE_GUEST_HANDLE(char); ...@@ -76,6 +76,7 @@ DEFINE_GUEST_HANDLE(char);
DEFINE_GUEST_HANDLE(int); DEFINE_GUEST_HANDLE(int);
DEFINE_GUEST_HANDLE(long); DEFINE_GUEST_HANDLE(long);
DEFINE_GUEST_HANDLE(void); DEFINE_GUEST_HANDLE(void);
DEFINE_GUEST_HANDLE(uint64_t);
typedef unsigned long xen_pfn_t; typedef unsigned long xen_pfn_t;
DEFINE_GUEST_HANDLE(xen_pfn_t); DEFINE_GUEST_HANDLE(xen_pfn_t);
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <xen/interface/xen.h> #include <xen/interface/xen.h>
#include <xen/interface/sched.h> #include <xen/interface/sched.h>
#include <xen/interface/physdev.h> #include <xen/interface/physdev.h>
#include <xen/interface/platform.h>
/* /*
* The hypercall asms have to meet several constraints: * The hypercall asms have to meet several constraints:
...@@ -300,6 +301,13 @@ HYPERVISOR_set_timer_op(u64 timeout) ...@@ -300,6 +301,13 @@ HYPERVISOR_set_timer_op(u64 timeout)
return _hypercall2(long, set_timer_op, timeout_lo, timeout_hi); return _hypercall2(long, set_timer_op, timeout_lo, timeout_hi);
} }
static inline int
HYPERVISOR_dom0_op(struct xen_platform_op *platform_op)
{
platform_op->interface_version = XENPF_INTERFACE_VERSION;
return _hypercall1(int, dom0_op, platform_op);
}
static inline int static inline int
HYPERVISOR_set_debugreg(int reg, unsigned long value) HYPERVISOR_set_debugreg(int reg, unsigned long value)
{ {
......
...@@ -55,6 +55,7 @@ DEFINE_GUEST_HANDLE(char); ...@@ -55,6 +55,7 @@ DEFINE_GUEST_HANDLE(char);
DEFINE_GUEST_HANDLE(int); DEFINE_GUEST_HANDLE(int);
DEFINE_GUEST_HANDLE(long); DEFINE_GUEST_HANDLE(long);
DEFINE_GUEST_HANDLE(void); DEFINE_GUEST_HANDLE(void);
DEFINE_GUEST_HANDLE(uint64_t);
#endif #endif
#ifndef HYPERVISOR_VIRT_START #ifndef HYPERVISOR_VIRT_START
......
...@@ -201,8 +201,22 @@ static unsigned long xen_get_wallclock(void) ...@@ -201,8 +201,22 @@ static unsigned long xen_get_wallclock(void)
static int xen_set_wallclock(unsigned long now) static int xen_set_wallclock(unsigned long now)
{ {
struct xen_platform_op op;
int rc;
/* do nothing for domU */ /* 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 = { static struct clocksource xen_clocksource __read_mostly = {
......
This diff is collapsed.
...@@ -492,6 +492,7 @@ struct dom0_vga_console_info { ...@@ -492,6 +492,7 @@ struct dom0_vga_console_info {
/* These flags are passed in the 'flags' field of start_info_t. */ /* These flags are passed in the 'flags' field of start_info_t. */
#define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */ #define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */
#define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */ #define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */
#define SIF_PM_MASK (0xFF<<8) /* reserve 1 byte for xen-pm options */
typedef uint64_t cpumap_t; typedef uint64_t cpumap_t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment