From: Joel Hestness Date: Fri, 13 Aug 2010 00:16:04 +0000 (-0700) Subject: util/m5/m5.c: ensure readfile() buffer pages are in page table X-Git-Tag: stable_2012_02_02~974^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=73d9a51835f7f9b725b4bec851dac9d6482438e7;p=gem5.git util/m5/m5.c: ensure readfile() buffer pages are in page table (and marked dirty, in case that matters) by touching them beforehand --- diff --git a/util/m5/m5.c b/util/m5/m5.c index 7747fc0bc..96150f2bb 100644 --- a/util/m5/m5.c +++ b/util/m5/m5.c @@ -65,6 +65,11 @@ read_file(int dest_fid) 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;