693,698c693,696
< // address is higher than the stack region or in the current stack region
< if (vaddr > p->stack_base || vaddr > p->stack_min)
< FaultBase::invoke(tc);
<
< // We've accessed the next page
< if (vaddr > p->stack_min - PageBytes) {
---
> // We've accessed the next page of the stack, so extend the stack
> // to cover it.
> if(vaddr < p->stack_min && vaddr >= p->stack_min - PageBytes)
> {
700c698
< if (p->stack_base - p->stack_min > 8*1024*1024)
---
> if(p->stack_base - p->stack_min > 8*1024*1024)
704,705d701
< } else {
< FaultBase::invoke(tc);
706a703,708
> // Otherwise, we have an unexpected page fault. Report that fact,
> // and what address was accessed to cause the fault.
> else
> {
> panic("Page table fault when accessing virtual address %#x\n", vaddr);
> }