Skip to contentSkip to conversation

Patch: fix init of old_exception

Qemu-devel Bernhard Kauer 1 participant 1 message Jul 31, 2007

lore
Share & tools
lore
#0 lore raw

The old_exception field is initialized on startup with 0. Therefore the very first fault (e.g. #GP) could be converted to a double fault on an application processor. The attached patch initialize old_exception on every CPU reset with -1.

Bernhard Kauer

Index: target-i386/helper2.c
===================================================================
RCS file: /sources/qemu/qemu/target-i386/helper2.c,v retrieving revision 1.47

helper2.c +2 -0
diff -u -r1.47 helper2.c
@@ -155,6 +155,8 @@
 
     tlb_flush(env, 1);
 
+    env->old_exception = -1;
+
     /* init to reset state */
 
 #ifdef CONFIG_SOFTMMU