From d2a03925396e237809ccca6a39cba3c4a46c5655 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 28 Jun 2015 16:48:22 +0000 Subject: [PATCH] xen: Basic syswrap infrastructure for XEN_sched_op hypercalls Signed-off-by: Andrew Cooper Signed-off-by: Ian Campbell git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15381 --- coregrind/m_syswrap/syswrap-xen.c | 31 ++++++++++++++++++++++++++++++- include/vki/vki-xen.h | 1 + 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/coregrind/m_syswrap/syswrap-xen.c b/coregrind/m_syswrap/syswrap-xen.c index f46bb4c5e..f9515e086 100644 --- a/coregrind/m_syswrap/syswrap-xen.c +++ b/coregrind/m_syswrap/syswrap-xen.c @@ -339,6 +339,29 @@ PRE(mmuext_op) } } +PRE(sched_op) +{ + PRINT("__HYPERVISOR_sched_op ( %ld, %lx )", ARG1, ARG2); + void *arg = (void *)(unsigned long)ARG2; + +#define __PRE_XEN_SCHEDOP_READ(_schedop, _type, _field) \ + PRE_MEM_READ("XEN_SCHEDOP_" # _schedop " " #_field, \ + (Addr)&((_type*)arg)->_field, \ + sizeof(((_type*)arg)->_field)) +#define PRE_XEN_SCHEDOP_READ(_schedop, _field) \ + __PRE_XEN_SCHEDOP_READ(_schedop, vki_xen_ ## _schedop ## _t, _field) + + switch (ARG1) { + + default: + bad_subop(tid, layout, arrghs, status, flags, + "__HYPERVISOR_sched_op", ARG1); + break; + } +#undef __PRE_XEN_SCHEDOP_READ +#undef PRE_XEN_SCHEDOP_READ +} + static void pre_evtchn_op(ThreadId tid, SyscallArgLayout* layout, /*MOD*/SyscallArgs* arrghs, @@ -1270,6 +1293,12 @@ static void post_evtchn_op(ThreadId tid, __vki_u32 cmd, void *arg, int compat) } } +POST(sched_op) +{ + switch (ARG1) { + } +} + POST(evtchn_op) { post_evtchn_op(tid, ARG1, (void *)ARG2, 0); @@ -1877,7 +1906,7 @@ static XenHypercallTableEntry hypercall_table[] = { HYPXY(__VKI_XEN_mmuext_op, mmuext_op, 2), // 26 // __VKI_XEN_xsm_op // 27 // __VKI_XEN_nmi_op // 28 - // __VKI_XEN_sched_op // 29 + HYPXY(__VKI_XEN_sched_op, sched_op, 2), // 29 // __VKI_XEN_callback_op // 30 // __VKI_XEN_xenoprof_op // 31 diff --git a/include/vki/vki-xen.h b/include/vki/vki-xen.h index e2f3d817b..cf24ed666 100644 --- a/include/vki/vki-xen.h +++ b/include/vki/vki-xen.h @@ -80,6 +80,7 @@ struct vki_xenctl_bitmap { #include #include #include +#include #include #include #include -- 2.11.4.GIT