From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Castro Subject: [PATCH 05/10] Xen: Support for HVM_op Hypercall Date: Fri, 19 Aug 2011 01:03:22 +0900 Message-ID: <1313683408-32306-6-git-send-email-evil.dani@gmail.com> References: <1313683408-32306-1-git-send-email-evil.dani@gmail.com> Return-path: In-Reply-To: <1313683408-32306-1-git-send-email-evil.dani@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Daniel Castro List-Id: xen-devel@lists.xenproject.org Added support for hvm_op and hvm_params hypercalls. Signed-off-by: Daniel Castro --- src/xen.h | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/src/xen.h b/src/xen.h index b6b72b9..9e218fc 100644 --- a/src/xen.h +++ b/src/xen.h @@ -188,6 +188,33 @@ __DEFINE_XEN_GUEST_HANDLE(u32, u32); #define __HYPERVISOR_xen_version 17 #define __HYPERVISOR_event_channel_op 32 +#define __HYPERVISOR_hvm_op 34 + +/* + * from: xen/include/public/hvm/hvm_op.h + */ + +/* + * in an HVM guest you find your xenstore ring and evtchn via hvmparams, + * HVM_PARAM_STORE_PFN and HVM_PARAM_STORE_EVTCHN. + * it's a hypercall (type) hvmop, subcommand HVMOP_get_param (this is the hypercall actually) with this: + * Get/set subcommands: extra argument == pointer to xen_hvm_param struct. +*/ +#define HVMOP_set_param 0 +#define HVMOP_get_param 1 + +/* + * from: include/public/hvm/params.h + */ + +#define HVM_PARAM_STORE_PFN 1 //pass as index +#define HVM_PARAM_STORE_EVTCHN 2 //pass as index + +struct xen_hvm_param { + u32 domid; //IN + u32 index; //IN + u64 value; //IN/OUT +}; /****************************************************************************** * event_channel.h @@ -210,6 +237,10 @@ typedef struct evtchn_send evtchn_send_t; /* * Wrappers for hypercalls */ +static inline int hypercall_hvm_op(int cmd, void *arg) +{ + return _hypercall2(int, hvm_op, cmd, arg); +} static inline int hypercall_event_channel_op(int cmd, void *arg) { return _hypercall2(int, event_channel_op, cmd, arg); -- 1.7.4.1