qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: TeLeMan <geleman@gmail.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [FOR 0.12][PATCH] target-i386: Fix evaluation of DR7 register
Date: Tue, 15 Dec 2009 10:07:58 +0800	[thread overview]
Message-ID: <a38b25540912141807s16ff3625me02a74422bbfeb02@mail.gmail.com> (raw)
In-Reply-To: <4B2620E3.2050604@siemens.com>

[-- Attachment #1: Type: text/plain, Size: 153 bytes --]

raise_exception() in op_helper.c should not be used outside
op_helper.c because of tcg. This patch uses raise_exception2() instead
of raise_exception().

[-- Attachment #2: target-i386-fix-raise_exception-for-hw-breakpoints.patch --]
[-- Type: application/octet-stream, Size: 1896 bytes --]

From: TeLeMan <geleman@gmail.com>
Subject: [PATCH] target-i386: fix raise_exception for hw breakpoints

---
 target-i386/helper.c    |    6 +++---
 target-i386/op_helper.c |    6 ++++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/target-i386/helper.c b/target-i386/helper.c
index da36a01..4ee7c4a 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1590,7 +1590,7 @@ int check_hw_breakpoints(CPUState *env, int force_dr6_update)
 
 static CPUDebugExcpHandler *prev_debug_excp_handler;
 
-void raise_exception(int exception_index);
+void raise_exception2(CPUState *env1, int exception_index);
 
 static void breakpoint_handler(CPUState *env)
 {
@@ -1600,7 +1600,7 @@ static void breakpoint_handler(CPUState *env)
         if (env->watchpoint_hit->flags & BP_CPU) {
             env->watchpoint_hit = NULL;
             if (check_hw_breakpoints(env, 0))
-                raise_exception(EXCP01_DB);
+                raise_exception2(env, EXCP01_DB);
             else
                 cpu_resume_from_signal(env, NULL);
         }
@@ -1609,7 +1609,7 @@ static void breakpoint_handler(CPUState *env)
             if (bp->pc == env->eip) {
                 if (bp->flags & BP_CPU) {
                     check_hw_breakpoints(env, 1);
-                    raise_exception(EXCP01_DB);
+                    raise_exception2(env, EXCP01_DB);
                 }
                 break;
             }
diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
index 4f3ed57..f2e2f6d 100644
--- a/target-i386/op_helper.c
+++ b/target-i386/op_helper.c
@@ -1351,6 +1351,12 @@ void raise_exception(int exception_index)
     raise_interrupt(exception_index, 0, 0, 0);
 }
 
+void raise_exception2(CPUState *env1, int exception_index)
+{
+    env = env1;
+    raise_exception(exception_index);
+}
+
 /* SMM support */
 
 #if defined(CONFIG_USER_ONLY)
-- 
1.6.5.1.1367.gcd48


  reply	other threads:[~2009-12-15  2:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-14 11:26 [Qemu-devel] [FOR 0.12][PATCH] target-i386: Fix evaluation of DR7 register Jan Kiszka
2009-12-15  2:07 ` TeLeMan [this message]
2009-12-15 23:21   ` [Qemu-devel] " Jan Kiszka
2009-12-16  0:28     ` TeLeMan
2009-12-16  0:41       ` Jan Kiszka

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=a38b25540912141807s16ff3625me02a74422bbfeb02@mail.gmail.com \
    --to=geleman@gmail.com \
    --cc=aliguori@us.ibm.com \
    --cc=jan.kiszka@siemens.com \
    --cc=qemu-devel@nongnu.org \
    /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).