diff options
author | Keir Fraser <keir@xen.org> | 2010-12-10 11:34:28 +0000 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2010-12-10 11:34:28 +0000 |
commit | b04c1602b7bd6571cff164b8ab5e61bf910896d0 (patch) | |
tree | 238f6060927b8ded0004e2c9369ca6d668c74c12 | |
parent | 95e007daba62babaabc0868521e1aad1a875a3bc (diff) | |
download | xen-b04c1602b7bd6571cff164b8ab5e61bf910896d0.tar.gz xen-b04c1602b7bd6571cff164b8ab5e61bf910896d0.tar.bz2 xen-b04c1602b7bd6571cff164b8ab5e61bf910896d0.zip |
x86 hvm: Add a new HVMOP to get the current Xen system time
Xen absolute system time, so that it can use SCHEDOP_poll in a
sensible fashion. HVM PV drivers can't use the normal PV clock
because they might have TSC offsets that hey don't know about.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset: 21772:2662f9c881fa
xen-unstable date: Fri Jul 09 17:16:03 2010 +0100
-rw-r--r-- | xen/arch/x86/hvm/hvm.c | 9 | ||||
-rw-r--r-- | xen/include/public/hvm/hvm_op.h | 8 |
2 files changed, 17 insertions, 0 deletions
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 6048380728..6f0ee01adc 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -3124,6 +3124,15 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg) break; } + case HVMOP_get_time: { + xen_hvm_get_time_t gxt; + + gxt.now = NOW(); + if ( copy_to_guest(arg, &gxt, 1) ) + rc = -EFAULT; + break; + } + default: { gdprintk(XENLOG_WARNING, "Bad HVM op %ld.\n", op); diff --git a/xen/include/public/hvm/hvm_op.h b/xen/include/public/hvm/hvm_op.h index 734d224cb0..1f697e46e1 100644 --- a/xen/include/public/hvm/hvm_op.h +++ b/xen/include/public/hvm/hvm_op.h @@ -138,6 +138,14 @@ struct xen_hvm_pagetable_dying { typedef struct xen_hvm_pagetable_dying xen_hvm_pagetable_dying_t; DEFINE_XEN_GUEST_HANDLE(xen_hvm_pagetable_dying_t); +/* Get the current Xen time, in nanoseconds since system boot. */ +#define HVMOP_get_time 10 +struct xen_hvm_get_time { + uint64_t now; /* OUT */ +}; +typedef struct xen_hvm_get_time xen_hvm_get_time_t; +DEFINE_XEN_GUEST_HANDLE(xen_hvm_get_time_t); + #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */ #endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */ |