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

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



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1278692163 -3600
# Node ID 2662f9c881faaca6f1094049b4b8e1c5843685c2
# Parent  42ccccfe1a6a3e418f86893a4457289adae8fe4d
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/arch/x86/hvm/hvm.c          |    9 +++++++++
 xen/include/public/hvm/hvm_op.h |    8 ++++++++
 2 files changed, 17 insertions(+)

diff -r 42ccccfe1a6a -r 2662f9c881fa xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Fri Jul 09 16:45:42 2010 +0100
+++ b/xen/arch/x86/hvm/hvm.c    Fri Jul 09 17:16:03 2010 +0100
@@ -3188,6 +3188,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 42ccccfe1a6a -r 2662f9c881fa xen/include/public/hvm/hvm_op.h
--- a/xen/include/public/hvm/hvm_op.h   Fri Jul 09 16:45:42 2010 +0100
+++ b/xen/include/public/hvm/hvm_op.h   Fri Jul 09 17:16:03 2010 +0100
@@ -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®.