Subject: Re: strh on a SHARK
To: None <richard.earnshaw@arm.com>
From: Mark Brinicombe <mark@causality.com>
List: port-arm32
Date: 08/10/1998 15:48:14
On Mon, 10 Aug 1998, Richard Earnshaw wrote:

> 
> Is the shark port of NetBSD supposed to support the full StrongARM 
> instruction set?  I'm using the -current snapshot set of binaries/kernel 
> from ftp.netbsd.org?
> 
> $ uname -a
> NetBSD shark1 1.3F NetBSD 1.3F (SHARK) #0: Fri Jun 26 10:33:59 EDT 1998    
>  tv@nc1.home.duh.org:/usr/SRC/netbsd/src/sys/arch/arm32/compile/SHARK arm32
> 
> While trying to test out a snapshot of EGCS 1.1 development tree, I tried 
> to build the Xemacs package, but the emacs binary seems to be looping 
> infinitely into the kernel when trying to execute a strh instruction to 
> the first word of a page (I suspect the page is newly allocated, but can't 
> be sure).
> 
> The offending bit of code is:
> 
> (gdb) x/5i $pc-16
> 0x39cc <make_compiled_function+220>:    str     r2, [r1]
> 0x39d0 <make_compiled_function+224>:    ldr	r3, 0x3a20 
> 						<make_compiled_function+304>
> 0x39d4 <make_compiled_function+228>:    str     r3, [ip]
> 0x39d8 <make_compiled_function+232>:    mov     r2, #0
> 0x39dc <make_compiled_function+236>:    strh    r2, [ip, #4]
> 
> (gdb) info reg ip
> ip             0x1f2ffc 2043900
> (gdb) x/4x $ip + 4
> 0x1f3000 <pure+594436>: 0x00000000      0x00000000      0x00000000      
> 0x00000000
> 
> It seems that every time the cpu tries to execute the strh it faults; the 
> kernel then thinks that it has fixed it up, restarts the instruction, but 
> faults again.
> 
> I can supply more info if you tell me how to extract it.
Hi,
  OK I have thrown a quick test together and looked at the fault handler
and I can confirm what I said in my last posting. The fault handler is not
recognising the STRH instruction as a store and thus when the page is
faulted in it is faulted in read only.

I have commited a fix to -current.

Cheers,
				Mark