Subject: Re: rnd, console debugger
To: Hal Murray <murray@pa.dec.com>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: current-users
Date: 08/12/1999 11:23:21
On Thu, Aug 12, 1999 at 02:03:45AM -0700, Hal Murray wrote:
> 
> While testing the new pciide code, I landed in the console debugger 
> with the following error:
> 
>   pool_get: rndsample: curpage NULL, nitems 7
>   panic: pool_get: nitems inconsistent
> 
> I've seen a few messages go past indicating that option rnd is associated 
> with obscure bugs so I rebuilt the kernel without rnd.  I haven't 
> had any strange problems since then. 
> 
> Can anybody give me a summary of the rnd problems?  Did I just skim 
> through the critical message? 

The problem is that it would lower the spl level when it shouln't.
In a  more clean manner: interrupts gets enabled when they shouldn't.
Senario usually is:
- kernel enters a critical section, so it blocks some irq to avoid reentrency
  (this is done by raising the spl level, that is adding more irqs to the
   blocked irq mask).
- then it wants to add some data to the entropy pool. It calls a rnd function
  for this, which unfortunably will *lower* the spl level to softclock.
  That is, disks or networks interrupts are enabled again.
- an interrupt was pending, so the critical section is entered again when
  it shouldn't have been.


> 
> Is the problem well understood?  Anybody interested in a dump?  I've 
> got one from the above panic on 1.4 with the new pciide.  If so, 
> tell me what to type or... 

I think it's well understood now, yes.

> 
> ------
> 
> Before I rebuilt the kernel, I tried again.  That time I got a page 
> fault or something similar.  I think the message indicated in came 
> from something that was probably related to rnd.  I didn't write 
> it down expecting the info to get preserved via a core dump. 
> 
> I typed "continue" to the console debugger.  It gave me the message 
> again.  After a few tries, I tried "reboot".  That got me going again, 
> but I didn't get a dump. 
> 
> Is there a FAQ or man page for the console debugger?  (Is that even 
> the right term?)  If so, how should I have found it?
> 
> Is there some command I missed to reboot with a dump?

I'm not sure this is in the faq yet (have to check).
The command to use is:
call cpu_reboot(0x100)
to get a core dump.
call cpu_reboot(0x104) will create a core dump without flushing the buffers
first.

The flags you can pass to cpu_reboot() are defined in
/usr/include/sys/reboot.h, that's the RB_* flags.

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--