On Wed, 25 Feb 2009, Ralf Baechle wrote: > > > You're getting this error message for the attempt to run a 64-bit kernel > > > on certain very old R4000 revisions. So either run a 32-bit kernel, > > > switch to newer version of the R4000 or to another MIPS CPU. For a > > > processor with just 8k caches switching to a 32-bit kernel is a good > > > idea to get best performance but we should probably enable the R4000 > > > workaround automatically in Kconfig for 64-bit Indy kernels. > > > > isn't there a gcc needed, which supports all workarounds ? What about > > the performance impact of that workarounds ? > > They definately will have some performance impact but the only person > who may have some experience with that is probably Maciej.
I haven't benchmarked the difference as when correctness is required the performance hit is secondary. The hit is taken only if the workarounds are actually activated -- there is nothing hardcoded in the patches and the "-mno-daddi" and "-mdaddi" options switch the workarounds on and off respectively. The default is "-mno-daddi" if "-mfix-r4000" or "-mfix-r4400" was specified; "-mdaddi" otherwise. Technically all 64-bit immediate additions are converted to a sequence of an immediate load to a temporary register (which is really a 32-bit addition to $zero) followed by a 64-bit register addition. Plus $t8 is marked as fixed in GCC because the compiler is not (or at least wasn't at the time I prepared the workaround) prepared to allocate a scratch register for branches (an extra spare register is needed to load the target address of an out-of-range branch being relaxed). It takes one temporary register away from the pool available and will certainly affect allocation in some cases and therefore performance. > As I recall only a part of the workarounds needed is supported by an > unpatched gcc but again Maciej will know more. Correct -- the changes to work around the buggy DADDIU instructions proved too invasive for long-term maintenance upstream. Two patches are required, for binutils and GCC respectively. Some handcoded assembly code which uses ".set noat" may not build anymore and require modifications. I have made source RPM packages of patched tools available at: ftp://ftp.linux-mips.org/pub/linux/mips/people/macro/SRPMS/ -- the newest version of GCC is gcc-4.1.2-8.src.rpm and for binutils this is binutils-2.18-4.src.rpm -- look for patches named *-mips-nodaddi-*. Binary packages are available there in a neigbour directory too, in case you wanted to try something quickly. ;) Because of various more and less recent circumstances I haven't ported the patches to newer versions of the respective tools (sorry), but I intend to do so at some point in the future. Let me know if I can be of assistance. Maciej -- To UNSUBSCRIBE, email to debian-kernel-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org