From 9ff59ff11997ff22cbccfcffd00a6a35d012d38d Mon Sep 17 00:00:00 2001 From: "Liu, Jinsong" Date: Sun, 18 Dec 2011 14:40:00 +0000 Subject: X86-MCE: fix a bug of xen-mceinj tool Fix a bug of xen-mceinj tool which used to test mce by software way. Signed-off-by: Liu, Jinsong Committed-by: Keir Fraser --- tools/tests/mce-test/tools/xen-mceinj.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools/tests') diff --git a/tools/tests/mce-test/tools/xen-mceinj.c b/tools/tests/mce-test/tools/xen-mceinj.c index 1ca5c8c03c..4d72fe82ad 100644 --- a/tools/tests/mce-test/tools/xen-mceinj.c +++ b/tools/tests/mce-test/tools/xen-mceinj.c @@ -134,8 +134,12 @@ static int mca_cpuinfo(xc_interface *xc_handle) { struct xen_mc mc; + memset(&mc, 0, sizeof(struct xen_mc)); + mc.cmd = XEN_MC_physcpuinfo; - if (xc_mca_op(xc_handle, &mc)) + mc.interface_version = XEN_MCA_INTERFACE_VERSION; + + if (!xc_mca_op(xc_handle, &mc)) return mc.u.mc_physcpuinfo.ncpus; else return 0; -- cgit v1.2.3