qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH v3 5/9] target-i386: Optimize setting dr[0-3]
Date: Mon, 19 Oct 2015 15:40:06 -0200	[thread overview]
Message-ID: <1445276410-5031-6-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1445276410-5031-1-git-send-email-ehabkost@redhat.com>

From: Richard Henderson <rth@twiddle.net>

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>
---
 target-i386/bpt_helper.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/target-i386/bpt_helper.c b/target-i386/bpt_helper.c
index ca58ab7..7ff41a6 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 {
-- 
2.1.0

  parent reply	other threads:[~2015-10-19 17:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19 17:40 [Qemu-devel] [PATCH v3 0/9] target-i386: Implement debug extensions Eduardo Habkost
2015-10-19 17:40 ` [Qemu-devel] [PATCH v3 1/9] target-i386: Introduce cpu_x86_update_dr7 Eduardo Habkost
2015-10-19 17:40 ` [Qemu-devel] [PATCH v3 2/9] target-i386: Re-introduce optimal breakpoint removal Eduardo Habkost
2015-10-19 17:40 ` [Qemu-devel] [PATCH v3 3/9] target-i386: Ensure bit 10 on DR7 is never cleared Eduardo Habkost
2015-10-19 17:44   ` Richard Henderson
2015-10-19 17:40 ` [Qemu-devel] [PATCH v3 4/9] target-i386: Move hw_*breakpoint_* functions Eduardo Habkost
2015-10-19 17:40 ` Eduardo Habkost [this message]
2015-10-19 17:40 ` [Qemu-devel] [PATCH v3 6/9] target-i386: Handle I/O breakpoints Eduardo Habkost
2015-10-19 17:40 ` [Qemu-devel] [PATCH v3 7/9] target-i386: Check CR4[DE] for processing DR4/DR5 Eduardo Habkost
2015-10-19 17:40 ` [Qemu-devel] [PATCH v3 8/9] target-i386: Ensure always-1 bits on DR6 can't be cleared Eduardo Habkost
2015-10-19 17:40 ` [Qemu-devel] [PATCH v3 9/9] target-i386: Add DE to TCG_FEATURES Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1445276410-5031-6-git-send-email-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).