Subject: Re: lint issues with larger caches
To: John Klos <john@ziaspace.com>
From: Chuck Silvers <chuq@chuq.com>
List: port-macppc
Date: 09/24/2005 16:33:47
--k+w/mQv8wyuph6w0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

hi,

the real problem is in ld.elf_so, please try the attached patch.

-Chuck


On Wed, Sep 21, 2005 at 05:14:58PM -0700, John Klos wrote:
> Hello,
> 
> A while ago, I reported problems using NetBSD 2's build.sh on a 7457 G4 
> which has 512k of CPU speed L2 cache. The problem was that the source tree 
> built lint kept randying on signal 11. For other reasons, I switched back 
> to the 7455 (256k of L2), and still saw the same problem, but with much 
> less frequency.
> 
> My previous email regarding this:
> http://mail-index.netbsd.org/tech-toolchain/2005/01/09/0000.html
> 
> Now that I have a local system where I am testing a 7447a CPU (which also 
> has 512k of CPU speed L2), I played with this a little, and it seems that 
> the problem goes away completely when lint is compiled with -O0.
> 
> Would anyone object to me committing the following change to 
> src/usr.bin/xlint?
> 
> ># PowerPC processors with large and fast L2 caches (such as the
> ># 7447 and 7457) have problems with lint unless compiled with -O0.
> >.if ${MACHINE_ARCH} == "powerpc"
> >CPPFLAGS+=    -O0
> >.endif
> 
> Thanks,
> John Klos

--k+w/mQv8wyuph6w0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="diff.ppc-rtld-icache"

Index: src/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c
===================================================================
RCS file: /cvsroot/src/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c,v
retrieving revision 1.37
diff -u -p -r1.37 ppc_reloc.c
--- src/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c	20 Aug 2005 19:01:17 -0000	1.37
+++ src/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c	24 Sep 2005 23:32:57 -0000
@@ -89,7 +89,7 @@ _rtld_setup_pltgot(const Obj_Entry *obj)
 	pltresolve[3] |= ha(obj);
 	pltresolve[4] |= l(obj);
 
-	__syncicache(pltcall, 72 + N * 8);
+	__syncicache(pltcall, 72 + N * 12);
 }
 
 void
@@ -218,7 +218,7 @@ _rtld_relocate_plt_lazy(const Obj_Entry 
 		/* b	pltresolve */
 		distance = (Elf_Addr)pltresolve - (Elf_Addr)where;
 		*where++ = 0x48000000 | (distance & 0x03fffffc);
-		/* __syncicache(where - 12, 12); */
+		/* __syncicache(where - 3, 12); */
 	}
 
 	return 0;
@@ -273,7 +273,7 @@ _rtld_relocate_plt_object(const Obj_Entr
 		/* b	pltcall	*/
 		distance = (Elf_Addr)pltcall - (Elf_Addr)where;
 		*where++ = 0x48000000 | (distance & 0x03fffffc);
-		__syncicache(where - 12, 12);
+		__syncicache(where - 3, 12);
 	}
 
 	if (tp)

--k+w/mQv8wyuph6w0--