From e9d9ed5eaac94c3e10b3a3afe2da7deaf0f32f44 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 12 Mar 2018 13:28:49 -0400 Subject: [PATCH] target/i386/bpt_helper: Perform comparison pass with qemu Keep formatting and code in sync where applicable --- qemu/target/i386/bpt_helper.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qemu/target/i386/bpt_helper.c b/qemu/target/i386/bpt_helper.c index 205f580f..14fcdc7a 100644 --- a/qemu/target/i386/bpt_helper.c +++ b/qemu/target/i386/bpt_helper.c @@ -138,16 +138,16 @@ void cpu_x86_update_dr7(CPUX86State *env, uint32_t new_dr7) for (i = 0; i < DR7_MAX_BP; i++) { if ((mod & (2 << i * 2)) && !hw_breakpoint_enabled(new_dr7, i)) { - iobpt |= hw_breakpoint_insert(env, i); - } else if (hw_breakpoint_type(new_dr7, i) == DR7_TYPE_IO_RW - && hw_breakpoint_enabled(new_dr7, i)) { - iobpt |= HF_IOBPT_MASK; + hw_breakpoint_remove(env, i); } } env->dr[7] = new_dr7; for (i = 0; i < DR7_MAX_BP; i++) { if (mod & (2 << i * 2) && hw_breakpoint_enabled(new_dr7, i)) { - hw_breakpoint_insert(env, i); + iobpt |= hw_breakpoint_insert(env, i); + } else if (hw_breakpoint_type(new_dr7, i) == DR7_TYPE_IO_RW + && hw_breakpoint_enabled(new_dr7, i)) { + iobpt |= HF_IOBPT_MASK; } } } else { @@ -270,7 +270,7 @@ void helper_set_dr(CPUX86State *env, int reg, target_ulong t0) } /* fallthru */ case 6: - env->dr[6] = t0; + env->dr[6] = t0 | DR6_FIXED_1; return; case 5: if (env->cr[4] & CR4_DE_MASK) {