Patchwork [03/35] x86: Account for MCE in cpu_has_work

login
register
mail settings
Submitter Marcelo Tosatti
Date March 15, 2011, 9:50 p.m.
Message ID <ac098781583bb1ca8369b5bd81fa5fbafa86231c.1300225848.git.mtosatti@redhat.com>
Download mbox | patch
Permalink /patch/87120/
State New
Headers show

Comments

Marcelo Tosatti - March 15, 2011, 9:50 p.m.
From: Jan Kiszka <jan.kiszka@siemens.com>

MCEs can be injected asynchronously, so they can also terminate the halt
state.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
CC: Huang Ying <ying.huang@intel.com>
CC: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
CC: Jin Dongming <jin.dongming@np.css.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
---
 target-i386/exec.h |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

Patch

diff --git a/target-i386/exec.h b/target-i386/exec.h
index 3e7386e..6f9f709 100644
--- a/target-i386/exec.h
+++ b/target-i386/exec.h
@@ -293,15 +293,12 @@  static inline void load_eflags(int eflags, int update_mask)
 
 static inline int cpu_has_work(CPUState *env)
 {
-    int work;
-
-    work = (env->interrupt_request & CPU_INTERRUPT_HARD) &&
-           (env->eflags & IF_MASK);
-    work |= env->interrupt_request & CPU_INTERRUPT_NMI;
-    work |= env->interrupt_request & CPU_INTERRUPT_INIT;
-    work |= env->interrupt_request & CPU_INTERRUPT_SIPI;
-
-    return work;
+    return ((env->interrupt_request & CPU_INTERRUPT_HARD) &&
+            (env->eflags & IF_MASK)) ||
+           (env->interrupt_request & (CPU_INTERRUPT_NMI |
+                                      CPU_INTERRUPT_INIT |
+                                      CPU_INTERRUPT_SIPI |
+                                      CPU_INTERRUPT_MCE));
 }
 
 /* load efer and update the corresponding hflags. XXX: do consistency