Valgrind: r16355 - in /trunk: NEWS coregrind/m_syswrap/syswrap-xen.c include/vki/vki-xen-domctl.h include/vki/vki-xen-x86.h

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Valgrind: r16355 - in /trunk: NEWS coregrind/m_syswrap/syswrap-xen.c include/vki/vki-xen-domctl.h include/vki/vki-xen-x86.h

svn-2
Author: iraisr
Date: Wed May 10 19:04:17 2017
New Revision: 16355

Log:
Implement additional Xen hypercalls
Fixes BZ#373086
Patch by: Mihai DONȚU <[hidden email]>

Modified:
    trunk/NEWS
    trunk/coregrind/m_syswrap/syswrap-xen.c
    trunk/include/vki/vki-xen-domctl.h
    trunk/include/vki/vki-xen-x86.h

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Wed May 10 19:04:17 2017
@@ -136,6 +136,7 @@
 372794  LibVEX (arm32 front end): 'Assertion szBlg2 <= 3' failed
 373046  Stacks registered by core are never deregistered
 373069  memcheck/tests/leak_cpp_interior fails with GCC 5.1+
+373086  Implement additional Xen hypercalls
 373192  Calling posix_spawn in glibc 2.24 completely broken
 373488  Support for fanotify API on ARM64 architecture
  == 368864  WARNING: unhandled arm64-linux syscall: 262 (fanotify_init)

Modified: trunk/coregrind/m_syswrap/syswrap-xen.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-xen.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-xen.c Wed May 10 19:04:17 2017
@@ -729,6 +729,7 @@
    case 0x00000009:
    case 0x0000000a:
    case 0x0000000b:
+   case 0x0000000c:
    break;
    default:
       bad_intf_version(tid, layout, arrghs, status, flags,
@@ -790,6 +791,12 @@
                    (Addr)domctl->u.hvmcontext_partial.buffer.p,
                    VKI_HVM_SAVE_LENGTH(CPU));
            break;
+       case VKI_HVM_SAVE_CODE(MTRR):
+           if ( domctl->u.hvmcontext_partial.buffer.p )
+        PRE_MEM_WRITE("XEN_DOMCTL_gethvmcontext_partial *buffer",
+   (Addr)domctl->u.hvmcontext_partial.buffer.p,
+   VKI_HVM_SAVE_LENGTH(MTRR));
+           break;
        default:
            bad_subop(tid, layout, arrghs, status, flags,
                          "__HYPERVISOR_domctl_gethvmcontext_partial type",
@@ -1273,7 +1280,7 @@
       case 0x000000b:
           if (domctl->u.monitor_op_0000000b.op == VKI_XEN_DOMCTL_MONITOR_OP_ENABLE ||
               domctl->u.monitor_op_0000000b.op == VKI_XEN_DOMCTL_MONITOR_OP_ENABLE) {
-             switch(domctl->u.monitor_op_0000000b.event) {
+             switch (domctl->u.monitor_op_0000000b.event) {
              case VKI_XEN_DOMCTL_MONITOR_EVENT_WRITE_CTRLREG:
                 __PRE_XEN_DOMCTL_READ(monitor_op, monitor_op_0000000b, u.mov_to_cr);
                 break;
@@ -1283,6 +1290,8 @@
              case VKI_XEN_DOMCTL_MONITOR_EVENT_GUEST_REQUEST:
                 __PRE_XEN_DOMCTL_READ(monitor_op, monitor_op_0000000b, u.guest_request);
                 break;
+             case VKI_XEN_DOMCTL_MONITOR_OP_GET_CAPABILITIES:
+                break;
              }
           }
 

Modified: trunk/include/vki/vki-xen-domctl.h
==============================================================================
--- trunk/include/vki/vki-xen-domctl.h (original)
+++ trunk/include/vki/vki-xen-domctl.h Wed May 10 19:04:17 2017
@@ -37,6 +37,7 @@
  * - 0x00000009: Xen 4.3 & 4.4
  * - 0x0000000a: Xen 4.5
  * - 0x0000000b: Xen 4.6
+ * - 0x0000000c: Xen 4.7
  *
  * When adding a new subop be sure to include the variants used by all
  * of the above, both here and in syswrap-xen.c
@@ -553,6 +554,28 @@
 };
 
 
+struct vki_xen_domctl_monitor_op {
+    vki_uint32_t op;
+#define VKI_XEN_DOMCTL_MONITOR_OP_ENABLE            0
+#define VKI_XEN_DOMCTL_MONITOR_OP_DISABLE           1
+#define VKI_XEN_DOMCTL_MONITOR_OP_GET_CAPABILITIES  2
+#define VKI_XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP  3
+    vki_uint32_t event;
+    union {
+        struct {
+            vki_uint8_t index;
+            vki_uint8_t sync;
+            vki_uint8_t onchangeonly;
+        } mov_to_cr;
+        struct {
+            vki_uint8_t extended_capture;
+        } mov_to_msr;
+        struct {
+            vki_uint8_t sync;
+        } guest_request;
+    } u;
+};
+
 struct vki_xen_domctl {
     vki_uint32_t cmd;
     vki_uint32_t interface_version; /* XEN_DOMCTL_INTERFACE_VERSION */

Modified: trunk/include/vki/vki-xen-x86.h
==============================================================================
--- trunk/include/vki/vki-xen-x86.h (original)
+++ trunk/include/vki/vki-xen-x86.h Wed May 10 19:04:17 2017
@@ -270,6 +270,19 @@
 
 VKI_DECLARE_HVM_SAVE_TYPE(CPU, 2, struct vki_hvm_hw_cpu);
 
+struct vki_hvm_hw_mtrr {
+#define VKI_MTRR_VCNT     8
+#define VKI_NUM_FIXED_MSR 11
+   vki_uint64_t msr_pat_cr;
+   /* mtrr physbase & physmask msr pair*/
+   vki_uint64_t msr_mtrr_var[VKI_MTRR_VCNT*2];
+   vki_uint64_t msr_mtrr_fixed[VKI_NUM_FIXED_MSR];
+   vki_uint64_t msr_mtrr_cap;
+   vki_uint64_t msr_mtrr_def_type;
+};
+
+VKI_DECLARE_HVM_SAVE_TYPE(MTRR, 14, struct vki_hvm_hw_mtrr);
+
 #endif // __VKI_XEN_H
 
 /*--------------------------------------------------------------------*/


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers