From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 17155 invoked from network); 26 Mar 1999 21:46:16 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 26 Mar 1999 21:46:16 -0000 Received: from snowball.ucd.ie (snowball.ucd.ie [137.43.4.78]) by mail.redhat.com (8.8.7/8.8.7) with SMTP id QAA19309 for ; Fri, 26 Mar 1999 16:31:57 -0500 Received: (qmail 471 invoked from network); 26 Mar 1999 21:31:56 -0000 Received: from genie.ucd.ie (cetus@137.43.4.162) by snowball.ucd.ie with SMTP; 26 Mar 1999 21:31:56 -0000 Received: by genie.ucd.ie (sSMTP sendmail emulation); Fri, 26 Mar 1999 21:31:55 +0000 Date: Fri, 26 Mar 1999 21:31:55 +0000 From: Nikita Schmidt To: axp-list@redhat.com Subject: Re: 2.2.3: SCSI CDROM kernel panic Message-ID: <19990326213155.A738@snowball.ucd.ie> References: <199903192042.VAA20752@vmax.unix-ag.uni-siegen.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=zhXaljGHf11kAtnf X-Mailer: Mutt 0.95.3i In-Reply-To: <199903192042.VAA20752@vmax.unix-ag.uni-siegen.de>; from Nils Faerber on Fri, Mar 19, 1999 at 09:42:12PM +0100 --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii On Friday, 19 Mar, Nils Faerber wrote: > I just compiled and install kernel 2.2.3 and noticed that insmodding the > SCSI cdrom driver causes my machine to crash immediately with a kernel > panic! I found that as well. It looks like a bug in recenly changed semaphore.h. I came up with a patch that seems to fix it (although formally may produce faulty code as well...) - see attached. The problem is in the inline asm, which references a global symbol, thus using gp, assuming it has been provided by the function's entry code. The patch fixes only the 'up' function, which causes problems in sr_ioctl.c, but several other functions from semaphore.h need similar treatment as well. I think Richard Henderson, who I believe wrote that code in semaphore.h, can think of a better solution. Nikita --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="semaphore.diff" --- linux-2.2.4/include/asm-alpha/semaphore.h.orig Fri Mar 26 20:26:59 1999 +++ linux-2.2.4/include/asm-alpha/semaphore.h Fri Mar 26 21:03:08 1999 @@ -167,25 +167,27 @@ it's return address in $28. The pv is loaded as usual. The gp is clobbered (in the module case) as usual. */ + register void *pv __asm__ ("$27") = __up_wakeup; + __asm__ __volatile__ ( "/* semaphore up operation */\n" " mb\n" - "1: ldl_l $27,%0\n" - " addl $27,1,$27\n" - " mov $27,$28\n" + "1: ldl_l $24,%0\n" + " addl $24,1,$24\n" + " mov $24,$28\n" " stl_c $28,%0\n" " beq $28,2f\n" " mb\n" - " ble $27,3f\n" + " ble $24,3f\n" "4:\n" ".section .text2,\"ax\"\n" "2: br 1b\n" "3: lda $24,%0\n" - " jsr $28,__up_wakeup\n" + " jsr $28,(%1),__up_wakeup\n" " ldgp $29,0($28)\n" " br 4b\n" ".previous" - : : "m"(sem->count) + : : "m"(sem->count), "r"(pv) : "$24", "$27", "$28", "memory"); } --zhXaljGHf11kAtnf--