From: <sv...@va...> - 2015-06-28 16:38:00
|
Author: bart Date: Sun Jun 28 17:37:54 2015 New Revision: 15370 Log: xen: syswrap XEN_DOMCTL_[gs]et_vcpu_msrs The XEN_DOMCTL_[gs]et_vcpu_msrs work simiarly to the other get/set pairs, taking a vcpu, buffer and size. A query with a buffer of NULL is a request for the maximum size. Signed-off-by: Andrew Cooper <and...@ci...> Modified: trunk/coregrind/m_syswrap/syswrap-xen.c trunk/include/vki/vki-xen-domctl.h Modified: trunk/coregrind/m_syswrap/syswrap-xen.c ============================================================================== --- trunk/coregrind/m_syswrap/syswrap-xen.c (original) +++ trunk/coregrind/m_syswrap/syswrap-xen.c Sun Jun 28 17:37:54 2015 @@ -971,6 +971,22 @@ PRE_XEN_DOMCTL_READ(debug_op, vcpu); break; + case VKI_XEN_DOMCTL_get_vcpu_msrs: + __PRE_XEN_DOMCTL_READ(get_vcpu_msrs, vcpu_msrs, vcpu); + __PRE_XEN_DOMCTL_READ(get_vcpu_msrs, vcpu_msrs, msr_count); + __PRE_XEN_DOMCTL_READ(get_vcpu_msrs, vcpu_msrs, msrs); + break; + + case VKI_XEN_DOMCTL_set_vcpu_msrs: + __PRE_XEN_DOMCTL_READ(set_vcpu_msrs, vcpu_msrs, vcpu); + __PRE_XEN_DOMCTL_READ(set_vcpu_msrs, vcpu_msrs, msr_count); + __PRE_XEN_DOMCTL_READ(set_vcpu_msrs, vcpu_msrs, msrs); + PRE_MEM_READ("XEN_DOMCTL_set_vcpu_msrs *u.vcpu_msrs.msrs.p", + (Addr)domctl->u.vcpu_msrs.msrs.p, + sizeof(vki_xen_domctl_vcpu_msr_t) * + domctl->u.vcpu_msrs.msr_count); + break; + default: bad_subop(tid, layout, arrghs, status, flags, "__HYPERVISOR_domctl", domctl->cmd); @@ -1419,6 +1435,7 @@ case VKI_XEN_DOMCTL_set_max_evtchn: case VKI_XEN_DOMCTL_cacheflush: case VKI_XEN_DOMCTL_resumedomain: + case VKI_XEN_DOMCTL_set_vcpu_msrs: case VKI_XEN_DOMCTL_set_access_required: /* No output fields */ break; @@ -1658,6 +1675,13 @@ break; } break; + case VKI_XEN_DOMCTL_get_vcpu_msrs: + if (domctl->u.vcpu_msrs.msrs.p) + POST_MEM_WRITE((Addr)domctl->u.vcpu_msrs.msrs.p, + sizeof(vki_xen_domctl_vcpu_msr_t) * + domctl->u.vcpu_msrs.msr_count); + break; + case VKI_XEN_DOMCTL_mem_event_op: POST_XEN_DOMCTL_WRITE(mem_event_op, port); Modified: trunk/include/vki/vki-xen-domctl.h ============================================================================== --- trunk/include/vki/vki-xen-domctl.h (original) +++ trunk/include/vki/vki-xen-domctl.h Sun Jun 28 17:37:54 2015 @@ -87,6 +87,8 @@ #define VKI_XEN_DOMCTL_getnodeaffinity 69 #define VKI_XEN_DOMCTL_set_max_evtchn 70 #define VKI_XEN_DOMCTL_cacheflush 71 +#define VKI_XEN_DOMCTL_get_vcpu_msrs 72 +#define VKI_XEN_DOMCTL_set_vcpu_msrs 73 #define VKI_XEN_DOMCTL_gdbsx_guestmemio 1000 #define VKI_XEN_DOMCTL_gdbsx_pausevcpu 1001 #define VKI_XEN_DOMCTL_gdbsx_unpausevcpu 1002 @@ -404,6 +406,20 @@ vki_xen_pfn_t start_pfn, nr_pfns; }; +struct vki_xen_domctl_vcpu_msr { + vki_uint32_t index; + vki_uint32_t reserved; + vki_xen_uint64_aligned_t value; +}; +typedef struct vki_xen_domctl_vcpu_msr vki_xen_domctl_vcpu_msr_t; +DEFINE_VKI_XEN_GUEST_HANDLE(vki_xen_domctl_vcpu_msr_t); + +struct vki_xen_domctl_vcpu_msrs { + vki_uint32_t vcpu; + vki_uint32_t msr_count; + VKI_XEN_GUEST_HANDLE_64(vki_xen_domctl_vcpu_msr_t) msrs; +}; + struct vki_xen_domctl { vki_uint32_t cmd; vki_uint32_t interface_version; /* XEN_DOMCTL_INTERFACE_VERSION */ @@ -457,6 +473,7 @@ #if defined(__i386__) || defined(__x86_64__) struct vki_xen_domctl_cpuid cpuid; struct vki_xen_domctl_vcpuextstate vcpuextstate; + struct vki_xen_domctl_vcpu_msrs vcpu_msrs; #endif struct vki_xen_domctl_set_access_required access_required; //struct vki_xen_domctl_audit_p2m audit_p2m; |