aboutsummaryrefslogtreecommitdiff
path: root/target/i386/bpt_helper.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2016-12-06 23:06:30 +0000
committerPaolo Bonzini <pbonzini@redhat.com>2016-12-22 16:01:04 +0100
commitc52ab08aee6f7d4717fc6b517174043126bd302f (patch)
tree59715b2881805e60a3e12b49083c08faba7efaff /target/i386/bpt_helper.c
parent6053a86fe7bd3d5b07b49dae6c05f2cd0d44e687 (diff)
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. Signed-off-by: Doug Evans <dje@google.com> Message-Id: <94eb2c0bfa1c6a9fec0543057483@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/bpt_helper.c')
-rw-r--r--target/i386/bpt_helper.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/target/i386/bpt_helper.c b/target/i386/bpt_helper.c
index 6fd7fe04a0..b3efdc77ec 100644
--- a/target/i386/bpt_helper.c
+++ b/target/i386/bpt_helper.c
@@ -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