I was playing with gpm (mouse daemon) in Linux guest and apparently my
gpm binary is broken and with the "ps2" plugin it segfaults because of
a general protection fault when trying to load a quadword from the
address 0xff00000000000000. Under qemu as well as on the my physical
amd64 it just segfaults, but under kqemu if makes kqemu panic and qemu
aborts. Attached is a patch to make kqemu pass the gpf to qemu. It's
probably wrong but it gives identical behaviour as with -no-kqemu or
as on physical cpu, in this case.

Regards
diff --git a/common/kqemu_int.h b/common/kqemu_int.h
index d881d85..cdb3a73 100644
--- a/common/kqemu_int.h
+++ b/common/kqemu_int.h
@@ -1065,11 +1065,17 @@ static inline void stq_fast(struct kqemu_state *s, unsigned long addr,
 #define MMU_EXCEPTION(label) \
     ".section \"mmu_ex_table\", \"a\"\n"\
     ".quad " #label "\n"\
+    ".previous\n"\
+    ".section \"seg_ex_table\", \"a\"\n"\
+    ".quad " #label "\n"\
     ".previous\n"
 #else
 #define MMU_EXCEPTION(label) \
     ".section \"mmu_ex_table\", \"a\"\n"\
     ".long " #label "\n"\
+    ".previous\n"\
+    ".section \"seg_ex_table\", \"a\"\n"\
+    ".long " #label "\n"\
     ".previous\n"
 #endif
 

Reply via email to