[OpenAFS-testers] Re: [OpenAFS-devel] Panic with 1.2.4-rc1 on ia64

Michael Blandford mlblandf@sedona.ch.intel.com
Thu, 02 May 2002 12:44:40 -0700


This is a multi-part message in MIME format.
--------------010803030803030608030708
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

chas williams wrote:
>>I have been playing with rc1 and am getting a panic.  I was not having a 
>>panic with the 4/18 snapshot.
> 
> 
> i think i see the problem.  gcc says:
> 

:) Things are looking much better again.  I have to say Chas is saving 
the world ( mine at least )

Here is the current patch I am using.

Michael

-- 
  Intel, Corp.
  5000 W. Chandler Blvd.
  Chandler, AZ  85226

--------------010803030803030608030708
Content-Type: text/plain;
 name="afs.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="afs.patch"

diff -urN openafs-1.2.4rc1/src/afs/LINUX/osi_module.c openafs-1.2.4rc1.new/src/afs/LINUX/osi_module.c
--- openafs-1.2.4rc1/src/afs/LINUX/osi_module.c	Tue Apr 23 06:46:55 2002
+++ openafs-1.2.4rc1.new/src/afs/LINUX/osi_module.c	Thu May  2 09:57:30 2002
@@ -89,53 +89,74 @@
 #endif
 
 #ifdef AFS_IA64_LINUX20_ENV
-unsigned char ia64_syscall_stub[] =
-{
-  0x00, 0x50, 0x45, 0x16, 0x80, 0x05,   //  [MII]  alloc r42=ar.pfs,8,3,6,0
-  0x90, 0x02, 0x00, 0x62, 0x00, 0x60,   //         mov r41=b0
-  0x05, 0x00, 0x01, 0x84,               //         mov r43=r32
-  0x00, 0x60, 0x01, 0x42, 0x00, 0x21,   //  [MII]  mov r44=r33
-  0xd0, 0x02, 0x88, 0x00, 0x42, 0xc0,   //         mov r45=r34
-  0x05, 0x18, 0x01, 0x84,               //         mov r46=r35
-  0x0d, 0x78, 0x01, 0x48, 0x00, 0x21,   //  [MFI]  mov r47=r36
-  0x00, 0x00, 0x00, 0x02, 0x00, 0x00,   //         nop.f 0x0
-  0x06, 0x08, 0x00, 0x84,               //         mov r48=gp;;
-  0x05, 0x00, 0x00, 0x00, 0x01, 0x00,   //  [MLX]  nop.m 0x0
-  0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,   //         movl r15=0x0;;
-  0x01, 0x00, 0x00, 0x60,               //
-  0x0a, 0x80, 0x20, 0x1e, 0x18, 0x14,   //  [MMI]  ld8 r16=[r15],8;;
-  0x10, 0x00, 0x3c, 0x30, 0x20, 0xc0,   //         ld8 gp=[r15]
-  0x00, 0x09, 0x00, 0x07,               //         mov b6=r16
-  0x1d, 0x00, 0x00, 0x00, 0x01, 0x00,   //  [MFB]  nop.m 0x0
-  0x00, 0x00, 0x00, 0x02, 0x00, 0x00,   //         nop.f 0x0
-  0x68, 0x00, 0x00, 0x10,               //         br.call.sptk.many b0=b6;;
-  0x00, 0x00, 0x00, 0x00, 0x01, 0x00,   //  [MII]  nop.m 0x0
-  0x00, 0x50, 0x01, 0x55, 0x00, 0x00,   //         mov.i ar.pfs=r42
-  0x90, 0x0a, 0x00, 0x07,               //         mov b0=r41
-  0x1d, 0x08, 0x00, 0x60, 0x00, 0x21,   //  [MFB]  mov gp=r48
-  0x00, 0x00, 0x00, 0x02, 0x00, 0x80,   //         nop.f 0x0
-  0x08, 0x00, 0x84, 0x00                //         br.ret.sptk.many b0;;
-};
 
-void ia64_imm64_fixup(unsigned long v, void *code)
+asmlinkage long
+afs_syscall_stub(int r0, int r1, long r2, long r3, long r4, long gp)
 {
-        unsigned long *bundle = (unsigned long *) code;
-
-        unsigned long insn;
-        unsigned long slot1;
-
-        insn = ((v & 0x8000000000000000) >> 27) | ((v & 0x0000000000200000)) |
-           ((v & 0x00000000001f0000) <<  6) | ((v & 0x000000000000ff80) << 20) |
-           ((v & 0x000000000000007f) << 13);
-
-        slot1 = (v & 0x7fffffffffc00000) >> 22;
-
-        *bundle |= slot1 << 46;
-        *(bundle+1) |= insn << 23;
-        *(bundle+1) |= slot1 >> 18;
+__asm__ __volatile__ ("
+        alloc r42 = ar.pfs, 8, 3, 6, 0
+        mov r41 = b0    		/* save rp */
+        mov out0 = in0
+        mov out1 = in1
+        mov out2 = in2
+        mov out3 = in3
+        mov out4 = in4
+        mov out5 = gp			/* save gp */
+        ;;
+.L1:    mov r3 = ip
+        ;;
+        addl r15=.fptr_afs_syscall-.L1,r3
+        ;;
+        ld8 r15=[r15]
+        ;;
+        ld8 r16=[r15],8
+        ;;
+        ld8 gp=[r15]
+        mov b6=r16
+        br.call.sptk.many b0 = b6
+        ;;
+        mov ar.pfs = r42
+        mov b0 = r41
+        mov gp = r48			/* restore gp */
+        br.ret.sptk.many b0
+.fptr_afs_syscall:
+        data8 @fptr(afs_syscall)
+");
 }
 
-unsigned char *afs_syscall_stub, *afs_xsetgroups_stub;
+asmlinkage long
+afs_xsetgroups_stub(int r0, int r1, long r2, long r3, long r4, long gp)
+{
+__asm__ __volatile__ ("
+        alloc r42 = ar.pfs, 8, 3, 6, 0
+        mov r41 = b0    		/* save rp */
+        mov out0 = in0
+        mov out1 = in1
+        mov out2 = in2
+        mov out3 = in3
+        mov out4 = in4
+        mov out5 = gp			/* save gp */
+        ;;
+.L2:    mov r3 = ip
+        ;;
+        addl r15=.fptr_afs_xsetgroups - .L2,r3
+        ;;
+        ld8 r15=[r15]
+        ;;
+        ld8 r16=[r15],8
+        ;;
+        ld8 gp=[r15]
+        mov b6=r16
+        br.call.sptk.many b0 = b6
+        ;;
+        mov ar.pfs = r42
+        mov b0 = r41
+        mov gp = r48			/* restore gp */
+        br.ret.sptk.many b0
+.fptr_afs_xsetgroups:
+        data8 @fptr(afs_xsetgroups)
+");
+}
 
 struct fptr
 {
@@ -229,11 +250,7 @@
 
 #if defined(AFS_IA64_LINUX20_ENV)
     afs_ni_syscall = sys_call_table[__NR_afs_syscall - 1024];
-
-    afs_syscall_stub = (void *) kmalloc(sizeof(ia64_syscall_stub), GFP_KERNEL);
-    memcpy(afs_syscall_stub, ia64_syscall_stub, sizeof(ia64_syscall_stub));
-    ia64_imm64_fixup((unsigned long)afs_syscall, afs_syscall_stub+0x30);
-    sys_call_table[__NR_afs_syscall - 1024] = POINTER2SYSCALL afs_syscall_stub;
+    sys_call_table[__NR_afs_syscall - 1024] = POINTER2SYSCALL ((struct fptr *)afs_syscall_stub)->ip;
 #else /* AFS_IA64_LINUX20_ENV */
     afs_ni_syscall = sys_call_table[__NR_afs_syscall];
     sys_call_table[__NR_afs_syscall] = POINTER2SYSCALL afs_syscall;
@@ -250,15 +267,11 @@
 #if defined(AFS_IA64_LINUX20_ENV)
     sys_setgroupsp = (void *) &sys_setgroups;
 
-    afs_xsetgroups_stub = (void *) kmalloc(sizeof(ia64_syscall_stub), GFP_KERNEL);
-    memcpy(afs_xsetgroups_stub, ia64_syscall_stub, sizeof(ia64_syscall_stub));
-    ia64_imm64_fixup((unsigned long)afs_xsetgroups, afs_xsetgroups_stub+0x30);
-
     ((struct fptr *)sys_setgroupsp)->ip =
 		SYSCALL2POINTER sys_call_table[__NR_setgroups - 1024];
     ((struct fptr *)sys_setgroupsp)->gp = kernel_gp;
 
-    sys_call_table[__NR_setgroups - 1024] = POINTER2SYSCALL afs_xsetgroups_stub;
+    sys_call_table[__NR_setgroups - 1024] = POINTER2SYSCALL ((struct fptr *)afs_xsetgroups_stub)->ip;
 #else /* AFS_IA64_LINUX20_ENV */
     sys_setgroupsp = SYSCALL2POINTER sys_call_table[__NR_setgroups];
     sys_call_table[__NR_setgroups] = POINTER2SYSCALL afs_xsetgroups;
diff -urN openafs-1.2.4rc1/src/afs/LINUX/osi_vnodeops.c openafs-1.2.4rc1.new/src/afs/LINUX/osi_vnodeops.c
--- openafs-1.2.4rc1/src/afs/LINUX/osi_vnodeops.c	Tue Apr 23 18:49:38 2002
+++ openafs-1.2.4rc1.new/src/afs/LINUX/osi_vnodeops.c	Thu May  2 10:23:38 2002
@@ -33,6 +33,7 @@
 #if defined(AFS_LINUX24_ENV)
 #include "../h/smp_lock.h"
 #endif
+#include "../afs/afs_osidnlc.h"
 
 #ifdef pgoff2loff
 #define pageoff(pp) pgoff2loff((pp)->index)
diff -urN openafs-1.2.4rc1/Makefile.in openafs-1.2.4rc1.new/Makefile.in
--- openafs-1.2.4rc1/Makefile.in	Mon Apr 22 20:22:29 2002
+++ openafs-1.2.4rc1.new/Makefile.in	Mon Apr 29 17:27:18 2002
@@ -312,7 +312,7 @@
 		${COMPILE_PART1} sia ${COMPILE_PART2} ;; \
 	sun4x_55 ) \
 		${COMPILE_PART1} login ${COMPILE_PART2} ;; \
-	parisc_linux24|ia64_linux24) \
+	parisc_linux24) \
 		echo Skipping pam/login for parisc_linux24 ;; \
 	sun4x_* | hp_ux11* | *linux* | *fbsd* ) \
 		${COMPILE_PART1} pam ${COMPILE_PART2} ;; \
diff -urN openafs-1.2.4rc1/src/config/Makefile.ia64_linux24.in openafs-1.2.4rc1.new/src/config/Makefile.ia64_linux24.in
--- openafs-1.2.4rc1/src/config/Makefile.ia64_linux24.in	Mon Apr 22 20:22:34 2002
+++ openafs-1.2.4rc1.new/src/config/Makefile.ia64_linux24.in	Mon Apr 29 17:27:01 2002
@@ -14,7 +14,7 @@
 OPTMZ=-O2
 PAM_CFLAGS = -O2 -Dlinux -DLINUX_PAM -fPIC
 # Put -O2 here to _ensure_ all Makefiles pick it up.
-XCFLAGS= -O2
+XCFLAGS= -O2 -D_LARGEFILE64_SOURCE -G0
 MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
 XLDFLAGS=
 SHARE_LDFLAGS = -shared -Xlinker -x

--------------010803030803030608030708--