xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: handle both NMI kinds if they occur simultaneously
@ 2013-01-17 10:28 Jan Beulich
  2013-01-17 11:26 ` Andrew Cooper
  2013-01-17 11:48 ` Keir Fraser
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2013-01-17 10:28 UTC (permalink / raw)
  To: xen-devel

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

We shouldn't assume PCI SERR excludes IOCHK.

Once at it, also remove the doubly redundant range restriction on
"reason" - the variable already is "unsigned char".

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3201,10 +3201,10 @@ void do_nmi(struct cpu_user_regs *regs)
         reason = inb(0x61);
         if ( reason & 0x80 )
             pci_serr_error(regs);
-        else if ( reason & 0x40 )
+        if ( reason & 0x40 )
             io_check_error(regs);
-        else if ( !nmi_watchdog )
-            unknown_nmi_error(regs, (unsigned char)(reason&0xff));
+        if ( !(reason & 0xc0) && !nmi_watchdog )
+            unknown_nmi_error(regs, reason);
     }
 }
 




[-- Attachment #2: x86-forward-both-NMI-kinds.patch --]
[-- Type: text/plain, Size: 818 bytes --]

x86: handle both NMI kinds if they occur simultaneously

We shouldn't assume PCI SERR excludes IOCHK.

Once at it, also remove the doubly redundant range restriction on
"reason" - the variable already is "unsigned char".

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3201,10 +3201,10 @@ void do_nmi(struct cpu_user_regs *regs)
         reason = inb(0x61);
         if ( reason & 0x80 )
             pci_serr_error(regs);
-        else if ( reason & 0x40 )
+        if ( reason & 0x40 )
             io_check_error(regs);
-        else if ( !nmi_watchdog )
-            unknown_nmi_error(regs, (unsigned char)(reason&0xff));
+        if ( !(reason & 0xc0) && !nmi_watchdog )
+            unknown_nmi_error(regs, reason);
     }
 }
 

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

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

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

* Re: [PATCH] x86: handle both NMI kinds if they occur simultaneously
  2013-01-17 10:28 [PATCH] x86: handle both NMI kinds if they occur simultaneously Jan Beulich
@ 2013-01-17 11:26 ` Andrew Cooper
  2013-01-17 11:48 ` Keir Fraser
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2013-01-17 11:26 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel

On 17/01/13 10:28, Jan Beulich wrote:
> We shouldn't assume PCI SERR excludes IOCHK.
>
> Once at it, also remove the doubly redundant range restriction on
> "reason" - the variable already is "unsigned char".
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

I am soon to embark on some work to do with NMI buttons, and was already
planning to make alterations along these lines as part of that work, so
for what it is worth,

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- a/xen/arch/x86/traps.c
> +++ b/xen/arch/x86/traps.c
> @@ -3201,10 +3201,10 @@ void do_nmi(struct cpu_user_regs *regs)
>          reason = inb(0x61);
>          if ( reason & 0x80 )
>              pci_serr_error(regs);
> -        else if ( reason & 0x40 )
> +        if ( reason & 0x40 )
>              io_check_error(regs);
> -        else if ( !nmi_watchdog )
> -            unknown_nmi_error(regs, (unsigned char)(reason&0xff));
> +        if ( !(reason & 0xc0) && !nmi_watchdog )
> +            unknown_nmi_error(regs, reason);
>      }
>  }
>  
>
>
>

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

* Re: [PATCH] x86: handle both NMI kinds if they occur simultaneously
  2013-01-17 10:28 [PATCH] x86: handle both NMI kinds if they occur simultaneously Jan Beulich
  2013-01-17 11:26 ` Andrew Cooper
@ 2013-01-17 11:48 ` Keir Fraser
  1 sibling, 0 replies; 3+ messages in thread
From: Keir Fraser @ 2013-01-17 11:48 UTC (permalink / raw)
  To: Jan Beulich, xen-devel

On 17/01/2013 10:28, "Jan Beulich" <JBeulich@suse.com> wrote:

> We shouldn't assume PCI SERR excludes IOCHK.
> 
> Once at it, also remove the doubly redundant range restriction on
> "reason" - the variable already is "unsigned char".
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- a/xen/arch/x86/traps.c
> +++ b/xen/arch/x86/traps.c
> @@ -3201,10 +3201,10 @@ void do_nmi(struct cpu_user_regs *regs)
>          reason = inb(0x61);
>          if ( reason & 0x80 )
>              pci_serr_error(regs);
> -        else if ( reason & 0x40 )
> +        if ( reason & 0x40 )
>              io_check_error(regs);
> -        else if ( !nmi_watchdog )
> -            unknown_nmi_error(regs, (unsigned char)(reason&0xff));
> +        if ( !(reason & 0xc0) && !nmi_watchdog )
> +            unknown_nmi_error(regs, reason);
>      }
>  }
>  
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

end of thread, other threads:[~2013-01-17 11:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-17 10:28 [PATCH] x86: handle both NMI kinds if they occur simultaneously Jan Beulich
2013-01-17 11:26 ` Andrew Cooper
2013-01-17 11:48 ` Keir Fraser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).