changeset b69cc0fd934d in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=b69cc0fd934d
description:
        util/m5/m5.c: ensure readfile() buffer pages are in page table
        (and marked dirty, in case that matters) by touching them beforehand

diffstat:

 util/m5/m5.c |  5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r cfbbc9178e7a -r b69cc0fd934d util/m5/m5.c
--- a/util/m5/m5.c      Thu Aug 12 17:16:02 2010 -0700
+++ b/util/m5/m5.c      Thu Aug 12 17:16:04 2010 -0700
@@ -65,6 +65,11 @@
     int offset = 0;
     int len;
 
+    // Touch all buffer pages to ensure they are mapped in the
+    // page table. This is required in the case of X86_FS, where
+    // Linux does demand paging.
+    memset(buf, 0, sizeof(buf));
+
     while ((len = m5_readfile(buf, sizeof(buf), offset)) > 0) {
         write(dest_fid, buf, len);
         offset += len;
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to