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

[Xen-devel] [PATCH 9/9] x86/shim: pass through vcpu runstate to L0 Xen



So that we can have accurate stolen time accounting. Idea taken from
Vixen work from Amazon.

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Cc: Anthony Liguori <anthony@xxxxxxxxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/common/domain.c                   | 10 ++++++++++
 xen/include/asm-x86/guest/hypercall.h |  7 +++++++
 2 files changed, 17 insertions(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 558318e852..189ffac9b1 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -45,6 +45,7 @@
 
 #ifdef CONFIG_X86
 #include <asm/guest.h>
+#include <asm/guest/hypercall.h>
 #endif
 
 /* Linux config option: propageted to domain0 */
@@ -1425,6 +1426,15 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, 
XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !guest_handle_okay(area.addr.h, 1) )
             break;
 
+#if CONFIG_X86
+        if ( pv_shim )
+        {
+            rc = xen_hypercall_vcpu_op(VCPUOP_register_runstate_memory_area,
+                                       vcpuid, &area);
+            break;
+        }
+#endif
+
         rc = 0;
         runstate_guest(v) = area.addr.h;
 
diff --git a/xen/include/asm-x86/guest/hypercall.h 
b/xen/include/asm-x86/guest/hypercall.h
index e9e626b474..07b9302263 100644
--- a/xen/include/asm-x86/guest/hypercall.h
+++ b/xen/include/asm-x86/guest/hypercall.h
@@ -192,6 +192,13 @@ static inline long xen_hypercall_shutdown(unsigned int 
reason)
     return 0;
 }
 
+static inline int xen_hypercall_vcpu_op(unsigned int cmd, unsigned int vcpu,
+                                        void *arg)
+{
+    ASSERT_UNREACHABLE();
+    return 0;
+}
+
 #endif /* CONFIG_XEN_GUEST */
 #endif /* __X86_XEN_HYPERCALL_H__ */
 
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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