Skip to content
Snippets Groups Projects
Commit af6a6a47 authored by Russ Cox's avatar Russ Cox
Browse files

mp: do not panic on surprising hw

parent 1a81e38b
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment