Matthew Poremba has submitted this change. ( )

Change subject: sim: Initialize stackSize and stackMin in MemState

sim: Initialize stackSize and stackMin in MemState

Initialize _stackSize and _stackMin to the maximum stack size values.
The are setup in each arch's Process::initState and may be uninitialized
until then. If a stack fixup occurs before these are setup, addresses
which are not in the stack might be allocated on the stack. This
prevents that until they are initialized in Process::initState. If an
access occurs before that with these initial values, the stack fixup
will simply allocate a page of memory in the stack space. However, it
will not print the typical info messages about growing the stack during
this time.

Change-Id: I9f9316734f4bf1f773fc538922e83b867731c684
Reviewed-by: Jason Lowe-Power <>
Reviewed-by: Gabe Black <>
Maintainer: Jason Lowe-Power <>
Tested-by: kokoro <>
M src/sim/
1 file changed, 2 insertions(+), 1 deletion(-)

Jason Lowe-Power: Looks good to me, but someone else must approve; Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass

diff --git a/src/sim/ b/src/sim/
index bfee9da..bcfab78 100644
--- a/src/sim/
+++ b/src/sim/
@@ -43,7 +43,8 @@
                    Addr mmap_end)
     : _ownerProcess(owner),
       _pageBytes(owner->system->getPageBytes()), _brkPoint(brk_point),
-      _stackBase(stack_base), _maxStackSize(max_stack_size),
+      _stackBase(stack_base), _stackSize(max_stack_size),
+ _maxStackSize(max_stack_size), _stackMin(stack_base - max_stack_size),
       _mmapEnd(mmap_end), _endBrkPoint(brk_point)

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I9f9316734f4bf1f773fc538922e83b867731c684
Gerrit-Change-Number: 30394
Gerrit-PatchSet: 2
Gerrit-Owner: Matthew Poremba <>
Gerrit-Reviewer: Gabe Black <>
Gerrit-Reviewer: Jason Lowe-Power <>
Gerrit-Reviewer: Matthew Poremba <>
Gerrit-Reviewer: kokoro <>
Gerrit-MessageType: merged
gem5-dev mailing list --
To unsubscribe send an email to

Reply via email to