Sandipan Das has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/47579 )
Change subject: arch-power: Add clone support
......................................................................
arch-power: Add clone support
This adds support for the clone() system call using
which multiple cpus can be utilized in SE mode. For
this change, it should be noted that Linux on Power
uses the CLONE_BACKWARDS argument order.
Change-Id: Iac91a7d110d9f7a133b8e102ac113f48a431a0d6
Signed-off-by: Kevin Joe <[email protected]>
Signed-off-by: Chetan Agarwal <[email protected]>
Signed-off-by: Sandipan Das <[email protected]>
---
M src/arch/power/linux/linux.hh
M src/arch/power/linux/se_workload.cc
M src/arch/power/regs/int.hh
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/src/arch/power/linux/linux.hh b/src/arch/power/linux/linux.hh
index cdb1cda..646d642 100644
--- a/src/arch/power/linux/linux.hh
+++ b/src/arch/power/linux/linux.hh
@@ -32,6 +32,9 @@
#include <map>
+#include "arch/power/isa.hh"
+#include "arch/power/regs/int.hh"
+#include "cpu/thread_context.hh"
#include "kern/linux/linux.hh"
namespace gem5
@@ -214,6 +217,21 @@
return false;
}
}
+
+ static void
+ archClone(uint64_t flags,
+ Process *pp, Process *cp,
+ ThreadContext *ptc, ThreadContext *ctc,
+ uint64_t stack, uint64_t tls)
+ {
+ ctc->getIsaPtr()->copyRegsFrom(ptc);
+
+ if (flags & TGT_CLONE_SETTLS)
+ ctc->setIntReg(PowerISA::ThreadPointerReg, tls);
+
+ if (stack)
+ ctc->setIntReg(PowerISA::StackPointerReg, stack);
+ }
};
} // namespace gem5
diff --git a/src/arch/power/linux/se_workload.cc
b/src/arch/power/linux/se_workload.cc
index 9d5f9de..b49cb0b 100644
--- a/src/arch/power/linux/se_workload.cc
+++ b/src/arch/power/linux/se_workload.cc
@@ -227,7 +227,7 @@
{ 117, "ipc" },
{ 118, "fsync" },
{ 119, "sigreturn" },
- { 120, "clone" },
+ { 120, "clone", cloneBackwardsFunc<PowerLinux> },
{ 121, "setdomainname" },
{ 122, "uname", unameFunc },
{ 123, "modify_ldt" },
diff --git a/src/arch/power/regs/int.hh b/src/arch/power/regs/int.hh
index 891eaa1..95fbb8a 100644
--- a/src/arch/power/regs/int.hh
+++ b/src/arch/power/regs/int.hh
@@ -55,6 +55,7 @@
const int ArgumentReg5 = 8;
const int StackPointerReg = 1;
const int TOCPointerReg = 2;
+const int ThreadPointerReg = 13;
enum MiscIntRegNums
{
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/47579
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: Iac91a7d110d9f7a133b8e102ac113f48a431a0d6
Gerrit-Change-Number: 47579
Gerrit-PatchSet: 1
Gerrit-Owner: Sandipan Das <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s