diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-02-03 09:38:57 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-02-03 09:38:57 +0000 |
commit | 049ad7d34ef8b54b1fea42d50d235b1c0608de70 (patch) | |
tree | bf2435e63f4ed4331c40294c72380a3481a38151 /tools/libxc/xc_misc.c | |
parent | a90054b38b707d1a02d903c72b2484882377a2bc (diff) | |
download | xen-049ad7d34ef8b54b1fea42d50d235b1c0608de70.tar.gz xen-049ad7d34ef8b54b1fea42d50d235b1c0608de70.tar.bz2 xen-049ad7d34ef8b54b1fea42d50d235b1c0608de70.zip |
libxc: Export do_mca hypercall to user space tools.
This is mainly for software trigger MCE operation, so that test suites
can trigger software MCE.
Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
Diffstat (limited to 'tools/libxc/xc_misc.c')
-rw-r--r-- | tools/libxc/xc_misc.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c index 04da3d2a3f..317cfe1c16 100644 --- a/tools/libxc/xc_misc.c +++ b/tools/libxc/xc_misc.c @@ -96,6 +96,27 @@ int xc_sched_id(int xc_handle, return 0; } +#if defined(__i386__) || defined(__x86_64__) +int xc_mca_op(int xc_handle, struct xen_mc *mc) +{ + int ret = 0; + DECLARE_HYPERCALL; + + mc->interface_version = XEN_MCA_INTERFACE_VERSION; + if ( lock_pages(mc, sizeof(mc)) ) + { + PERROR("Could not lock xen_mc memory\n"); + return -EINVAL; + } + + hypercall.op = __HYPERVISOR_mca; + hypercall.arg[0] = (unsigned long)mc; + ret = do_xen_hypercall(xc_handle, &hypercall); + unlock_pages(mc, sizeof(mc)); + return ret; +} +#endif + int xc_perfc_control(int xc_handle, uint32_t opcode, xc_perfc_desc_t *desc, |