All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: qemu-devel@nongnu.org
Cc: Jocelyn Mayer <l_indien@magic.fr>
Subject: [Qemu-devel] [PATCH] fix crash in set registers in PPC gdb-stub
Date: Fri, 29 Jun 2007 07:53:29 -0500	[thread overview]
Message-ID: <468500C9.3040503@windriver.com> (raw)

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

While using the gdb stub on the PPC target you cannot set registers if 
the machine has the power save bit set in the msr without crashing 
QEMU.  The reason it crashes is because the cpu_loop_exit() function 
will get called when the gdb stub is setting the registers. 

There is certainly more than one way to fix problem.  I opted to add the 
check for the halted state to the store msr routine which is called from 
the the translated code or the gdb stub.  The halted state is always set 
when the stub is active.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

Jason.



[-- Attachment #2: ppc_gdb_msr_fix.patch --]
[-- Type: text/x-patch, Size: 711 bytes --]

---
 target-ppc/helper.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Index: qemu/target-ppc/helper.c
===================================================================
--- qemu.orig/target-ppc/helper.c
+++ qemu/target-ppc/helper.c
@@ -1493,10 +1493,12 @@ void do_store_msr (CPUPPCState *env, tar
         break;
     }
     if (enter_pm) {
-        /* power save: exit cpu loop */
-        env->halted = 1;
-        env->exception_index = EXCP_HLT;
-        cpu_loop_exit();
+        if (likely(!env->halted)) {
+            /* power save: exit cpu loop */
+            env->halted = 1;
+            env->exception_index = EXCP_HLT;
+            cpu_loop_exit();
+        }
     }
 }
 

                 reply	other threads:[~2007-06-29 12:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=468500C9.3040503@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=l_indien@magic.fr \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.