summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/ptrace_amd64.go
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2021-03-23 18:44:38 -0700
committergVisor bot <gvisor-bot@google.com>2021-03-23 18:46:37 -0700
commit56a9a13976ad800a8a34b194d35f0169d0a0bb23 (patch)
treecb4b7c4352dc90a8c4c4f469c788fd2c5c6fd0dd /pkg/sentry/kernel/ptrace_amd64.go
parent960155cdaad49ccea07e45152f124beeb7e7fdcc (diff)
Move the code that manages floating-point state to a separate package
This change is inspired by Adin's cl/355256448. PiperOrigin-RevId: 364695931
Diffstat (limited to 'pkg/sentry/kernel/ptrace_amd64.go')
-rw-r--r--pkg/sentry/kernel/ptrace_amd64.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/pkg/sentry/kernel/ptrace_amd64.go b/pkg/sentry/kernel/ptrace_amd64.go
index 609ad3941..7aea3dcd8 100644
--- a/pkg/sentry/kernel/ptrace_amd64.go
+++ b/pkg/sentry/kernel/ptrace_amd64.go
@@ -51,14 +51,15 @@ func (t *Task) ptraceArch(target *Task, req int64, addr, data usermem.Addr) erro
return err
case linux.PTRACE_GETFPREGS:
- _, err := target.Arch().PtraceGetFPRegs(&usermem.IOReadWriter{
+ s := target.Arch().FloatingPointData()
+ _, err := target.Arch().FloatingPointData().PtraceGetFPRegs(&usermem.IOReadWriter{
Ctx: t,
IO: t.MemoryManager(),
Addr: data,
Opts: usermem.IOOpts{
AddressSpaceActive: true,
},
- })
+ }, len(*s))
return err
case linux.PTRACE_SETREGS:
@@ -73,14 +74,15 @@ func (t *Task) ptraceArch(target *Task, req int64, addr, data usermem.Addr) erro
return err
case linux.PTRACE_SETFPREGS:
- _, err := target.Arch().PtraceSetFPRegs(&usermem.IOReadWriter{
+ s := target.Arch().FloatingPointData()
+ _, err := s.PtraceSetFPRegs(&usermem.IOReadWriter{
Ctx: t,
IO: t.MemoryManager(),
Addr: data,
Opts: usermem.IOOpts{
AddressSpaceActive: true,
},
- })
+ }, len(*s))
return err
default: