From af6a6a477531aefa6e961c464de495e0c09af673 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 11 Jan 2011 13:16:28 -0500 Subject: [PATCH] mp: do not panic on surprising hw --- mp.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/mp.c b/mp.c index edabdd6..44ee020 100644 --- a/mp.c +++ b/mp.c @@ -113,9 +113,10 @@ mpinit(void) switch(*p){ case MPPROC: proc = (struct mpproc*)p; + cprintf("mpproc %d\n", proc->apicid); if(ncpu != proc->apicid){ - cprintf("mpinit: ncpu=%d apicpid=%d\n", ncpu, proc->apicid); - panic("mpinit"); + cprintf("mpinit: ncpu=%d apicid=%d\n", ncpu, proc->apicid); + ismp = 0; } if(proc->flags & MPBOOT) bcpu = &cpus[ncpu]; @@ -135,9 +136,17 @@ mpinit(void) continue; default: cprintf("mpinit: unknown config type %x\n", *p); - panic("mpinit"); + ismp = 0; } } + if(!ismp){ + // Didn't like what we found; fall back to no MP. + ncpu = 1; + lapic = 0; + ioapicid = 0; + return; + } + if(mp->imcrp){ // Bochs doesn't support IMCR, so this doesn't run on Bochs. // But it would on real hardware.