2.6.10, alpha, "Relocation overflows"

Jay Estabrook Jay.Estabrook at hp.com
Tue Mar 22 18:23:02 UTC 2005


On Wed, Mar 23, 2005 at 12:56:59AM +1030, David Monro wrote:
> 
> I tried using gcc 2.95 (gcc version 2.95.4 20011002 (Debian
> prerelease)), but that gets a parse error on line 55 of
> arch/alpha/kernel/traps.c. (What compiler _should_ I be using? The
> documentation seems to indicate gcc 2.95.3, but I'm finding that
> hard to believe).
> 
> I can't go forward to 2.6.11 because thats missing _raw_read_trylock for 
> alpha, and there doesn't appear to be a patch for that yet. 2.6.8 UP 
> works, but SMP just hangs when probing the DAC960 raid controller. Is 
> SMP alpha just not very well tested at the moment?

I've been very successful building working 2.6.11 SMP kernels using
(the infamous) GCC 2.96 from RH 7.2 for Alpha, with some trivial changes.

Find attached the necessary patch for the traps.c problem, along with
an srm_env bugfix and the spinlock.h update.

Note that there were many problems with various flavors of GCC 2.95.x,
especially when generating code for SMP kernels, so I'd still avoid
using them...

 --Jay++

---------------------------------------------------------------
Jay A Estabrook                            HPTC - LINUX support
Hewlett-Packard Company - ZKO2-3/N30       (603) 884-0301
110 Spit Brook Road, Nashua NH 03062       Jay.Estabrook at hp.com
---------------------------------------------------------------

diff -Naurp orig-2.6.11/arch/alpha/kernel/srm_env.c new-2.6.11/arch/alpha/kernel/srm_env.c
--- orig-2.6.11/arch/alpha/kernel/srm_env.c	Sat Aug 14 06:54:50 2004
+++ new-2.6.11/arch/alpha/kernel/srm_env.c	Mon Mar 14 11:31:16 2005
@@ -152,7 +152,7 @@ srm_env_write(struct file *file, const c
 	res = -EFAULT;
 	if (copy_from_user(buf, buffer, count))
 		goto out;
-	buf[count] = '\0';
+	buf[count-1] = '\0';
 
 	ret1 = callback_setenv(entry->id, buf, count);
 	if ((ret1 >> 61) == 0) {
diff -Naurp orig-2.6.11/arch/alpha/kernel/traps.c new-2.6.11/arch/alpha/kernel/traps.c
--- orig-2.6.11/arch/alpha/kernel/traps.c	Tue Oct 19 09:24:12 2004
+++ new-2.6.11/arch/alpha/kernel/traps.c	Thu Mar  3 13:34:23 2005
@@ -34,6 +34,30 @@ static int opDEC_fix;
 static void __init
 opDEC_check(void)
 {
+	/* Sigh; tailor the code for the capabilities of the GCC version. */
+#if __GNUC__ < 3
+	__asm__ __volatile__ (
+	/* Load the address of... */
+	"	br	$16, 1f\n"
+	/* A stub instruction fault handler.  Just add 4 to the
+	   pc and continue.  */
+	"	ldq	$16, 8($sp)\n"
+	"	addq	$16, 4, $16\n"
+	"	stq	$16, 8($sp)\n"
+	"	call_pal %1\n"
+	/* Install the instruction fault handler.  */
+	"1:	lda	$17, 3\n"
+	"	call_pal %2\n"
+	/* With that in place, the fault from the round-to-minf fp
+	   insn will arrive either at the "lda 4" insn (bad) or one
+	   past that (good).  This places the correct fixup in %0.  */
+	"	lda %0, 0\n"
+	"	cvttq/svm $f31,$f31\n"
+	"	lda %0, 4"
+	: "=r" (opDEC_fix)
+	: "i" (PAL_rti), "i" (PAL_wrent)
+	: "$0", "$1", "$16", "$17", "$22", "$23", "$24", "$25");
+#else
 	__asm__ __volatile__ (
 	/* Load the address of... */
 	"	br	$16, 1f\n"
@@ -55,6 +79,7 @@ opDEC_check(void)
 	: [fix] "=r" (opDEC_fix)
 	: [rti] "n" (PAL_rti), [wrent] "n" (PAL_wrent)
 	: "$0", "$1", "$16", "$17", "$22", "$23", "$24", "$25");
+#endif
 
 	if (opDEC_fix)
 		printk("opDEC fixup enabled.\n");
diff -Naurp orig-2.6.11/include/asm-alpha/spinlock.h new-2.6.11/include/asm-alpha/spinlock.h
--- orig-2.6.11/include/asm-alpha/spinlock.h	Thu Mar  3 13:25:19 2005
+++ new-2.6.11/include/asm-alpha/spinlock.h	Thu Mar  3 13:46:50 2005
@@ -198,4 +198,6 @@ static inline void _raw_read_unlock(rwlo
 	: "m" (*lock) : "memory");
 }
 
+#define _raw_read_trylock(lock) generic_raw_read_trylock(lock)
+
 #endif /* _ALPHA_SPINLOCK_H */
-----------------------------------------------------------------------------




More information about the axp-list mailing list