Giacomo Travaglini has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/51767 )

Change subject: configs: Assign the host gid to the Process.gid in SE configs
......................................................................

configs: Assign the host gid to the Process.gid in SE configs

Some syscalls (like chown) can make use of the current process group id
(gid) to setup file ownership. If we just provide the default fake gid
([1]) we will encounter some problems when executing the syscall on the
host.

Example (guest) program:

gid_t prc_gid = getgid();
int res = chown(..., prc_gid);

By assigning the host gid to the guest we are sure we can successfully
execute syscalls from the gem5 process

[1]: https://github.com/gem5/gem5/blob/v21.1.0.2/src/sim/Process.py#L52

Signed-off-by: Giacomo Travaglini <[email protected]>
Change-Id: Ia09f44916def03f68f7605d72f323f03ec71bbe1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51767
Maintainer: Bobby R. Bruce <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M configs/example/arm/starter_se.py
M configs/example/se.py
2 files changed, 31 insertions(+), 0 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Bobby R. Bruce: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/configs/example/arm/starter_se.py b/configs/example/arm/starter_se.py
index 15fcad7..82fc49e 100644
--- a/configs/example/arm/starter_se.py
+++ b/configs/example/arm/starter_se.py
@@ -140,6 +140,7 @@
         argv = shlex.split(c)

process = Process(pid=100 + idx, cwd=cwd, cmd=argv, executable=argv[0])
+        process.gid = os.getgid()

print("info: %d. command and arguments: %s" % (idx + 1, process.cmd))
         multiprocesses.append(process)
diff --git a/configs/example/se.py b/configs/example/se.py
index 7b161e1..863f957 100644
--- a/configs/example/se.py
+++ b/configs/example/se.py
@@ -88,6 +88,7 @@
         process = Process(pid = 100 + idx)
         process.executable = wrkld
         process.cwd = os.getcwd()
+        process.gid = os.getgid()

         if args.env:
             with open(args.env, 'r') as f:

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/51767
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ia09f44916def03f68f7605d72f323f03ec71bbe1
Gerrit-Change-Number: 51767
Gerrit-PatchSet: 2
Gerrit-Owner: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Richard Cooper <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to