Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Apr 1997 23:24:34 -0500 (EST)
From:      Thomas David Rivers <ponds!rivers@dg-rtp.dg.com>
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????
Message-ID:  <199704050424.XAA14880@lakes.water.net>

next in thread | raw e-mail | index | archive | help

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 -




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704050424.XAA14880>