Matthew Poremba has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/28948 )

Change subject: sim: Fixes for mremap
......................................................................

sim: Fixes for mremap

Remapping memory was trying to map old pages to the same new page and
calling MemState mapRegion unnecessarily. Properly increment the new
page address and remove the redundant mapRegion as remapRegion covers
its functionality.

JIRA: https://gem5.atlassian.net/browse/GEM5-475
Change-Id: Ie360755cfe488b09cbd87cd0ce525b11ac446b51
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28948
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/sim/mem_state.cc
M src/sim/syscall_emul.hh
2 files changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/sim/mem_state.cc b/src/sim/mem_state.cc
index 42d3781..f998fff 100644
--- a/src/sim/mem_state.cc
+++ b/src/sim/mem_state.cc
@@ -369,6 +369,7 @@
                                          new_start_addr);

         start_addr += _pageBytes;
+        new_start_addr += _pageBytes;

         /**
          * The regions need to always be page-aligned otherwise the while
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 5bd9f54..290c48e 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -1177,7 +1177,6 @@

                 warn("returning %08p as start\n", new_start);
                 p->memState->remapRegion(start, new_start, old_length);
-                p->memState->mapRegion(new_start, new_length, "remapped");
                 return new_start;
             }
         }

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/28948
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: release-staging-v20.0.0.0
Gerrit-Change-Id: Ie360755cfe488b09cbd87cd0ce525b11ac446b51
Gerrit-Change-Number: 28948
Gerrit-PatchSet: 2
Gerrit-Owner: Matthew Poremba <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Brandon Potter <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Matthew Poremba <[email protected]>
Gerrit-Reviewer: Tommaso Marinelli  <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to