WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Export mca_op to user space tools

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Export mca_op to user space tools
From: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Date: Mon, 1 Feb 2010 17:36:18 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 01 Feb 2010 01:36:45 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcqjIgFyEekwMgZ3R6+0bN00gi80AQ==
Thread-topic: [PATCH] Export mca_op to user space tools
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@xxxxxxxxx>

--- a/tools/libxc/xc_private.c  Sun Jan 31 20:25:54 2010 +0800
+++ b/tools/libxc/xc_private.c  Sun Jan 31 20:30:25 2010 +0800
@@ -242,6 +242,25 @@ void hcall_buf_release(void **addr, size
 }
 
 #endif
+
+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;
+}
 
 /* NB: arr must be locked */
 int xc_get_pfn_type_batch(int xc_handle, uint32_t dom,
--- a/tools/libxc/xenctrl.h     Sun Jan 31 20:25:54 2010 +0800
+++ b/tools/libxc/xenctrl.h     Sun Jan 31 20:26:01 2010 +0800
@@ -37,6 +37,7 @@
 #if defined(__i386__) || defined(__x86_64__)
 #include <xen/foreign/x86_32.h>
 #include <xen/foreign/x86_64.h>
+#include <xen/arch-x86/xen-mca.h>
 #endif
 
 #ifdef __ia64__
@@ -799,6 +800,7 @@ long xc_get_max_pages(int xc_handle, uin
 
 int xc_mmuext_op(int xc_handle, struct mmuext_op *op, unsigned int nr_ops,
                  domid_t dom);
+int xc_mca_op(int xc_handle, struct xen_mc *mc);
 
 int xc_memory_op(int xc_handle, int cmd, void *arg);
 


Attachment: export_mcaop.patch
Description: export_mcaop.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>