Hanging on reboot / alternative cpu_reset mechanism
Ed Maste
emaste at phaedrus.sandvine.ca
Thu Jun 16 00:23:21 GMT 2005
On some of the motherboards we use I've run into a hang on reboot. I've
noticed messages describing similar symptoms on this list, but am not sure
if there's any relationship.
It seems cpu_reset_real tries to use the keyboard controller to perform a
system reset using outb(0x64, 0xFE) and then falls back to (vm_machdep.c):
/* Force a shutdown by unmapping entire address space. */
bzero((caddr_t)PTD, NBPTD);
/* "good night, sweet prince .... <THUNK!>" */
invltlb();
/* NOTREACHED */
while(1);
The systems I've experienced the hang on (SuperMicro X6DHR) have the
keyboard controller implemented in a Winbond W83627. I'm guessing that
this controller somehow gets confused and doesn't accept the reset command.
Then the system just hangs after the bzero(PTD) or ends up in in the
double fault handler.
I found two other reset methods from various web resources: bit 0 in
register 0x92, and forcing a triple fault. I've confirmed that both
methods work for me.
Register 0x92 seems to have been introduced with the PS/2 ages ago.
It's implemented in the Winbond controller; I imagine it's available
with most chipsets. I think it might be used in QNX but I'm not sure
about other OSes.
The triple fault can be invoked with something like
static long no_idt[2];
__asm __volatile("lidt %0" : "=m" (no_idt));
__asm __volatile("int3");
Both NetBSD and OpenBSD try the keyboard controller reset followed by
the triple fault (implemented slightly differently). Is this something
worth switching to? How is the current bzero() code supposed to ensure
a reboot?
--
Ed Maste, Sandvine Incorporated
More information about the freebsd-i386
mailing list