aboutsummaryrefslogtreecommitdiff
path: root/target-i386/bpt_helper.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2015-09-15 11:45:11 -0700
committerEduardo Habkost <ehabkost@redhat.com>2015-10-23 12:59:27 -0200
commit7525b55051277717329cf64a9e1d5cff840d6f38 (patch)
tree26196a6e11cec81cdd6cf603d02e45e2ac8febcf /target-i386/bpt_helper.c
parent696ad9e4b27a49a9706010d00b31b17fe1f0d569 (diff)
target-i386: Optimize setting dr[0-3]
If the debug register is not enabled, we need do nothing besides update the register. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'target-i386/bpt_helper.c')
-rw-r--r--target-i386/bpt_helper.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/target-i386/bpt_helper.c b/target-i386/bpt_helper.c
index ca58ab78c7..7ff41a6c97 100644
--- a/target-i386/bpt_helper.c
+++ b/target-i386/bpt_helper.c
@@ -228,9 +228,14 @@ void helper_movl_drN_T0(CPUX86State *env, int reg, target_ulong t0)
{
#ifndef CONFIG_USER_ONLY
if (reg < 4) {
- hw_breakpoint_remove(env, reg);
- env->dr[reg] = t0;
- hw_breakpoint_insert(env, reg);
+ if (hw_breakpoint_enabled(env->dr[7], reg)
+ && hw_breakpoint_type(env->dr[7], reg) != DR7_TYPE_IO_RW) {
+ hw_breakpoint_remove(env, reg);
+ env->dr[reg] = t0;
+ hw_breakpoint_insert(env, reg);
+ } else {
+ env->dr[reg] = t0;
+ }
} else if (reg == 7) {
cpu_x86_update_dr7(env, t0);
} else {