sim-se: add a faux-filesystem

This change introduces the concept of a faux-filesystem.
The faux-filesystem creates a directory structure in m5out
(or whatever output dir the user specifies) where system calls
may be redirected.

This is useful to avoid non-determinism when reading files
with varying path names (e.g., variations from run-to-run if
the simulation is scheduled on a cluster where paths may change).

Also, this changeset allows circumventing host pseudofiles which
have information specific to the host processor (such as cache
hierarchy or processor information). Bypassing host pseudofiles
can be useful when executing runtimes in the absence of an
operating system kernel since runtimes may try to query standard
files (i.e. /proc or /sys) which are not relevant to an
application executing in syscall emulation mode.

Change-Id: I90821b3b403168b904a662fa98b85def1628621c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12119
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
David Hashe
2018-04-18 16:36:55 -04:00
committed by Brandon Potter
parent e8d0b755ea
commit 54c77aa055
17 changed files with 755 additions and 94 deletions

View File

@@ -359,6 +359,19 @@ def addSEOptions(parser):
help="Redirect stdout to a file.")
parser.add_option("--errout", default="",
help="Redirect stderr to a file.")
parser.add_option("--chroot", action="store", type="string", default="/",
help="The chroot option allows a user to alter the " \
"search path for processes running in SE mode. " \
"Normally, the search path would begin at the " \
"root of the filesystem (i.e. /). With chroot, " \
"a user can force the process to begin looking at" \
"some other location (i.e. /home/user/rand_dir)." \
"The intended use is to trick sophisticated " \
"software which queries the __HOST__ filesystem " \
"for information or functionality. Instead of " \
"finding files on the __HOST__ filesystem, the " \
"process will find the user's replacment files.")
def addFSOptions(parser):
from .FSConfig import os_types