From owner-freebsd-hackers Fri Apr 4 21:50:39 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id VAA22747 for hackers-outgoing; Fri, 4 Apr 1997 21:50:39 -0800 (PST) Received: from dg-rtp.dg.com (dg-rtp.rtp.dg.com [128.222.1.2]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id VAA22742 for ; Fri, 4 Apr 1997 21:50:35 -0800 (PST) Received: by dg-rtp.dg.com (5.4R3.10/dg-rtp-v02) id AA13767; Sat, 5 Apr 1997 00:50:03 -0500 Received: from ponds by dg-rtp.dg.com.rtp.dg.com; Sat, 5 Apr 1997 00:50 EST Received: from lakes.water.net (lakes [10.0.0.3]) by ponds.water.net (8.8.3/8.7.3) with ESMTP id XAA11906; Fri, 4 Apr 1997 23:18:39 -0500 (EST) Received: (from rivers@localhost) by lakes.water.net (8.8.3/8.6.9) id XAA14880; Fri, 4 Apr 1997 23:24:34 -0500 (EST) Date: Fri, 4 Apr 1997 23:24:34 -0500 (EST) From: Thomas David Rivers Message-Id: <199704050424.XAA14880@lakes.water.net> To: ponds!zeta.org.au!bde, ponds!root.com!dg, ponds!freefall.cdrom.com!freebsd-hackers, ponds!lakes.water.net!rivers Subject: "dup alloc"/interrupts and Xresume11() - splbio() not working???? Content-Type: text Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Ok - I've finally learned how to use ddb - and discovered I was looking in the totally wrong place for my "dup alloc" problem. [I should, of course, simply been looking at physio(), since newfs uses the raw device... duh.] Anyway; I'm seeing things like this, and want to make sure I understand everything that's going on: 1) Xresume11() is the vector that is taken when interrupt 11 is triggered - right? 2) A cpl of 0xc0000840 should mask-out interrupt 11... right? Well - look at the following from a ddb session: [fjord]$ Debugger("serial console break") Stopped at _Debugger+0x2b: movb $0,_in_Debugger.110 db> br _scsi_done db> cont [fjord]$ newfs -b 8192 -f 1024 /dev/rsd0a Breakpoint at _scsi_done: pushl %ebp db> cont Breakpoint at _scsi_done: pushl %ebp db> print *(_cpl) c0000840 db> trace _scsi_done(f047db00,f05d9000,f05d9b18,f0) at _scsi_done _aha_done(f05d9000,f05d9b18,f0190404,f05d9b18) at _aha_done+0x1ab _ahaintr(0,80000000,f05e0010,10,0) at _ahaintr+0xd8 Xresume11() at Xresume11+0x25 --- interrupt, eip = 0xf018b5e0, ebp = 0x0 --- idle_loop() at idle_loop+0x38 db> doesn't this show that I have entered scsi_done() (because of an interrupt 11) - while the cpl should have IRQ 11 masked???? Now - looking at Xresume/**/irq_num: in vector.s, shouldn't the following have skipped over this: movl _cpl,%eax ; \ testb $IRQ_BIT(irq_num),%reg ; \ jne 2f ; \ which should test bit #3 of the 'ah' register since %reg expands to %ah (as defined by the INTR(11,..) expansion later in vector.s.) Which, loads up _cpl into %eax and tests the appropriate bit... Now; what follows is a contradiction (remember those proofs in college?) that I can't reconcile: Ok, lets say _cpl isn't at splbio(), so we take the interrupt and jump to ahaintr() ; which calls aha_done() which calls scsi_done(); which is where I hit my kernel breakpoint. As far as I can tell; none of the intervening routines changed _cpl. How could _cpl possibly be splbio() when we hit the prolog to scsi_done(), and not be splbio() in ahaintr. And, then; how could you have gotten into ahaintr() if the testb above failed??? Why have I entered scsi_done when I don't believe I should have? And, if this is all correct; how would an splbio() matter to just about any driver (that is, why aren't more drivers falling over?) Can someone explain to me what's going on here? Has some other function mysteriously done something with/to _cpl? - Thanks - - Dave Rivers -