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 <jinsong.liu@intel.com> diff -r 86defe150053 tools/tests/mce-test/tools/xen-mceinj.c --- a/tools/tests/mce-test/tools/xen-mceinj.c Fri Dec 16 16:24:31 2011 +0800 +++ b/tools/tests/mce-test/tools/xen-mceinj.c Fri Dec 16 17:28:38 2011 +0800 @@ -134,8 +134,12 @@ static int mca_cpuinfo(xc_interface *xc_ { 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; _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
>>> On 16.12.11 at 12:47, "Liu, Jinsong" <jinsong.liu@intel.com> wrote: > 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 <jinsong.liu@intel.com> > > diff -r 86defe150053 tools/tests/mce-test/tools/xen-mceinj.c > --- a/tools/tests/mce-test/tools/xen-mceinj.c Fri Dec 16 16:24:31 2011 +0800 > +++ b/tools/tests/mce-test/tools/xen-mceinj.c Fri Dec 16 17:28:38 2011 +0800 > @@ -134,8 +134,12 @@ static int mca_cpuinfo(xc_interface *xc_ > { > struct xen_mc mc; > > + memset(&mc, 0, sizeof(struct xen_mc));I doubt this is really needed.> + > mc.cmd = XEN_MC_physcpuinfo; > - if (xc_mca_op(xc_handle, &mc)) > + mc.interface_version = XEN_MCA_INTERFACE_VERSION;Wouldn''t this rather belong into xc_mca_op()? Jan> + > + if (!xc_mca_op(xc_handle, &mc)) > return mc.u.mc_physcpuinfo.ncpus; > else > return 0;
>> mca_cpuinfo(xc_interface *xc_ { struct xen_mc mc; >> >> + memset(&mc, 0, sizeof(struct xen_mc)); > > I doubt this is really needed. > >> + >> mc.cmd = XEN_MC_physcpuinfo; >> - if (xc_mca_op(xc_handle, &mc)) >> + mc.interface_version = XEN_MCA_INTERFACE_VERSION; > > Wouldn''t this rather belong into xc_mca_op()? > > Jan >Yes, not necessary, update as attached. Thanks, Jinsong =================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 <jinsong.liu@intel.com> diff -r 86defe150053 tools/tests/mce-test/tools/xen-mceinj.c --- a/tools/tests/mce-test/tools/xen-mceinj.c Fri Dec 16 16:24:31 2011 +0800 +++ b/tools/tests/mce-test/tools/xen-mceinj.c Fri Dec 16 22:33:26 2011 +0800 @@ -135,7 +135,7 @@ static int mca_cpuinfo(xc_interface *xc_ struct xen_mc mc; mc.cmd = XEN_MC_physcpuinfo; - if (xc_mca_op(xc_handle, &mc)) + if (!xc_mca_op(xc_handle, &mc)) return mc.u.mc_physcpuinfo.ncpus; else return 0; _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
>>> On 16.12.11 at 15:55, "Liu, Jinsong" <jinsong.liu@intel.com> wrote: > 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 <jinsong.liu@intel.com>Acked-by: Jan Beulich <jbeulich@suse.com>> diff -r 86defe150053 tools/tests/mce-test/tools/xen-mceinj.c > --- a/tools/tests/mce-test/tools/xen-mceinj.c Fri Dec 16 16:24:31 2011 +0800 > +++ b/tools/tests/mce-test/tools/xen-mceinj.c Fri Dec 16 22:33:26 2011 +0800 > @@ -135,7 +135,7 @@ static int mca_cpuinfo(xc_interface *xc_ > struct xen_mc mc; > > mc.cmd = XEN_MC_physcpuinfo; > - if (xc_mca_op(xc_handle, &mc)) > + if (!xc_mca_op(xc_handle, &mc)) > return mc.u.mc_physcpuinfo.ncpus; > else > return 0;