summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/arch
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-04-14 18:37:19 +0000
committergVisor bot <gvisor-bot@google.com>2021-04-14 18:37:19 +0000
commitca506c33c1f00c4e57f640340178007a813d3454 (patch)
tree52ef7111534dd020c5d026c3acc026769b863ecf /pkg/sentry/arch
parent3a197f66df7303d3bc89e89beeed02f22debda98 (diff)
parent5c1052b6bb2658208f1afaf423aeac98f30235c1 (diff)
Merge release-20210408.0-30-g5c1052b6b (automated)
Diffstat (limited to 'pkg/sentry/arch')
-rw-r--r--pkg/sentry/arch/arch_abi_autogen_unsafe.go13
-rw-r--r--pkg/sentry/arch/arch_amd64_abi_autogen_unsafe.go9
-rw-r--r--pkg/sentry/arch/arch_arm64_abi_autogen_unsafe.go17
3 files changed, 18 insertions, 21 deletions
diff --git a/pkg/sentry/arch/arch_abi_autogen_unsafe.go b/pkg/sentry/arch/arch_abi_autogen_unsafe.go
index 6ab83879c..92fb07615 100644
--- a/pkg/sentry/arch/arch_abi_autogen_unsafe.go
+++ b/pkg/sentry/arch/arch_abi_autogen_unsafe.go
@@ -15,7 +15,6 @@ import (
"gvisor.dev/gvisor/pkg/gohacks"
"gvisor.dev/gvisor/pkg/hostarch"
"gvisor.dev/gvisor/pkg/marshal"
- "gvisor.dev/gvisor/pkg/safecopy"
"io"
"reflect"
"runtime"
@@ -67,7 +66,7 @@ func (s *SignalAct) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (s *SignalAct) MarshalUnsafe(dst []byte) {
if s.Mask.Packed() {
- safecopy.CopyIn(dst, unsafe.Pointer(s))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(len(dst)))
} else {
// Type SignalAct doesn't have a packed layout in memory, fallback to MarshalBytes.
s.MarshalBytes(dst)
@@ -77,7 +76,7 @@ func (s *SignalAct) MarshalUnsafe(dst []byte) {
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (s *SignalAct) UnmarshalUnsafe(src []byte) {
if s.Mask.Packed() {
- safecopy.CopyOut(unsafe.Pointer(s), src)
+ gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(len(src)))
} else {
// Type SignalAct doesn't have a packed layout in memory, fallback to UnmarshalBytes.
s.UnmarshalBytes(src)
@@ -211,12 +210,12 @@ func (s *SignalInfo) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (s *SignalInfo) MarshalUnsafe(dst []byte) {
- safecopy.CopyIn(dst, unsafe.Pointer(s))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(len(dst)))
}
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (s *SignalInfo) UnmarshalUnsafe(src []byte) {
- safecopy.CopyOut(unsafe.Pointer(s), src)
+ gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(len(src)))
}
// CopyOutN implements marshal.Marshallable.CopyOutN.
@@ -312,12 +311,12 @@ func (s *SignalStack) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (s *SignalStack) MarshalUnsafe(dst []byte) {
- safecopy.CopyIn(dst, unsafe.Pointer(s))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(len(dst)))
}
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (s *SignalStack) UnmarshalUnsafe(src []byte) {
- safecopy.CopyOut(unsafe.Pointer(s), src)
+ gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(len(src)))
}
// CopyOutN implements marshal.Marshallable.CopyOutN.
diff --git a/pkg/sentry/arch/arch_amd64_abi_autogen_unsafe.go b/pkg/sentry/arch/arch_amd64_abi_autogen_unsafe.go
index d8f71795b..e15495e50 100644
--- a/pkg/sentry/arch/arch_amd64_abi_autogen_unsafe.go
+++ b/pkg/sentry/arch/arch_amd64_abi_autogen_unsafe.go
@@ -17,7 +17,6 @@ import (
"gvisor.dev/gvisor/pkg/gohacks"
"gvisor.dev/gvisor/pkg/hostarch"
"gvisor.dev/gvisor/pkg/marshal"
- "gvisor.dev/gvisor/pkg/safecopy"
"io"
"reflect"
"runtime"
@@ -170,7 +169,7 @@ func (s *SignalContext64) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (s *SignalContext64) MarshalUnsafe(dst []byte) {
if s.Oldmask.Packed() {
- safecopy.CopyIn(dst, unsafe.Pointer(s))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(len(dst)))
} else {
// Type SignalContext64 doesn't have a packed layout in memory, fallback to MarshalBytes.
s.MarshalBytes(dst)
@@ -180,7 +179,7 @@ func (s *SignalContext64) MarshalUnsafe(dst []byte) {
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (s *SignalContext64) UnmarshalUnsafe(src []byte) {
if s.Oldmask.Packed() {
- safecopy.CopyOut(unsafe.Pointer(s), src)
+ gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(len(src)))
} else {
// Type SignalContext64 doesn't have a packed layout in memory, fallback to UnmarshalBytes.
s.UnmarshalBytes(src)
@@ -313,7 +312,7 @@ func (u *UContext64) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (u *UContext64) MarshalUnsafe(dst []byte) {
if u.MContext.Packed() && u.Sigset.Packed() && u.Stack.Packed() {
- safecopy.CopyIn(dst, unsafe.Pointer(u))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(len(dst)))
} else {
// Type UContext64 doesn't have a packed layout in memory, fallback to MarshalBytes.
u.MarshalBytes(dst)
@@ -323,7 +322,7 @@ func (u *UContext64) MarshalUnsafe(dst []byte) {
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (u *UContext64) UnmarshalUnsafe(src []byte) {
if u.MContext.Packed() && u.Sigset.Packed() && u.Stack.Packed() {
- safecopy.CopyOut(unsafe.Pointer(u), src)
+ gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(len(src)))
} else {
// Type UContext64 doesn't have a packed layout in memory, fallback to UnmarshalBytes.
u.UnmarshalBytes(src)
diff --git a/pkg/sentry/arch/arch_arm64_abi_autogen_unsafe.go b/pkg/sentry/arch/arch_arm64_abi_autogen_unsafe.go
index 40d0c1c75..cedd9688e 100644
--- a/pkg/sentry/arch/arch_arm64_abi_autogen_unsafe.go
+++ b/pkg/sentry/arch/arch_arm64_abi_autogen_unsafe.go
@@ -17,7 +17,6 @@ import (
"gvisor.dev/gvisor/pkg/gohacks"
"gvisor.dev/gvisor/pkg/hostarch"
"gvisor.dev/gvisor/pkg/marshal"
- "gvisor.dev/gvisor/pkg/safecopy"
"io"
"reflect"
"runtime"
@@ -76,7 +75,7 @@ func (f *FpsimdContext) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (f *FpsimdContext) MarshalUnsafe(dst []byte) {
if f.Head.Packed() {
- safecopy.CopyIn(dst, unsafe.Pointer(f))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(len(dst)))
} else {
// Type FpsimdContext doesn't have a packed layout in memory, fallback to MarshalBytes.
f.MarshalBytes(dst)
@@ -86,7 +85,7 @@ func (f *FpsimdContext) MarshalUnsafe(dst []byte) {
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (f *FpsimdContext) UnmarshalUnsafe(src []byte) {
if f.Head.Packed() {
- safecopy.CopyOut(unsafe.Pointer(f), src)
+ gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(len(src)))
} else {
// Type FpsimdContext doesn't have a packed layout in memory, fallback to UnmarshalBytes.
f.UnmarshalBytes(src)
@@ -235,7 +234,7 @@ func (s *SignalContext64) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (s *SignalContext64) MarshalUnsafe(dst []byte) {
if s.Fpsimd64.Packed() {
- safecopy.CopyIn(dst, unsafe.Pointer(s))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(len(dst)))
} else {
// Type SignalContext64 doesn't have a packed layout in memory, fallback to MarshalBytes.
s.MarshalBytes(dst)
@@ -245,7 +244,7 @@ func (s *SignalContext64) MarshalUnsafe(dst []byte) {
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (s *SignalContext64) UnmarshalUnsafe(src []byte) {
if s.Fpsimd64.Packed() {
- safecopy.CopyOut(unsafe.Pointer(s), src)
+ gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(len(src)))
} else {
// Type SignalContext64 doesn't have a packed layout in memory, fallback to UnmarshalBytes.
s.UnmarshalBytes(src)
@@ -396,7 +395,7 @@ func (u *UContext64) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (u *UContext64) MarshalUnsafe(dst []byte) {
if u.MContext.Packed() && u.Sigset.Packed() && u.Stack.Packed() {
- safecopy.CopyIn(dst, unsafe.Pointer(u))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(len(dst)))
} else {
// Type UContext64 doesn't have a packed layout in memory, fallback to MarshalBytes.
u.MarshalBytes(dst)
@@ -406,7 +405,7 @@ func (u *UContext64) MarshalUnsafe(dst []byte) {
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (u *UContext64) UnmarshalUnsafe(src []byte) {
if u.MContext.Packed() && u.Sigset.Packed() && u.Stack.Packed() {
- safecopy.CopyOut(unsafe.Pointer(u), src)
+ gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(len(src)))
} else {
// Type UContext64 doesn't have a packed layout in memory, fallback to UnmarshalBytes.
u.UnmarshalBytes(src)
@@ -523,12 +522,12 @@ func (a *aarch64Ctx) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (a *aarch64Ctx) MarshalUnsafe(dst []byte) {
- safecopy.CopyIn(dst, unsafe.Pointer(a))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(a), uintptr(len(dst)))
}
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (a *aarch64Ctx) UnmarshalUnsafe(src []byte) {
- safecopy.CopyOut(unsafe.Pointer(a), src)
+ gohacks.Memmove(unsafe.Pointer(a), unsafe.Pointer(&src[0]), uintptr(len(src)))
}
// CopyOutN implements marshal.Marshallable.CopyOutN.