summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/platform/ptrace/ptrace_amd64.go
diff options
context:
space:
mode:
authorHaibo Xu <haibo.xu@arm.com>2020-01-13 07:44:58 +0000
committerHaibo Xu <haibo.xu@arm.com>2020-03-09 01:04:55 +0000
commitc04958e2fa456587277baef361868bddc0df9e49 (patch)
treee22cd529a5bcdf62ff3042d1236b516eab2e5e4f /pkg/sentry/platform/ptrace/ptrace_amd64.go
parentddfc7239be94fa9711df877a66a9718aabff8b96 (diff)
Enable thread local storage support on arm64.
Linux use the task.thread.uw.tp_value field to store the TLS pointer on arm64 platform, and we use a similar way in gvisor to store it in the arch/State struct. Signed-off-by: Haibo Xu <haibo.xu@arm.com> Change-Id: Ie76b5c6d109bc27ccfd594008a96753806db7764
Diffstat (limited to 'pkg/sentry/platform/ptrace/ptrace_amd64.go')
-rw-r--r--pkg/sentry/platform/ptrace/ptrace_amd64.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/sentry/platform/ptrace/ptrace_amd64.go b/pkg/sentry/platform/ptrace/ptrace_amd64.go
index db0212538..24fc5dc62 100644
--- a/pkg/sentry/platform/ptrace/ptrace_amd64.go
+++ b/pkg/sentry/platform/ptrace/ptrace_amd64.go
@@ -31,3 +31,17 @@ func fpRegSet(useXsave bool) uintptr {
func stackPointer(r *syscall.PtraceRegs) uintptr {
return uintptr(r.Rsp)
}
+
+// x86 use the fs_base register to store the TLS pointer which can be
+// get/set in "func (t *thread) get/setRegs(regs *syscall.PtraceRegs)".
+// So both of the get/setTLS() operations are noop here.
+
+// getTLS gets the thread local storage register.
+func (t *thread) getTLS(tls *uint64) error {
+ return nil
+}
+
+// setTLS sets the thread local storage register.
+func (t *thread) setTLS(tls *uint64) error {
+ return nil
+}