All of lore.kernel.org
 help / color / mirror / Atom feed
* X86-MCE: fix a bug of xen-mceinj tool
@ 2011-12-16 11:47 Liu, Jinsong
  2011-12-16 13:00 ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Liu, Jinsong @ 2011-12-16 11:47 UTC (permalink / raw)
  To: Jan Beulich, keir.xen, xen-devel

[-- Attachment #1: Type: text/plain, Size: 770 bytes --]

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;

[-- Attachment #2: mceinj-tools-fix.patch --]
[-- Type: application/octet-stream, Size: 749 bytes --]

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;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: X86-MCE: fix a bug of xen-mceinj tool
  2011-12-16 11:47 X86-MCE: fix a bug of xen-mceinj tool Liu, Jinsong
@ 2011-12-16 13:00 ` Jan Beulich
  2011-12-16 14:55   ` Liu, Jinsong
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2011-12-16 13:00 UTC (permalink / raw)
  To: Jinsong Liu; +Cc: keir.xen, 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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: X86-MCE: fix a bug of xen-mceinj tool
  2011-12-16 13:00 ` Jan Beulich
@ 2011-12-16 14:55   ` Liu, Jinsong
  2011-12-16 15:26     ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Liu, Jinsong @ 2011-12-16 14:55 UTC (permalink / raw)
  To: Jan Beulich; +Cc: keir.xen, xen-devel

[-- Attachment #1: Type: text/plain, Size: 1109 bytes --]

>>      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;

[-- Attachment #2: mceinj-tools-fix.patch --]
[-- Type: application/octet-stream, Size: 642 bytes --]

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;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: X86-MCE: fix a bug of xen-mceinj tool
  2011-12-16 14:55   ` Liu, Jinsong
@ 2011-12-16 15:26     ` Jan Beulich
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2011-12-16 15:26 UTC (permalink / raw)
  To: Ian Jackson, Jinsong Liu; +Cc: keir.xen, 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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-12-16 15:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-16 11:47 X86-MCE: fix a bug of xen-mceinj tool Liu, Jinsong
2011-12-16 13:00 ` Jan Beulich
2011-12-16 14:55   ` Liu, Jinsong
2011-12-16 15:26     ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.