qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ARM: ldrex/strex only valid v6
@ 2008-05-25  9:51 Adam Lackorzynski
  2008-05-25 11:18 ` Laurent Desnogues
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Lackorzynski @ 2008-05-25  9:51 UTC (permalink / raw)
  To: qemu-devel

Hi,

ldrex and strex are only valid instructions for v6 and up.


Index: target-arm/translate.c
===================================================================
--- target-arm/translate.c	(revision 4571)
+++ target-arm/translate.c	(working copy)
@@ -6221,6 +6221,7 @@
                     rd = (insn >> 12) & 0xf;
                     if (insn & (1 << 23)) {
                         /* load/store exclusive */
+                        ARCH(6);
                         gen_movl_T1_reg(s, rn);
                         addr = cpu_T[1];
                         if (insn & (1 << 20)) {

Adam
-- 
Adam                 adam@os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] ARM: ldrex/strex only valid v6
  2008-05-25  9:51 [Qemu-devel] [PATCH] ARM: ldrex/strex only valid v6 Adam Lackorzynski
@ 2008-05-25 11:18 ` Laurent Desnogues
  2008-05-26  7:54   ` Adam Lackorzynski
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Desnogues @ 2008-05-25 11:18 UTC (permalink / raw)
  To: qemu-devel

On Sun, May 25, 2008 at 11:51 AM, Adam Lackorzynski
<adam@os.inf.tu-dresden.de> wrote:
>
> ldrex and strex are only valid instructions for v6 and up.

There are many other places in translate.c that deal with the various
ldrex/strex instructions.  Some are v6, some others are v6K, some
are v6T2 and some are v7.  Did you check all of them? :-)


Laurent

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] ARM: ldrex/strex only valid v6
  2008-05-25 11:18 ` Laurent Desnogues
@ 2008-05-26  7:54   ` Adam Lackorzynski
  0 siblings, 0 replies; 3+ messages in thread
From: Adam Lackorzynski @ 2008-05-26  7:54 UTC (permalink / raw)
  To: qemu-devel


On Sun May 25, 2008 at 13:18:07 +0200, Laurent Desnogues wrote:
> On Sun, May 25, 2008 at 11:51 AM, Adam Lackorzynski
> <adam@os.inf.tu-dresden.de> wrote:
> >
> > ldrex and strex are only valid instructions for v6 and up.
> 
> There are many other places in translate.c that deal with the various
> ldrex/strex instructions.  Some are v6, some others are v6K, some
> are v6T2 and some are v7.  Did you check all of them? :-)

No, that's just the one I stumbled upon. This should be better but I
probably didn't catch all of them.

Index: target-arm/translate.c
===================================================================
--- target-arm/translate.c	(revision 4586)
+++ target-arm/translate.c	(working copy)
@@ -6221,6 +6221,7 @@
                     rd = (insn >> 12) & 0xf;
                     if (insn & (1 << 23)) {
                         /* load/store exclusive */
+                        ARCH(6);
                         gen_movl_T1_reg(s, rn);
                         addr = cpu_T[1];
                         if (insn & (1 << 20)) {
@@ -6973,6 +6974,7 @@
                 }
             } else if ((insn & (1 << 23)) == 0) {
                 /* Load/store exclusive word.  */
+                ARCH(6);
                 gen_movl_T1_reg(s, rn);
                 addr = cpu_T[1];
                 if (insn & (1 << 20)) {
@@ -7017,6 +7019,7 @@
                 /* ??? These are not really atomic.  However we know
                    we never have multiple CPUs running in parallel,
                    so it is good enough.  */
+                ARCH(6);
                 op = (insn >> 4) & 0x3;
                 /* Must use a global reg for the address because we have
                    a conditional branch in the store instruction.  */
@@ -7070,6 +7073,7 @@
         } else {
             /* Load/store multiple, RFE, SRS.  */
             if (((insn >> 23) & 1) == ((insn >> 24) & 1)) {
+                ARCH(6);
                 /* Not available in user mode.  */
                 if (IS_USER(s))
                     goto illegal_op;


Adam
-- 
Adam                 adam@os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-05-26  7:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-25  9:51 [Qemu-devel] [PATCH] ARM: ldrex/strex only valid v6 Adam Lackorzynski
2008-05-25 11:18 ` Laurent Desnogues
2008-05-26  7:54   ` Adam Lackorzynski

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).