From 08c79a194d1a3430801c04f37d13216cc9ec1da3 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Tue, 21 May 2019 16:36:32 +0100 Subject: sim-se: add a release parameter to Process.py Set the default release to that single value for all ISAs. glibc has checks for the kernel version based on uname, and refuses to start any syscall emulation programs if those checks don't pass with error: FATAL: kernel too old The ideal solution to this problem is to actually implement all missing system calls for the required kernel version and bumping the release accordingly. However, it is very hard to implement all missing syscalls and verify compliance. Previously, we have simply bumped the version manually from time to time when major glibc versions started breaking. This commit alleviates the problem in two ways. Firstly, having a single kernel version for all versions means that it is easier to bump all versions at once. Secondly, it makes it is possible to set the release with a parameter, which in turn can be set from the command line with: se.py --param 'system.cpu[:].workload[:].release = "4.18.0"' Change-Id: I9e3c31073bfe68735f7b0775c8e299aa62b98222 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17849 Maintainer: Brandon Potter Reviewed-by: Jason Lowe-Power Tested-by: kokoro --- src/sim/Process.py | 1 + src/sim/process.cc | 1 + src/sim/process.hh | 3 +++ 3 files changed, 5 insertions(+) (limited to 'src/sim') diff --git a/src/sim/Process.py b/src/sim/Process.py index 73a0145fd..6714ee560 100644 --- a/src/sim/Process.py +++ b/src/sim/Process.py @@ -62,6 +62,7 @@ class Process(SimObject): cwd = Param.String(getcwd(), "current working directory") simpoint = Param.UInt64(0, 'simulation point at which to start simulation') drivers = VectorParam.EmulatedDriver([], 'Available emulated drivers') + release = Param.String('5.1.0', "Linux kernel uname release") @classmethod def export_methods(cls, code): diff --git a/src/sim/process.cc b/src/sim/process.cc index 90d0e5d55..f647467b8 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -97,6 +97,7 @@ Process::Process(ProcessParams *params, EmulationPageTable *pTable, executable(params->executable), tgtCwd(normalize(params->cwd)), hostCwd(checkPathRedirect(tgtCwd)), + release(params->release), _uid(params->uid), _euid(params->euid), _gid(params->gid), _egid(params->egid), _pid(params->pid), _ppid(params->ppid), diff --git a/src/sim/process.hh b/src/sim/process.hh index 27c569602..23ed6d661 100644 --- a/src/sim/process.hh +++ b/src/sim/process.hh @@ -224,6 +224,9 @@ class Process : public SimObject std::string tgtCwd; std::string hostCwd; + // Syscall emulation uname release. + std::string release; + // Id of the owner of the process uint64_t _uid; uint64_t _euid; -- cgit v1.2.3