Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] SH simulator illegal instructions
@ 2007-09-24 14:44 Andrew STUBBS
  2007-10-06 15:58 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew STUBBS @ 2007-09-24 14:44 UTC (permalink / raw)
  To: GDB Patches

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

Hi,

The SH simulator currently accepts some instructions in delay slots that 
should not be allowed.

Specifically:
	mov.l @(<disp>,PC),<REG_N>
	mov.w @(<disp>,PC),<REG_N>
	mova @(<disp>,PC),R0

I have checked the remaining SH-4 instructions, and don't believe there 
are any more, however I have not checked other architecture variants.

The attached patch add the proper check.

:ADDPATCH sh sim:

Andrew Stubbs

[-- Attachment #2: illslot.patch --]
[-- Type: text/plain, Size: 937 bytes --]

2007-09-24  Andrew Stubbs  <andrew.stubbs@st.com>

	* gencode.c (tab): Add RAISE_EXCEPTION_IF_IN_DELAY_SLOT to the
	definition of PC relative 'mov.l'/'mov.w' and also 'mova'.

--- orig/sim/sh/gencode.c	2007-03-06 13:58:46.000000000 +0000
+++ src/sim/sh/gencode.c	2007-09-24 15:02:18.000000000 +0100
@@ -993,6 +993,7 @@
     "L (0);",
   },
   { "n", "", "mov.l @(<disp>,PC),<REG_N>", "1101nnnni8p4....",
+    "RAISE_EXCEPTION_IF_IN_DELAY_SLOT ();",
     "MA (1);",
     "R[n] = RLAT ((PH2T (PC) & ~3) + 4 + i);",
     "L (n);",
@@ -1059,6 +1060,7 @@
     "L (0);",
   },
   { "n", "", "mov.w @(<disp>,PC),<REG_N>", "1001nnnni8p2....",
+    "RAISE_EXCEPTION_IF_IN_DELAY_SLOT ();",
     "MA (1);",
     "R[n] = RSWAT (PH2T (PC + 4 + i));",
     "L (n);",
@@ -1120,6 +1122,7 @@
   },
 
   { "0", "", "mova @(<disp>,PC),R0", "11000111i8p4....",
+    "RAISE_EXCEPTION_IF_IN_DELAY_SLOT ();",
     "R0 = ((i + 4 + PH2T (PC)) & ~0x3);",
   },
 

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

* Re: [PATCH] SH simulator illegal instructions
  2007-09-24 14:44 [PATCH] SH simulator illegal instructions Andrew STUBBS
@ 2007-10-06 15:58 ` Daniel Jacobowitz
  2007-10-08 11:18   ` Andrew STUBBS
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2007-10-06 15:58 UTC (permalink / raw)
  To: Andrew STUBBS; +Cc: GDB Patches

On Mon, Sep 24, 2007 at 03:44:35PM +0100, Andrew STUBBS wrote:
> 2007-09-24  Andrew Stubbs  <andrew.stubbs@st.com>
> 
> 	* gencode.c (tab): Add RAISE_EXCEPTION_IF_IN_DELAY_SLOT to the
> 	definition of PC relative 'mov.l'/'mov.w' and also 'mova'.

:REVIEWMAIL:

Since no one has raised a technical objection, I'll trust your
judgement :-)  Ok to commit, thanks.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [PATCH] SH simulator illegal instructions
  2007-10-06 15:58 ` Daniel Jacobowitz
@ 2007-10-08 11:18   ` Andrew STUBBS
  2007-10-08 11:59     ` Denis PILAT
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew STUBBS @ 2007-10-08 11:18 UTC (permalink / raw)
  To: Andrew STUBBS, GDB Patches

Daniel Jacobowitz wrote:
> On Mon, Sep 24, 2007 at 03:44:35PM +0100, Andrew STUBBS wrote:
>> 2007-09-24  Andrew Stubbs  <andrew.stubbs@st.com>
>>
>> 	* gencode.c (tab): Add RAISE_EXCEPTION_IF_IN_DELAY_SLOT to the
>> 	definition of PC relative 'mov.l'/'mov.w' and also 'mova'.
> 
> :REVIEWMAIL:
> 
> Since no one has raised a technical objection, I'll trust your
> judgement :-)  Ok to commit, thanks.
> 

Thanks, but I can't! :(

Assuming there's no problem with sourceware.org, I'm probably having 
trouble with the corporate firewall (again).

Would somebody be so good as to check in this patch on my behalf?

Thanks

Andrew


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

* Re: [PATCH] SH simulator illegal instructions
  2007-10-08 11:18   ` Andrew STUBBS
@ 2007-10-08 11:59     ` Denis PILAT
  2007-10-08 13:00       ` Andrew STUBBS
  0 siblings, 1 reply; 5+ messages in thread
From: Denis PILAT @ 2007-10-08 11:59 UTC (permalink / raw)
  To: Andrew STUBBS; +Cc: GDB Patches

Andrew STUBBS wrote:
> Daniel Jacobowitz wrote:
>> On Mon, Sep 24, 2007 at 03:44:35PM +0100, Andrew STUBBS wrote:
>>> 2007-09-24  Andrew Stubbs  <andrew.stubbs@st.com>
>>>
>>>     * gencode.c (tab): Add RAISE_EXCEPTION_IF_IN_DELAY_SLOT to the
>>>     definition of PC relative 'mov.l'/'mov.w' and also 'mova'.
>>
>> :REVIEWMAIL:
>>
>> Since no one has raised a technical objection, I'll trust your
>> judgement :-)  Ok to commit, thanks.
>>
>
> Thanks, but I can't! :(
>
> Assuming there's no problem with sourceware.org, I'm probably having 
> trouble with the corporate firewall (again).
>
> Would somebody be so good as to check in this patch on my behalf?
>
> Thanks
>
> Andrew
>
That's done !
That means it's not the corporate firewall.
-- 
Denis


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

* Re: [PATCH] SH simulator illegal instructions
  2007-10-08 11:59     ` Denis PILAT
@ 2007-10-08 13:00       ` Andrew STUBBS
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew STUBBS @ 2007-10-08 13:00 UTC (permalink / raw)
  To: Denis PILAT; +Cc: GDB Patches

Denis PILAT wrote:
> Andrew STUBBS wrote:
>> Would somebody be so good as to check in this patch on my behalf?
>>
> That's done !
> That means it's not the corporate firewall.

Thanks Denis.

After a little investigation, it would appear to be just Bristol that is 
cut off! :(


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

end of thread, other threads:[~2007-10-08 13:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-24 14:44 [PATCH] SH simulator illegal instructions Andrew STUBBS
2007-10-06 15:58 ` Daniel Jacobowitz
2007-10-08 11:18   ` Andrew STUBBS
2007-10-08 11:59     ` Denis PILAT
2007-10-08 13:00       ` Andrew STUBBS

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox