summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2011-09-09 01:01:43 -0700
committerGabe Black <gblack@eecs.umich.edu>2011-09-09 01:01:43 -0700
commita1ad9e652a1a8b0b7d8c5dd2229324792010f6f3 (patch)
tree97577adc8e71a46e9d4b34d255c4fd84df3b88d0 /src/arch
parentf370ac5c186d063bd169c07ea89e1792617264cd (diff)
downloadgem5-a1ad9e652a1a8b0b7d8c5dd2229324792010f6f3.tar.xz
Stack: Tidy up some comments, a warning, and make stack extension consistent.
Do some minor cleanup of some recently added comments, a warning, and change other instances of stack extension to be like what's now being done for x86.
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/alpha/faults.cc4
-rw-r--r--src/arch/sparc/faults.cc4
-rw-r--r--src/arch/x86/tlb.cc19
3 files changed, 8 insertions, 19 deletions
diff --git a/src/arch/alpha/faults.cc b/src/arch/alpha/faults.cc
index b6a0d965e..c66c6f8ab 100644
--- a/src/arch/alpha/faults.cc
+++ b/src/arch/alpha/faults.cc
@@ -201,8 +201,8 @@ NDtbMissFault::invoke(ThreadContext *tc, StaticInstPtr inst)
TlbEntry entry;
bool success = p->pTable->lookup(vaddr, entry);
if (!success) {
- p->checkAndAllocNextPage(vaddr);
- success = p->pTable->lookup(vaddr, entry);
+ if (p->fixupStackFault(vaddr))
+ success = p->pTable->lookup(vaddr, entry);
}
if (!success) {
panic("Tried to access unmapped address %#x.\n", (Addr)vaddr);
diff --git a/src/arch/sparc/faults.cc b/src/arch/sparc/faults.cc
index 814a33bd3..01d57e627 100644
--- a/src/arch/sparc/faults.cc
+++ b/src/arch/sparc/faults.cc
@@ -643,8 +643,8 @@ FastDataAccessMMUMiss::invoke(ThreadContext *tc, StaticInstPtr inst)
TlbEntry entry;
bool success = p->pTable->lookup(vaddr, entry);
if (!success) {
- p->checkAndAllocNextPage(vaddr);
- success = p->pTable->lookup(vaddr, entry);
+ if (p->fixupStackFault(vaddr))
+ success = p->pTable->lookup(vaddr, entry);
}
if (!success) {
panic("Tried to access unmapped address %#x.\n", vaddr);
diff --git a/src/arch/x86/tlb.cc b/src/arch/x86/tlb.cc
index 9ba20f8d7..9d02a00c7 100644
--- a/src/arch/x86/tlb.cc
+++ b/src/arch/x86/tlb.cc
@@ -619,22 +619,11 @@ TLB::translate(RequestPtr req, ThreadContext *tc, Translation *translation,
TlbEntry newEntry;
bool success = p->pTable->lookup(vaddr, newEntry);
if (!success && mode != Execute) {
- // This may fail because for some reason the requested
- // address is not allocatable on the stack. If it's a stack
- // address, then it's because the address fell outside of
- // max stack range and user should increase max size of
- // stack. Otherwise, it could be a random address that was
- // not in the page table and not on the stack. Either way,
- // you'll end up with a page fault.
- if (p->checkAndAllocNextPage(vaddr))
- // Might as well not check this if you failed to
- // allocate. Partially nested this just so code
- // maintainers can understand this is a separate and
- // necessary step not sufficient just by reading return
- // value of checkAndAlloc call because there is a side
- // effect. This call will populate (it's called by
- // reference).
+ // Check if we just need to grow the stack.
+ if (p->fixupStackFault(vaddr)) {
+ // If we did, lookup the entry for the new page.
success = p->pTable->lookup(vaddr, newEntry);
+ }
}
if (!success) {
return new PageFault(vaddr, true, mode, true, false);