Useful messages for sys/domctl interface_version mismatch.
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/4 Useful messages for sys/domctl interface_version mismatch.
--- coregrind/m_syswrap/syswrap-xen.c | 52 ++++++++++++++++++++++++++++++++----- 1 files changed, 45 insertions(+), 7 deletions(-)
coregrind/m_syswrap/syswrap-xen.c +45 -7
@@ -59,6 +59,7 @@#include "priv_syswrap-xen.h" #include <stdint.h> +#include <inttypes.h> #define __XEN_TOOLS__
@@ -353,9 +354,26 @@ PRE(sysctl) {PRE_MEM_READ ("__HYPERVISOR_sysctl" ,ARG1 ,sizeof (uint32_t ) +sizeof (uint32_t )); -if (!sysctl || sysctl->interface_version !=XEN_SYSCTL_INTERFACE_VERSION ) -/* BUG ? */ +if (!sysctl) +return ; + +if (sysctl->interface_version !=XEN_SYSCTL_INTERFACE_VERSION ) { +VG_ (dmsg)("WARNING: sysctl version %" PRIx32" not supported, " +"built for %" PRIx32"\n" , + sysctl->interface_version, +XEN_SYSCTL_INTERFACE_VERSION ); +if (VG_ (clo_verbosity) >1 ) { +VG_ (get_and_pp_StackTrace)(tid,VG_ (clo_backtrace_size)); + } +VG_ (dmsg)("You may be able to write your own handler.\n" ); +VG_ (dmsg)("Read the file README_MISSING_SYSCALL_OR_IOCTL.\n" ); +VG_ (dmsg)("Nevertheless we consider this a bug. Please report\n" ); +VG_ (dmsg)("it at http://valgrind.org/support/bug_reports.html &\n" ); +VG_ (dmsg)("http://wiki.xen.org/wiki/Reporting_Bugs_against_Xen.\n" ); + +SET_STATUS_Failure (VKI_EINVAL );return ; + }#define __PRE_XEN_SYSCTL_READ (_sysctl, _union, _field) \ PRE_MEM_READ("XEN_SYSCTL_" # _sysctl, \
@@ -438,9 +456,26 @@ PRE(domctl)PRE_MEM_READ ("__HYPERVISOR_domctl" ,ARG1 ,sizeof (uint32_t ) +sizeof (uint32_t ) +sizeof (domid_t)); -if (!domctl || domctl->interface_version !=XEN_DOMCTL_INTERFACE_VERSION ) -/* BUG ? */ +if (!domctl) +return ; + +if (domctl->interface_version !=XEN_DOMCTL_INTERFACE_VERSION ) { +VG_ (dmsg)("WARNING: domctl version %" PRIx32" not supported, " +"built for %" PRIx32"\n" , + domctl->interface_version, +XEN_DOMCTL_INTERFACE_VERSION ); +if (VG_ (clo_verbosity) >1 ) { +VG_ (get_and_pp_StackTrace)(tid,VG_ (clo_backtrace_size)); + } +VG_ (dmsg)("You may be able to write your own handler.\n" ); +VG_ (dmsg)("Read the file README_MISSING_SYSCALL_OR_IOCTL.\n" ); +VG_ (dmsg)("Nevertheless we consider this a bug. Please report\n" ); +VG_ (dmsg)("it at http://valgrind.org/support/bug_reports.html &\n" ); +VG_ (dmsg)("http://wiki.xen.org/wiki/Reporting_Bugs_against_Xen.\n" ); + +SET_STATUS_Failure (VKI_EINVAL );return ; + }#define __PRE_XEN_DOMCTL_READ (_domctl, _union, _field) \ PRE_MEM_READ("XEN_DOMCTL_" # _domctl, \
@@ -740,11 +775,14 @@ POST(sysctl)case XEN_SYSCTL_topologyinfo:POST_XEN_SYSCTL_WRITE (topologyinfo, max_cpu_index); -POST_MEM_WRITE ((Addr )sysctl->u.topologyinfo.cpu_to_core.p, +if (sysctl->u.topologyinfo.cpu_to_core.p) +POST_MEM_WRITE ((Addr )sysctl->u.topologyinfo.cpu_to_core.p,sizeof (uint32_t ) * sysctl->u.topologyinfo.max_cpu_index); -POST_MEM_WRITE ((Addr )sysctl->u.topologyinfo.cpu_to_socket.p, +if (sysctl->u.topologyinfo.cpu_to_socket.p) +POST_MEM_WRITE ((Addr )sysctl->u.topologyinfo.cpu_to_socket.p,sizeof (uint32_t ) * sysctl->u.topologyinfo.max_cpu_index); -POST_MEM_WRITE ((Addr )sysctl->u.topologyinfo.cpu_to_node.p, +if (sysctl->u.topologyinfo.cpu_to_node.p) +POST_MEM_WRITE ((Addr )sysctl->u.topologyinfo.cpu_to_node.p,sizeof (uint32_t ) * sysctl->u.topologyinfo.max_cpu_index);break ;
Signature · 1 line
1.7.2.5
PATCH 2/4 xen: adding missing break.
In reply to a message not in the archiveThanks to Julien Grall.
--- coregrind/m_syswrap/syswrap-xen.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
coregrind/m_syswrap/syswrap-xen.c +1 -0
@@ -127,6 +127,7 @@ PRE(memory_op)PRE_MEM_READ (which, (Addr )memory_reservation->extent_start.p,sizeof (xen_pfn_t) * memory_reservation->nr_extents); +break ;case XENMEM_populate_physmap: which ="XENMEM_populate_physmap" ; PRE_MEM_READ(which,
Signature · 1 line
1.7.2.5
PATCH 3/4 xen: Remove cast of ARG* to unsigned int before pointer conversion.
In reply to a message not in the archiveThis is pretty dodgy on 64 bit systems.
Thanks to Julien Grall.
--- coregrind/m_syswrap/syswrap-xen.c | 27 +++++++++++++-------------- 1 files changed, 13 insertions(+), 14 deletions(-)
coregrind/m_syswrap/syswrap-xen.c +13 -14
@@ -103,8 +103,7 @@ PRE(memory_op)switch (ARG1 ) {case XENMEM_set_memory_map: { -xen_foreign_memory_map_t *arg = - (xen_foreign_memory_map_t *)(unsigned int )ARG2 ; +xen_foreign_memory_map_t *arg =(xen_foreign_memory_map_t *)ARG2 ;PRE_MEM_READ ("XENMEM_set_memory_map" , (Addr)&arg->domid,sizeof (arg->domid)); PRE_MEM_READ("XENMEM_set_memory_map",
@@ -115,7 +114,7 @@ PRE(memory_op)case XENMEM_decrease_reservation:case XENMEM_populate_physmap: {struct xen_memory_reservation *memory_reservation = - (struct xen_memory_reservation *)(unsigned int )ARG2 ; + (struct xen_memory_reservation *)ARG2 ;char *which;switch (ARG1 ) {
@@ -166,7 +165,7 @@ PRE(memory_op)PRE (mmuext_op) { -mmuext_op_t *ops = (void *)(unsigned int )ARG1 ; +mmuext_op_t *ops = (mmuext_op_t *)ARG1 ;unsigned int i, nr =ARG2 ;
@@ -286,12 +285,12 @@ static void pre_evtchn_op(ThreadId tid,PRE (evtchn_op) {pre_evtchn_op (tid, layout, arrghs, status, flags, -ARG1 , (void *)(unsigned int )ARG2 ,0 ); +ARG1 , (void *)ARG2 ,0 ); }PRE (evtchn_op_compat) { -struct evtchn_op *evtchn = (struct evtchn_op *)(unsigned int )ARG1 ; +struct evtchn_op *evtchn = (struct evtchn_op *)ARG1 ;PRE_MEM_READ ("__HYPERVISOR_event_channel_op_compat" ,ARG1 ,sizeof (*evtchn));
@@ -343,7 +342,7 @@ PRE(grant_table_op) }PRE (sysctl) { -struct xen_sysctl *sysctl = (struct xen_sysctl *)(unsigned int )ARG1 ; +struct xen_sysctl *sysctl = (struct xen_sysctl *)ARG1 ;"__HYPERVISOR_sysctl ( %d )" , sysctl->cmd);
@@ -444,7 +443,7 @@ PRE(sysctl) {PRE (domctl) { -struct xen_domctl *domctl = (struct xen_domctl *)(unsigned int )ARG1 ; +struct xen_domctl *domctl = (struct xen_domctl *)ARG1 ;"__HYPERVISOR_domctl ( %d ) on dom%d" , domctl->cmd, domctl->domain);
@@ -636,7 +635,7 @@ POST(memory_op)case XENMEM_increase_reservation:case XENMEM_populate_physmap: {struct xen_memory_reservation *memory_reservation = - (struct xen_memory_reservation *)(unsigned int )ARG2 ; + (struct xen_memory_reservation *)ARG2 ;POST_MEM_WRITE ((Addr )memory_reservation->extent_start.p,sizeof (xen_pfn_t) * memory_reservation->nr_extents);
@@ -647,7 +646,7 @@ POST(memory_op)POST (mmuext_op) { -unsigned int *pdone = (void *)(unsigned int )ARG3 ; +unsigned int *pdone = (unsigned int *)ARG3 ;/* simplistic */ POST_MEM_WRITE ((Addr )pdone,sizeof (*pdone)); }
@@ -665,12 +664,12 @@ static void post_evtchn_op(ThreadId tid, __vki_u32 cmd, void *arg, int compat)POST (evtchn_op) { -post_evtchn_op (tid,ARG1 , (void *)(unsigned int )ARG2 ,0 ); +post_evtchn_op (tid,ARG1 , (void *)ARG2 ,0 ); }POST (evtchn_op_compat) { -struct evtchn_op *evtchn = (struct evtchn_op *)(unsigned int )ARG1 ; +struct evtchn_op *evtchn = (struct evtchn_op *)ARG1 ;post_evtchn_op (tid, evtchn->cmd, &evtchn->u,1 ); }
@@ -727,7 +726,7 @@ POST(grant_table_op)POST (sysctl) { -struct xen_sysctl *sysctl = (struct xen_sysctl *)(unsigned int )ARG1 ; +struct xen_sysctl *sysctl = (struct xen_sysctl *)ARG1 ;if (!sysctl || sysctl->interface_version !=XEN_SYSCTL_INTERFACE_VERSION )return ;
@@ -801,7 +800,7 @@ POST(sysctl) }POST (domctl){ -struct xen_domctl *domctl = (struct xen_domctl *)(unsigned int )ARG1 ; +struct xen_domctl *domctl = (struct xen_domctl *)ARG1 ;if (!domctl || domctl->interface_version !=XEN_DOMCTL_INTERFACE_VERSION )return ;
Signature · 1 line
1.7.2.5
PATCH 4/4 xen: include arg struct field names when marking memory as read.
In reply to a message not in the archiveMakes it easier to figure out what was not initialised.
Thanks, once again, to Julien Grall.
--- coregrind/m_syswrap/syswrap-xen.c | 33 +++++++++++++++++---------------- 1 files changed, 17 insertions(+), 16 deletions(-)
coregrind/m_syswrap/syswrap-xen.c +17 -16
@@ -104,9 +104,9 @@ PRE(memory_op)switch (ARG1 ) {case XENMEM_set_memory_map: {xen_foreign_memory_map_t *arg =(xen_foreign_memory_map_t *)ARG2 ; -PRE_MEM_READ ("XENMEM_set_memory_map" , +PRE_MEM_READ ("XENMEM_set_memory_map domid" , (Addr)&arg->domid,sizeof (arg->domid)); -PRE_MEM_READ ("XENMEM_set_memory_map" , +PRE_MEM_READ ("XENMEM_set_memory_map map" , (Addr)&arg->map,sizeof (arg->map));break ; }
@@ -171,7 +171,7 @@ PRE(mmuext_op)for (i=0 ; i<nr; i++) {mmuext_op_t *op = ops + i; -PRE_MEM_READ ("__HYPERVISOR_MMUEXT_OP" , +PRE_MEM_READ ("__HYPERVISOR_MMUEXT_OP cmd" , (Addr)&op->cmd,sizeof (op->cmd));switch (op->cmd) {case MMUEXT_PIN_L1_TABLE :
@@ -264,9 +264,9 @@ static void pre_evtchn_op(ThreadId tid,switch (cmd) {case EVTCHNOP_alloc_unbound: {struct evtchn_alloc_unbound *alloc_unbound = arg; -PRE_MEM_READ ("EVTCHNOP_alloc_unbound" , +PRE_MEM_READ ("EVTCHNOP_alloc_unbound dom" , (Addr)&alloc_unbound->dom,sizeof (alloc_unbound->dom)); -PRE_MEM_READ ("EVTCHNOP_alloc_unbound" , +PRE_MEM_READ ("EVTCHNOP_alloc_unbound remote_dom" , (Addr)&alloc_unbound->remote_dom,sizeof (alloc_unbound->remote_dom));break ;
@@ -329,8 +329,9 @@ PRE(grant_table_op)switch (ARG1 ) {case GNTTABOP_setup_table: {struct gnttab_setup_table *gst = (void *)(intptr_t )ARG2 ; -PRE_MEM_READ ("GNTTABOP_setup_table" , (Addr)&gst->dom,sizeof (gst->dom)); -PRE_MEM_READ ("GNTTABOP_setup_table" , +PRE_MEM_READ ("GNTTABOP_setup_table dom" , + (Addr)&gst->dom,sizeof (gst->dom)); +PRE_MEM_READ ("GNTTABOP_setup_table nr_frames" , (Addr)&gst->nr_frames,sizeof (gst->nr_frames));break ; }
@@ -375,9 +376,9 @@ PRE(sysctl) {return ; } -#define __PRE_XEN_SYSCTL_READ (_sysctl, _union, _field) \ - PRE_MEM_READ("XEN_SYSCTL_" # _sysctl, \ - (Addr)&sysctl->u._union._field, \ +#define __PRE_XEN_SYSCTL_READ (_sysctl, _union, _field) \ + PRE_MEM_READ("XEN_SYSCTL_" #_sysctl " u." #_union "." #_field, \ + (Addr)&sysctl->u._union._field, \ sizeof(sysctl->u._union._field))#define PRE_XEN_SYSCTL_READ (_sysctl, _field) \ __PRE_XEN_SYSCTL_READ(_sysctl, _sysctl, _field)
@@ -477,9 +478,9 @@ PRE(domctl)return ; } -#define __PRE_XEN_DOMCTL_READ (_domctl, _union, _field) \ - PRE_MEM_READ("XEN_DOMCTL_" # _domctl, \ - (Addr)&domctl->u._union._field, \ +#define __PRE_XEN_DOMCTL_READ (_domctl, _union, _field) \ + PRE_MEM_READ("XEN_DOMCTL_" #_domctl " u." #_union "." #_field, \ + (Addr)&domctl->u._union._field, \ sizeof(domctl->u._union._field))#define PRE_XEN_DOMCTL_READ (_domctl, _field) \ __PRE_XEN_DOMCTL_READ(_domctl, _domctl, _field)
@@ -555,7 +556,7 @@ PRE(domctl)case XEN_DOMCTL_setvcpuaffinity:__PRE_XEN_DOMCTL_READ (setvcpuaffinity, vcpuaffinity, vcpu); -PRE_MEM_READ ("XEN_DOMCTL_setvcpuaffinity" , +PRE_MEM_READ ("XEN_DOMCTL_setvcpuaffinity u.vcpuaffinity.cpumap.bitmap" , (Addr )domctl->u.vcpuaffinity.cpumap.bitmap.p, domctl->u.vcpuaffinity.cpumap.nr_cpus /8 );break ;
@@ -570,7 +571,7 @@ PRE(domctl)break ;case XEN_DOMCTL_set_cpuid: -PRE_MEM_READ ("XEN_DOMCTL_set_cpuid" , +PRE_MEM_READ ("XEN_DOMCTL_set_cpuid u.cpuid" , (Addr)&domctl->u.cpuid,sizeof (domctl->u.cpuid));break ;
@@ -598,7 +599,7 @@ PRE(hvm_op)"__HYPERVISOR_hvm_op ( %ld, %p )" , op, arg);#define __PRE_XEN_HVMOP_READ (_hvm_op, _type, _field) \ - PRE_MEM_READ("XEN_HVMOP_" # _hvm_op, \ + PRE_MEM_READ("XEN_HVMOP_" # _hvm_op " " #_field, \ (Addr)&((_type*)arg)->_field, \ sizeof(((_type*)arg)->_field))#define PRE_XEN_HVMOP_READ (_hvm_op, _field) \
Signature · 1 line
1.7.2.5
A message that is not in the archive (sent off-list or not yet received): [email protected]
Please: file a bug report and attach the patches to it. Else they are pretty much guaranteed to wind up at /dev/null, because nobody tracks patches on the list AFAIK.
J
Quoted 94 lines · Ian Campbell
--- coregrind/m_syswrap/syswrap-xen.c | 52++++++++++++++++++++++++++++++++----- 1 files changed, 45 insertions(+), 7 deletions(-)
(quoted diff) +0
-0
b/coregrind/m_syswrap/syswrap-xen.cindex 00192bf..6226f7e 100644coregrind/m_syswrap/syswrap-xen.c +1
-1@@ -59,6 +59,7 @@#include "priv_syswrap-xen.h" #include <stdint.h> +#include <inttypes.h> #define __XEN_TOOLS__@@ -353,9 +354,26 @@ PRE(sysctl) {PRE_MEM_READ ("__HYPERVISOR_sysctl" ,ARG1 ,sizeof (uint32_t ) +sizeof (uint32_t )); - if (!sysctl || sysctl->interface_version !=
XEN_SYSCTL_INTERFACE_VERSION) - /* BUG ? */coregrind/m_syswrap/syswrap-xen.c +19
-1+if (!sysctl) +return ; + +if (sysctl->interface_version !=XEN_SYSCTL_INTERFACE_VERSION ) { +VG_ (dmsg)("WARNING: sysctl version %" PRIx32" not supported, " +"built for %" PRIx32"\n" , + sysctl->interface_version, +XEN_SYSCTL_INTERFACE_VERSION ); +if (VG_ (clo_verbosity) >1 ) { +VG_ (get_and_pp_StackTrace)(tid,VG_ (clo_backtrace_size)); + } +VG_ (dmsg)("You may be able to write your own handler.\n" ); +VG_ (dmsg)("Read the file README_MISSING_SYSCALL_OR_IOCTL.\n" ); +VG_ (dmsg)("Nevertheless we consider this a bug. Please report\n" ); +VG_ (dmsg)("it at http://valgrind.org/support/bug_reports.html &\n" ); +VG_ (dmsg)("http://wiki.xen.org/wiki/Reporting_Bugs_against_Xen.\n" ); + +SET_STATUS_Failure (VKI_EINVAL );return ; + }#define __PRE_XEN_SYSCTL_READ (_sysctl, _union, _field) \ PRE_MEM_READ("XEN_SYSCTL_" # _sysctl, \@@ -438,9 +456,26 @@ PRE(domctl)PRE_MEM_READ ("__HYPERVISOR_domctl" ,ARG1 ,sizeof (uint32_t ) +sizeof (uint32_t ) +sizeof (domid_t)); - if (!domctl || domctl->interface_version !=
XEN_DOMCTL_INTERFACE_VERSION) - /* BUG ? */coregrind/m_syswrap/syswrap-xen.c +21
-1+if (!domctl) +return ; + +if (domctl->interface_version !=XEN_DOMCTL_INTERFACE_VERSION ) { +VG_ (dmsg)("WARNING: domctl version %" PRIx32" not supported, " +"built for %" PRIx32"\n" , + domctl->interface_version, +XEN_DOMCTL_INTERFACE_VERSION ); +if (VG_ (clo_verbosity) >1 ) { +VG_ (get_and_pp_StackTrace)(tid,VG_ (clo_backtrace_size)); + } +VG_ (dmsg)("You may be able to write your own handler.\n" ); +VG_ (dmsg)("Read the file README_MISSING_SYSCALL_OR_IOCTL.\n" ); +VG_ (dmsg)("Nevertheless we consider this a bug. Please report\n" ); +VG_ (dmsg)("it at http://valgrind.org/support/bug_reports.html &\n" ); +VG_ (dmsg)("http://wiki.xen.org/wiki/Reporting_Bugs_against_Xen.\n" ); + +SET_STATUS_Failure (VKI_EINVAL );return ; + }#define __PRE_XEN_DOMCTL_READ (_domctl, _union, _field) \ PRE_MEM_READ("XEN_DOMCTL_" # _domctl, \@@ -740,11 +775,14 @@ POST(sysctl)case XEN_SYSCTL_topologyinfo:POST_XEN_SYSCTL_WRITE (topologyinfo, max_cpu_index); - POST_MEM_WRITE((Addr)sysctl->u.topologyinfo.cpu_to_core.p, +if (sysctl->u.topologyinfo.cpu_to_core.p) + POST_MEM_WRITE((Addr)sysctl->u.topologyinfo.cpu_to_core.p, sizeof(uint32_t) *
sysctl->u.topologyinfo.max_cpu_index); -
POST_MEM_WRITE((Addr)sysctl->u.topologyinfo.cpu_to_socket.p, + if
(sysctl->u.topologyinfo.cpu_to_socket.p)
+ POST_MEM_WRITE((Addr)sysctl->u.topologyinfo.cpu_to_socket.p,sizeof(uint32_t) *
sysctl->u.topologyinfo.max_cpu_index); - POST_MEM_WRITE((Addr)sysctl->u.topologyinfo.cpu_to_node.p,coregrind/m_syswrap/syswrap-xen.c +2
-0+if (sysctl->u.topologyinfo.cpu_to_node.p) + POST_MEM_WRITE((Addr)sysctl->u.topologyinfo.cpu_to_node.p, sizeof(uint32_t) *
sysctl->u.topologyinfo.max_cpu_index); break;
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 3 lines · Julian Seward
Please: file a bug report and attach the patches to it. Else they are pretty much guaranteed to wind up at
/dev/null, because nobody tracks patches on the list AFAIK.
Bart indicated that he intended to apply these.
I'll attach patches to a bug in the future though, thanks for the tip.
I'll do it for these too if Bart wants me to.
Thanks,
Ian.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 10 lines · Ian Campbell
Quoted 3 lines · Julian Seward
Please: file a bug report and attach the patches to it. Else they are pretty much guaranteed to wind up at
/dev/null, because nobody tracks patches on the list AFAIK.Bart indicated that he intended to apply these.
I'll attach patches to a bug in the future though, thanks for the tip.
I'll do it for these too if Bart wants me to.
I'll pick the patches from the mailing list this time. But next time please file a bug report. As you might have noticed Julian uses the bugzilla ticket numbers to track issues in the NEWS file, and also to keep track of which issues have been fixed in which branch.
Bart.
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · Ian Campbell
Quoted 3 lines · Bart Van Assche
please file a bug report. As you might have noticed Julian uses the bugzilla ticket numbers to track issues in the NEWS file, and also to keep track of which issues have been fixed in which branch.
And also docs/internals/3_8_BUGSTATUS.txt tracks the current not-fixed bug set.
J
Quoted 6 lines · Bart Van Assche
Quoted 5 lines · Ian Campbell
Quoted 3 lines · Julian Seward
Please: file a bug report and attach the patches to it. Else they are pretty much guaranteed to wind up at
/dev/null, because nobody tracks patches on the list AFAIK.
Quoted 7 lines
Quoted 5 lines
Bart indicated that he intended to apply these.
I'll attach patches to a bug in the future though, thanks for the tip.
I'll do it for these too if Bart wants me to.
I'll pick the patches from the mailing list this time.
Thanks.
Quoted 4 lines
But next time
please file a bug report. As you might have noticed Julian uses the bugzilla ticket numbers to track issues in the NEWS file, and also to keep track of which issues have been fixed in which branch.
I hadn't noticed this, but I have now ;-)
Ian.