util/m5/m5.c: ensure readfile() buffer pages are in page table
(and marked dirty, in case that matters) by touching them beforehand
This commit is contained in:
parent
53c241fc16
commit
73d9a51835
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue