[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-4.0-testing] x86 hvm: Add a new HVMOP to get the current Xen system time



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1291980868 0
# Node ID 9bf70900c9682864e2be4823e6eba7bc7e4912d4
# Parent  116a979f9d0f29275a599e16c88ab68dd5d53f64
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@xxxxxxxxxx>
xen-unstable changeset:   21772:2662f9c881fa
xen-unstable date:        Fri Jul 09 17:16:03 2010 +0100
---
 xen/arch/x86/hvm/hvm.c          |    9 +++++++++
 xen/include/public/hvm/hvm_op.h |    8 ++++++++
 2 files changed, 17 insertions(+)

diff -r 116a979f9d0f -r 9bf70900c968 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Thu Dec 09 16:15:55 2010 +0000
+++ b/xen/arch/x86/hvm/hvm.c    Fri Dec 10 11:34:28 2010 +0000
@@ -3124,6 +3124,15 @@ long do_hvm_op(unsigned long op, XEN_GUE
         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 -r 116a979f9d0f -r 9bf70900c968 xen/include/public/hvm/hvm_op.h
--- a/xen/include/public/hvm/hvm_op.h   Thu Dec 09 16:15:55 2010 +0000
+++ b/xen/include/public/hvm/hvm_op.h   Fri Dec 10 11:34:28 2010 +0000
@@ -138,6 +138,14 @@ typedef struct xen_hvm_pagetable_dying x
 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__ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.