Zero PCB during early AIM PowerPC init.

When memory is not zero'ed by firmware, uninitialized PCB can have bogus
contents, which appear as a saved onfault condition, Altivec context to
restore etc. and lead to corruption/crashes. This commit fixes such issues.

Submitted by:	Michal Mazur arg ! semihalf dot com
Tested by:	Andreas Tobler andreast-list ! fgznet dot ch
This commit is contained in:
raj 2009-04-24 08:57:54 +00:00
parent b14076b185
commit 9d122f9cba

View File

@ -505,6 +505,7 @@ powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, void *mdp)
thread0.td_pcb = (struct pcb *)
((thread0.td_kstack + thread0.td_kstack_pages * PAGE_SIZE -
sizeof(struct pcb)) & ~15);
bzero((void *)thread0.td_pcb, sizeof(struct pcb));
pc->pc_curpcb = thread0.td_pcb;
/* Initialise the message buffer. */