summaryrefslogtreecommitdiff
path: root/emulators/qemu/patches/patch-target-i386_bpt__helper.c
diff options
context:
space:
mode:
authorspz <spz>2017-03-04 15:11:10 +0000
committerspz <spz>2017-03-04 15:11:10 +0000
commitd243c2bde138755110ae20bab1ad18e60fc962f1 (patch)
tree12cbff8a25f5575cd9e95f2a00ee1616d928b0ad /emulators/qemu/patches/patch-target-i386_bpt__helper.c
parent3ee05f4b06e52dbfbb4f5280bc8a278b17423446 (diff)
downloadpkgsrc-d243c2bde138755110ae20bab1ad18e60fc962f1.tar.gz
Fix qemu/amd64 gub regarding signal4
Closes PR port-amd64/51934 thanks to hannken@ for the pointer to the upstream fixes
Diffstat (limited to 'emulators/qemu/patches/patch-target-i386_bpt__helper.c')
-rw-r--r--emulators/qemu/patches/patch-target-i386_bpt__helper.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/emulators/qemu/patches/patch-target-i386_bpt__helper.c b/emulators/qemu/patches/patch-target-i386_bpt__helper.c
new file mode 100644
index 00000000000..b10e1165be3
--- /dev/null
+++ b/emulators/qemu/patches/patch-target-i386_bpt__helper.c
@@ -0,0 +1,31 @@
+$NetBSD: patch-target-i386_bpt__helper.c,v 1.1 2017/03/04 15:11:11 spz Exp $
+
+from upstream:
+ commit c52ab08aee6f7d4717fc6b517174043126bd302f
+ Author: Doug Evans <dje@google.com>
+ Date: Tue Dec 6 23:06:30 2016 +0000
+
+ target-i386: Fix eflags.TF/#DB handling of syscall/sysret insns
+
+ The syscall and sysret instructions behave a bit differently:
+ TF is checked after the instruction completes.
+ This allows the o/s to disable #DB at a syscall by adding TF to FMASK.
+ And then when the sysret is executed the #DB is taken "as if" the
+ syscall insn just completed.
+
+--- target-i386/bpt_helper.c.orig 2016-12-20 20:16:49.000000000 +0000
++++ target-i386/bpt_helper.c 2017-03-03 04:30:46.000000000 +0000
+@@ -244,6 +244,13 @@ void helper_single_step(CPUX86State *env
+ raise_exception(env, EXCP01_DB);
+ }
+
++void helper_rechecking_single_step(CPUX86State *env)
++{
++ if ((env->eflags & TF_MASK) != 0) {
++ helper_single_step(env);
++ }
++}
++
+ void helper_set_dr(CPUX86State *env, int reg, target_ulong t0)
+ {
+ #ifndef CONFIG_USER_ONLY