diff options
44 files changed, 889 insertions, 913 deletions
diff --git a/pkg/abi/linux/linux_abi_autogen_unsafe.go b/pkg/abi/linux/linux_abi_autogen_unsafe.go index 855b785b0..093f1804d 100644 --- a/pkg/abi/linux/linux_abi_autogen_unsafe.go +++ b/pkg/abi/linux/linux_abi_autogen_unsafe.go @@ -162,7 +162,7 @@ func (i *IOCallback) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *IOCallback) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *IOCallback) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -170,7 +170,7 @@ func (i *IOCallback) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -179,13 +179,13 @@ func (i *IOCallback) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *IOCallback) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *IOCallback) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *IOCallback) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *IOCallback) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -193,7 +193,7 @@ func (i *IOCallback) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -263,7 +263,7 @@ func (i *IOEvent) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *IOEvent) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *IOEvent) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -271,7 +271,7 @@ func (i *IOEvent) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -280,13 +280,13 @@ func (i *IOEvent) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *IOEvent) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *IOEvent) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *IOEvent) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *IOEvent) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -294,7 +294,7 @@ func (i *IOEvent) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -364,7 +364,7 @@ func (b *BPFInstruction) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (b *BPFInstruction) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (b *BPFInstruction) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -372,7 +372,7 @@ func (b *BPFInstruction) CopyOutN(task marshal.Task, addr usermem.Addr, limit in hdr.Len = b.SizeBytes() hdr.Cap = b.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that b // must live until the use above. runtime.KeepAlive(b) // escapes: replaced by intrinsic. @@ -381,13 +381,13 @@ func (b *BPFInstruction) CopyOutN(task marshal.Task, addr usermem.Addr, limit in // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (b *BPFInstruction) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return b.CopyOutN(task, addr, b.SizeBytes()) +func (b *BPFInstruction) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return b.CopyOutN(cc, addr, b.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (b *BPFInstruction) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (b *BPFInstruction) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -395,7 +395,7 @@ func (b *BPFInstruction) CopyIn(task marshal.Task, addr usermem.Addr) (int, erro hdr.Len = b.SizeBytes() hdr.Cap = b.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that b // must live until the use above. runtime.KeepAlive(b) // escapes: replaced by intrinsic. @@ -419,7 +419,7 @@ func (b *BPFInstruction) WriteTo(writer io.Writer) (int64, error) { } // CopyBPFInstructionSliceIn copies in a slice of BPFInstruction objects from the task's memory. -func CopyBPFInstructionSliceIn(task marshal.Task, addr usermem.Addr, dst []BPFInstruction) (int, error) { +func CopyBPFInstructionSliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []BPFInstruction) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -436,7 +436,7 @@ func CopyBPFInstructionSliceIn(task marshal.Task, addr usermem.Addr, dst []BPFIn hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) + length, err := cc.CopyInBytes(addr, buf) // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -444,7 +444,7 @@ func CopyBPFInstructionSliceIn(task marshal.Task, addr usermem.Addr, dst []BPFIn } // CopyBPFInstructionSliceOut copies a slice of BPFInstruction objects to the task's memory. -func CopyBPFInstructionSliceOut(task marshal.Task, addr usermem.Addr, src []BPFInstruction) (int, error) { +func CopyBPFInstructionSliceOut(cc marshal.CopyContext, addr usermem.Addr, src []BPFInstruction) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -461,7 +461,7 @@ func CopyBPFInstructionSliceOut(task marshal.Task, addr usermem.Addr, src []BPFI hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) + length, err := cc.CopyOutBytes(addr, buf) // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. @@ -543,7 +543,7 @@ func (c *CapUserHeader) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (c *CapUserHeader) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (c *CapUserHeader) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -551,7 +551,7 @@ func (c *CapUserHeader) CopyOutN(task marshal.Task, addr usermem.Addr, limit int hdr.Len = c.SizeBytes() hdr.Cap = c.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that c // must live until the use above. runtime.KeepAlive(c) // escapes: replaced by intrinsic. @@ -560,13 +560,13 @@ func (c *CapUserHeader) CopyOutN(task marshal.Task, addr usermem.Addr, limit int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (c *CapUserHeader) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return c.CopyOutN(task, addr, c.SizeBytes()) +func (c *CapUserHeader) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return c.CopyOutN(cc, addr, c.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (c *CapUserHeader) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (c *CapUserHeader) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -574,7 +574,7 @@ func (c *CapUserHeader) CopyIn(task marshal.Task, addr usermem.Addr) (int, error hdr.Len = c.SizeBytes() hdr.Cap = c.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that c // must live until the use above. runtime.KeepAlive(c) // escapes: replaced by intrinsic. @@ -640,7 +640,7 @@ func (c *CapUserData) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (c *CapUserData) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (c *CapUserData) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -648,7 +648,7 @@ func (c *CapUserData) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) hdr.Len = c.SizeBytes() hdr.Cap = c.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that c // must live until the use above. runtime.KeepAlive(c) // escapes: replaced by intrinsic. @@ -657,13 +657,13 @@ func (c *CapUserData) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (c *CapUserData) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return c.CopyOutN(task, addr, c.SizeBytes()) +func (c *CapUserData) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return c.CopyOutN(cc, addr, c.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (c *CapUserData) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (c *CapUserData) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -671,7 +671,7 @@ func (c *CapUserData) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) hdr.Len = c.SizeBytes() hdr.Cap = c.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that c // must live until the use above. runtime.KeepAlive(c) // escapes: replaced by intrinsic. @@ -695,7 +695,7 @@ func (c *CapUserData) WriteTo(writer io.Writer) (int64, error) { } // CopyCapUserDataSliceIn copies in a slice of CapUserData objects from the task's memory. -func CopyCapUserDataSliceIn(task marshal.Task, addr usermem.Addr, dst []CapUserData) (int, error) { +func CopyCapUserDataSliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []CapUserData) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -712,7 +712,7 @@ func CopyCapUserDataSliceIn(task marshal.Task, addr usermem.Addr, dst []CapUserD hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) + length, err := cc.CopyInBytes(addr, buf) // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -720,7 +720,7 @@ func CopyCapUserDataSliceIn(task marshal.Task, addr usermem.Addr, dst []CapUserD } // CopyCapUserDataSliceOut copies a slice of CapUserData objects to the task's memory. -func CopyCapUserDataSliceOut(task marshal.Task, addr usermem.Addr, src []CapUserData) (int, error) { +func CopyCapUserDataSliceOut(cc marshal.CopyContext, addr usermem.Addr, src []CapUserData) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -737,7 +737,7 @@ func CopyCapUserDataSliceOut(task marshal.Task, addr usermem.Addr, src []CapUser hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) + length, err := cc.CopyOutBytes(addr, buf) // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. @@ -841,7 +841,7 @@ func (f *Flock) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (f *Flock) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (f *Flock) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -849,7 +849,7 @@ func (f *Flock) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -858,13 +858,13 @@ func (f *Flock) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (f *Flock) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return f.CopyOutN(task, addr, f.SizeBytes()) +func (f *Flock) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return f.CopyOutN(cc, addr, f.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (f *Flock) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (f *Flock) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -872,7 +872,7 @@ func (f *Flock) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -934,7 +934,7 @@ func (f *FOwnerEx) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (f *FOwnerEx) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (f *FOwnerEx) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -942,7 +942,7 @@ func (f *FOwnerEx) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -951,13 +951,13 @@ func (f *FOwnerEx) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (f *FOwnerEx) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return f.CopyOutN(task, addr, f.SizeBytes()) +func (f *FOwnerEx) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return f.CopyOutN(cc, addr, f.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (f *FOwnerEx) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (f *FOwnerEx) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -965,7 +965,7 @@ func (f *FOwnerEx) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -1088,12 +1088,12 @@ func (s *Statx) UnmarshalBytes(src []byte) { // Packed implements marshal.Marshallable.Packed. //go:nosplit func (s *Statx) Packed() bool { - return s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() && s.Atime.Packed() + return s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() } // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. func (s *Statx) MarshalUnsafe(dst []byte) { - if s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() { + if s.Ctime.Packed() && s.Mtime.Packed() && s.Atime.Packed() && s.Btime.Packed() { safecopy.CopyIn(dst, unsafe.Pointer(s)) } else { // Type Statx doesn't have a packed layout in memory, fallback to MarshalBytes. @@ -1103,7 +1103,7 @@ func (s *Statx) MarshalUnsafe(dst []byte) { // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. func (s *Statx) UnmarshalUnsafe(src []byte) { - if s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() { + if s.Mtime.Packed() && s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() { safecopy.CopyOut(unsafe.Pointer(s), src) } else { // Type Statx doesn't have a packed layout in memory, fallback to UnmarshalBytes. @@ -1113,12 +1113,12 @@ func (s *Statx) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *Statx) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *Statx) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() { // Type Statx doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. s.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -1128,7 +1128,7 @@ func (s *Statx) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -1137,17 +1137,17 @@ func (s *Statx) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *Statx) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *Statx) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *Statx) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { - if !s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() && s.Atime.Packed() { +func (s *Statx) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + if !s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() { // Type Statx doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. s.UnmarshalBytes(buf) // escapes: fallback. @@ -1161,7 +1161,7 @@ func (s *Statx) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -1170,7 +1170,7 @@ func (s *Statx) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { // WriteTo implements io.WriterTo.WriteTo. func (s *Statx) WriteTo(writer io.Writer) (int64, error) { - if !s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() { + if !s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() && s.Atime.Packed() { // Type Statx doesn't have a packed layout in memory, fall back to MarshalBytes. buf := make([]byte, s.SizeBytes()) s.MarshalBytes(buf) @@ -1281,7 +1281,7 @@ func (s *Statfs) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *Statfs) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *Statfs) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -1289,7 +1289,7 @@ func (s *Statfs) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -1298,13 +1298,13 @@ func (s *Statfs) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *Statfs) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *Statfs) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *Statfs) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *Statfs) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -1312,7 +1312,7 @@ func (s *Statfs) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -1370,7 +1370,7 @@ func (f *FUSEOpcode) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (f *FUSEOpcode) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (f *FUSEOpcode) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -1378,7 +1378,7 @@ func (f *FUSEOpcode) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -1387,13 +1387,13 @@ func (f *FUSEOpcode) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (f *FUSEOpcode) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return f.CopyOutN(task, addr, f.SizeBytes()) +func (f *FUSEOpcode) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return f.CopyOutN(cc, addr, f.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (f *FUSEOpcode) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (f *FUSEOpcode) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -1401,7 +1401,7 @@ func (f *FUSEOpcode) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -1459,7 +1459,7 @@ func (f *FUSEOpID) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (f *FUSEOpID) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (f *FUSEOpID) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -1467,7 +1467,7 @@ func (f *FUSEOpID) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -1476,13 +1476,13 @@ func (f *FUSEOpID) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (f *FUSEOpID) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return f.CopyOutN(task, addr, f.SizeBytes()) +func (f *FUSEOpID) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return f.CopyOutN(cc, addr, f.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (f *FUSEOpID) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (f *FUSEOpID) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -1490,7 +1490,7 @@ func (f *FUSEOpID) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -1568,7 +1568,7 @@ func (f *FUSEHeaderIn) Packed() bool { // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. func (f *FUSEHeaderIn) MarshalUnsafe(dst []byte) { - if f.Opcode.Packed() && f.Unique.Packed() { + if f.Unique.Packed() && f.Opcode.Packed() { safecopy.CopyIn(dst, unsafe.Pointer(f)) } else { // Type FUSEHeaderIn doesn't have a packed layout in memory, fallback to MarshalBytes. @@ -1588,12 +1588,12 @@ func (f *FUSEHeaderIn) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (f *FUSEHeaderIn) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (f *FUSEHeaderIn) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !f.Opcode.Packed() && f.Unique.Packed() { // Type FUSEHeaderIn doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. f.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -1603,7 +1603,7 @@ func (f *FUSEHeaderIn) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -1612,17 +1612,17 @@ func (f *FUSEHeaderIn) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (f *FUSEHeaderIn) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return f.CopyOutN(task, addr, f.SizeBytes()) +func (f *FUSEHeaderIn) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return f.CopyOutN(cc, addr, f.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (f *FUSEHeaderIn) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (f *FUSEHeaderIn) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !f.Opcode.Packed() && f.Unique.Packed() { // Type FUSEHeaderIn doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. f.UnmarshalBytes(buf) // escapes: fallback. @@ -1636,7 +1636,7 @@ func (f *FUSEHeaderIn) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -1721,12 +1721,12 @@ func (f *FUSEHeaderOut) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (f *FUSEHeaderOut) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (f *FUSEHeaderOut) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !f.Unique.Packed() { // Type FUSEHeaderOut doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. f.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -1736,7 +1736,7 @@ func (f *FUSEHeaderOut) CopyOutN(task marshal.Task, addr usermem.Addr, limit int hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -1745,17 +1745,17 @@ func (f *FUSEHeaderOut) CopyOutN(task marshal.Task, addr usermem.Addr, limit int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (f *FUSEHeaderOut) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return f.CopyOutN(task, addr, f.SizeBytes()) +func (f *FUSEHeaderOut) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return f.CopyOutN(cc, addr, f.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (f *FUSEHeaderOut) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (f *FUSEHeaderOut) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !f.Unique.Packed() { // Type FUSEHeaderOut doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. f.UnmarshalBytes(buf) // escapes: fallback. @@ -1769,7 +1769,7 @@ func (f *FUSEHeaderOut) CopyIn(task marshal.Task, addr usermem.Addr) (int, error hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -1859,7 +1859,7 @@ func (f *FUSEWriteIn) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (f *FUSEWriteIn) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (f *FUSEWriteIn) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -1867,7 +1867,7 @@ func (f *FUSEWriteIn) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -1876,13 +1876,13 @@ func (f *FUSEWriteIn) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (f *FUSEWriteIn) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return f.CopyOutN(task, addr, f.SizeBytes()) +func (f *FUSEWriteIn) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return f.CopyOutN(cc, addr, f.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (f *FUSEWriteIn) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (f *FUSEWriteIn) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -1890,7 +1890,7 @@ func (f *FUSEWriteIn) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -1960,7 +1960,7 @@ func (f *FUSEInitIn) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (f *FUSEInitIn) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (f *FUSEInitIn) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -1968,7 +1968,7 @@ func (f *FUSEInitIn) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -1977,13 +1977,13 @@ func (f *FUSEInitIn) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (f *FUSEInitIn) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return f.CopyOutN(task, addr, f.SizeBytes()) +func (f *FUSEInitIn) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return f.CopyOutN(cc, addr, f.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (f *FUSEInitIn) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (f *FUSEInitIn) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -1991,7 +1991,7 @@ func (f *FUSEInitIn) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -2090,7 +2090,7 @@ func (f *FUSEInitOut) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (f *FUSEInitOut) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (f *FUSEInitOut) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -2098,7 +2098,7 @@ func (f *FUSEInitOut) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -2107,13 +2107,13 @@ func (f *FUSEInitOut) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (f *FUSEInitOut) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return f.CopyOutN(task, addr, f.SizeBytes()) +func (f *FUSEInitOut) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return f.CopyOutN(cc, addr, f.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (f *FUSEInitOut) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (f *FUSEInitOut) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -2121,7 +2121,7 @@ func (f *FUSEInitOut) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -2187,7 +2187,7 @@ func (f *FUSEGetAttrIn) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (f *FUSEGetAttrIn) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (f *FUSEGetAttrIn) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -2195,7 +2195,7 @@ func (f *FUSEGetAttrIn) CopyOutN(task marshal.Task, addr usermem.Addr, limit int hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -2204,13 +2204,13 @@ func (f *FUSEGetAttrIn) CopyOutN(task marshal.Task, addr usermem.Addr, limit int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (f *FUSEGetAttrIn) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return f.CopyOutN(task, addr, f.SizeBytes()) +func (f *FUSEGetAttrIn) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return f.CopyOutN(cc, addr, f.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (f *FUSEGetAttrIn) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (f *FUSEGetAttrIn) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -2218,7 +2218,7 @@ func (f *FUSEGetAttrIn) CopyIn(task marshal.Task, addr usermem.Addr) (int, error hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -2336,7 +2336,7 @@ func (f *FUSEAttr) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (f *FUSEAttr) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (f *FUSEAttr) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -2344,7 +2344,7 @@ func (f *FUSEAttr) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -2353,13 +2353,13 @@ func (f *FUSEAttr) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (f *FUSEAttr) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return f.CopyOutN(task, addr, f.SizeBytes()) +func (f *FUSEAttr) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return f.CopyOutN(cc, addr, f.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (f *FUSEAttr) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (f *FUSEAttr) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -2367,7 +2367,7 @@ func (f *FUSEAttr) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -2448,12 +2448,12 @@ func (f *FUSEGetAttrOut) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (f *FUSEGetAttrOut) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (f *FUSEGetAttrOut) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !f.Attr.Packed() { // Type FUSEGetAttrOut doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. f.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -2463,7 +2463,7 @@ func (f *FUSEGetAttrOut) CopyOutN(task marshal.Task, addr usermem.Addr, limit in hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -2472,17 +2472,17 @@ func (f *FUSEGetAttrOut) CopyOutN(task marshal.Task, addr usermem.Addr, limit in // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (f *FUSEGetAttrOut) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return f.CopyOutN(task, addr, f.SizeBytes()) +func (f *FUSEGetAttrOut) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return f.CopyOutN(cc, addr, f.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (f *FUSEGetAttrOut) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (f *FUSEGetAttrOut) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !f.Attr.Packed() { // Type FUSEGetAttrOut doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. f.UnmarshalBytes(buf) // escapes: fallback. @@ -2496,7 +2496,7 @@ func (f *FUSEGetAttrOut) CopyIn(task marshal.Task, addr usermem.Addr) (int, erro hdr.Len = f.SizeBytes() hdr.Cap = f.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that f // must live until the use above. runtime.KeepAlive(f) // escapes: replaced by intrinsic. @@ -2570,7 +2570,7 @@ func (r *RobustListHead) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (r *RobustListHead) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (r *RobustListHead) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -2578,7 +2578,7 @@ func (r *RobustListHead) CopyOutN(task marshal.Task, addr usermem.Addr, limit in hdr.Len = r.SizeBytes() hdr.Cap = r.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that r // must live until the use above. runtime.KeepAlive(r) // escapes: replaced by intrinsic. @@ -2587,13 +2587,13 @@ func (r *RobustListHead) CopyOutN(task marshal.Task, addr usermem.Addr, limit in // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (r *RobustListHead) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return r.CopyOutN(task, addr, r.SizeBytes()) +func (r *RobustListHead) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return r.CopyOutN(cc, addr, r.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (r *RobustListHead) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (r *RobustListHead) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -2601,7 +2601,7 @@ func (r *RobustListHead) CopyIn(task marshal.Task, addr usermem.Addr) (int, erro hdr.Len = r.SizeBytes() hdr.Cap = r.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that r // must live until the use above. runtime.KeepAlive(r) // escapes: replaced by intrinsic. @@ -2703,7 +2703,7 @@ func (i *IPCPerm) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *IPCPerm) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *IPCPerm) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -2711,7 +2711,7 @@ func (i *IPCPerm) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -2720,13 +2720,13 @@ func (i *IPCPerm) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *IPCPerm) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *IPCPerm) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *IPCPerm) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *IPCPerm) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -2734,7 +2734,7 @@ func (i *IPCPerm) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -2848,25 +2848,25 @@ func (s *Sysinfo) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *Sysinfo) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *Sysinfo) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Type Sysinfo doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. s.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *Sysinfo) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *Sysinfo) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *Sysinfo) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *Sysinfo) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Type Sysinfo doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. s.UnmarshalBytes(buf) // escapes: fallback. @@ -2917,7 +2917,7 @@ func (n *NumaPolicy) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (n *NumaPolicy) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (n *NumaPolicy) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -2925,7 +2925,7 @@ func (n *NumaPolicy) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( hdr.Len = n.SizeBytes() hdr.Cap = n.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that n // must live until the use above. runtime.KeepAlive(n) // escapes: replaced by intrinsic. @@ -2934,13 +2934,13 @@ func (n *NumaPolicy) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (n *NumaPolicy) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return n.CopyOutN(task, addr, n.SizeBytes()) +func (n *NumaPolicy) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return n.CopyOutN(cc, addr, n.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (n *NumaPolicy) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (n *NumaPolicy) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -2948,7 +2948,7 @@ func (n *NumaPolicy) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = n.SizeBytes() hdr.Cap = n.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that n // must live until the use above. runtime.KeepAlive(n) // escapes: replaced by intrinsic. @@ -3020,7 +3020,7 @@ func (i *IFReq) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *IFReq) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *IFReq) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -3028,7 +3028,7 @@ func (i *IFReq) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -3037,13 +3037,13 @@ func (i *IFReq) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *IFReq) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *IFReq) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *IFReq) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *IFReq) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -3051,7 +3051,7 @@ func (i *IFReq) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -3118,7 +3118,7 @@ func (i *IFConf) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *IFConf) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *IFConf) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -3126,7 +3126,7 @@ func (i *IFConf) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -3135,13 +3135,13 @@ func (i *IFConf) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *IFConf) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *IFConf) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *IFConf) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *IFConf) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -3149,7 +3149,7 @@ func (i *IFConf) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -3239,12 +3239,12 @@ func (i *IPTEntry) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *IPTEntry) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *IPTEntry) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !i.IP.Packed() && i.Counters.Packed() { // Type IPTEntry doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. i.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -3254,7 +3254,7 @@ func (i *IPTEntry) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -3263,17 +3263,17 @@ func (i *IPTEntry) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *IPTEntry) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *IPTEntry) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *IPTEntry) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *IPTEntry) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !i.IP.Packed() && i.Counters.Packed() { // Type IPTEntry doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. i.UnmarshalBytes(buf) // escapes: fallback. @@ -3287,7 +3287,7 @@ func (i *IPTEntry) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -3427,12 +3427,12 @@ func (i *IPTIP) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *IPTIP) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *IPTIP) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !i.Src.Packed() && i.Dst.Packed() && i.SrcMask.Packed() && i.DstMask.Packed() { // Type IPTIP doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. i.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -3442,7 +3442,7 @@ func (i *IPTIP) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -3451,17 +3451,17 @@ func (i *IPTIP) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *IPTIP) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *IPTIP) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *IPTIP) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { - if !i.SrcMask.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.Dst.Packed() { +func (i *IPTIP) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + if !i.Dst.Packed() && i.SrcMask.Packed() && i.DstMask.Packed() && i.Src.Packed() { // Type IPTIP doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. i.UnmarshalBytes(buf) // escapes: fallback. @@ -3475,7 +3475,7 @@ func (i *IPTIP) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -3484,7 +3484,7 @@ func (i *IPTIP) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { // WriteTo implements io.WriterTo.WriteTo. func (i *IPTIP) WriteTo(writer io.Writer) (int64, error) { - if !i.SrcMask.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.Dst.Packed() { + if !i.Src.Packed() && i.Dst.Packed() && i.SrcMask.Packed() && i.DstMask.Packed() { // Type IPTIP doesn't have a packed layout in memory, fall back to MarshalBytes. buf := make([]byte, i.SizeBytes()) i.MarshalBytes(buf) @@ -3545,7 +3545,7 @@ func (x *XTCounters) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (x *XTCounters) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (x *XTCounters) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -3553,7 +3553,7 @@ func (x *XTCounters) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( hdr.Len = x.SizeBytes() hdr.Cap = x.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that x // must live until the use above. runtime.KeepAlive(x) // escapes: replaced by intrinsic. @@ -3562,13 +3562,13 @@ func (x *XTCounters) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (x *XTCounters) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return x.CopyOutN(task, addr, x.SizeBytes()) +func (x *XTCounters) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return x.CopyOutN(cc, addr, x.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (x *XTCounters) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (x *XTCounters) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -3576,7 +3576,7 @@ func (x *XTCounters) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = x.SizeBytes() hdr.Cap = x.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that x // must live until the use above. runtime.KeepAlive(x) // escapes: replaced by intrinsic. @@ -3675,12 +3675,12 @@ func (i *IPTGetinfo) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *IPTGetinfo) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *IPTGetinfo) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !i.Name.Packed() { // Type IPTGetinfo doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. i.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -3690,7 +3690,7 @@ func (i *IPTGetinfo) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -3699,17 +3699,17 @@ func (i *IPTGetinfo) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *IPTGetinfo) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *IPTGetinfo) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *IPTGetinfo) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *IPTGetinfo) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !i.Name.Packed() { // Type IPTGetinfo doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. i.UnmarshalBytes(buf) // escapes: fallback. @@ -3723,7 +3723,7 @@ func (i *IPTGetinfo) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -3809,12 +3809,12 @@ func (i *IPTGetEntries) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *IPTGetEntries) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *IPTGetEntries) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !i.Name.Packed() { // Type IPTGetEntries doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. i.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -3824,7 +3824,7 @@ func (i *IPTGetEntries) CopyOutN(task marshal.Task, addr usermem.Addr, limit int hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -3833,17 +3833,17 @@ func (i *IPTGetEntries) CopyOutN(task marshal.Task, addr usermem.Addr, limit int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *IPTGetEntries) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *IPTGetEntries) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *IPTGetEntries) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *IPTGetEntries) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !i.Name.Packed() { // Type IPTGetEntries doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. i.UnmarshalBytes(buf) // escapes: fallback. @@ -3857,7 +3857,7 @@ func (i *IPTGetEntries) CopyIn(task marshal.Task, addr usermem.Addr) (int, error hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -3929,7 +3929,7 @@ func (t *TableName) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (t *TableName) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (t *TableName) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -3937,7 +3937,7 @@ func (t *TableName) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (i hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -3946,13 +3946,13 @@ func (t *TableName) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (i // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (t *TableName) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return t.CopyOutN(task, addr, t.SizeBytes()) +func (t *TableName) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return t.CopyOutN(cc, addr, t.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (t *TableName) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (t *TableName) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -3960,7 +3960,7 @@ func (t *TableName) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -4067,12 +4067,12 @@ func (i *IP6TReplace) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *IP6TReplace) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *IP6TReplace) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !i.Name.Packed() { // Type IP6TReplace doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. i.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -4082,7 +4082,7 @@ func (i *IP6TReplace) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -4091,17 +4091,17 @@ func (i *IP6TReplace) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *IP6TReplace) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *IP6TReplace) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *IP6TReplace) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *IP6TReplace) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !i.Name.Packed() { // Type IP6TReplace doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. i.UnmarshalBytes(buf) // escapes: fallback. @@ -4115,7 +4115,7 @@ func (i *IP6TReplace) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -4193,7 +4193,7 @@ func (i *IP6TEntry) UnmarshalBytes(src []byte) { // Packed implements marshal.Marshallable.Packed. //go:nosplit func (i *IP6TEntry) Packed() bool { - return i.Counters.Packed() && i.IPv6.Packed() + return i.IPv6.Packed() && i.Counters.Packed() } // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. @@ -4218,12 +4218,12 @@ func (i *IP6TEntry) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *IP6TEntry) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *IP6TEntry) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !i.IPv6.Packed() && i.Counters.Packed() { // Type IP6TEntry doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. i.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -4233,7 +4233,7 @@ func (i *IP6TEntry) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (i hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -4242,17 +4242,17 @@ func (i *IP6TEntry) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (i // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *IP6TEntry) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *IP6TEntry) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *IP6TEntry) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *IP6TEntry) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !i.IPv6.Packed() && i.Counters.Packed() { // Type IP6TEntry doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. i.UnmarshalBytes(buf) // escapes: fallback. @@ -4266,7 +4266,7 @@ func (i *IP6TEntry) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -4395,7 +4395,7 @@ func (i *IP6TIP) Packed() bool { // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. func (i *IP6TIP) MarshalUnsafe(dst []byte) { - if i.Dst.Packed() && i.SrcMask.Packed() && i.DstMask.Packed() && i.Src.Packed() { + if i.SrcMask.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.Dst.Packed() { safecopy.CopyIn(dst, unsafe.Pointer(i)) } else { // Type IP6TIP doesn't have a packed layout in memory, fallback to MarshalBytes. @@ -4415,12 +4415,12 @@ func (i *IP6TIP) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *IP6TIP) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { - if !i.DstMask.Packed() && i.Src.Packed() && i.Dst.Packed() && i.SrcMask.Packed() { +func (i *IP6TIP) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { + if !i.Src.Packed() && i.Dst.Packed() && i.SrcMask.Packed() && i.DstMask.Packed() { // Type IP6TIP doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. i.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -4430,7 +4430,7 @@ func (i *IP6TIP) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -4439,17 +4439,17 @@ func (i *IP6TIP) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *IP6TIP) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *IP6TIP) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *IP6TIP) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *IP6TIP) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !i.Src.Packed() && i.Dst.Packed() && i.SrcMask.Packed() && i.DstMask.Packed() { // Type IP6TIP doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. i.UnmarshalBytes(buf) // escapes: fallback. @@ -4463,7 +4463,7 @@ func (i *IP6TIP) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -4541,7 +4541,7 @@ func (s *SockAddrNetlink) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *SockAddrNetlink) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *SockAddrNetlink) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -4549,7 +4549,7 @@ func (s *SockAddrNetlink) CopyOutN(task marshal.Task, addr usermem.Addr, limit i hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -4558,13 +4558,13 @@ func (s *SockAddrNetlink) CopyOutN(task marshal.Task, addr usermem.Addr, limit i // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *SockAddrNetlink) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *SockAddrNetlink) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *SockAddrNetlink) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *SockAddrNetlink) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -4572,7 +4572,7 @@ func (s *SockAddrNetlink) CopyIn(task marshal.Task, addr usermem.Addr) (int, err hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -4638,7 +4638,7 @@ func (p *PollFD) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (p *PollFD) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (p *PollFD) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -4646,7 +4646,7 @@ func (p *PollFD) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = p.SizeBytes() hdr.Cap = p.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that p // must live until the use above. runtime.KeepAlive(p) // escapes: replaced by intrinsic. @@ -4655,13 +4655,13 @@ func (p *PollFD) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (p *PollFD) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return p.CopyOutN(task, addr, p.SizeBytes()) +func (p *PollFD) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return p.CopyOutN(cc, addr, p.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (p *PollFD) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (p *PollFD) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -4669,7 +4669,7 @@ func (p *PollFD) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = p.SizeBytes() hdr.Cap = p.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that p // must live until the use above. runtime.KeepAlive(p) // escapes: replaced by intrinsic. @@ -4693,7 +4693,7 @@ func (p *PollFD) WriteTo(writer io.Writer) (int64, error) { } // CopyPollFDSliceIn copies in a slice of PollFD objects from the task's memory. -func CopyPollFDSliceIn(task marshal.Task, addr usermem.Addr, dst []PollFD) (int, error) { +func CopyPollFDSliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []PollFD) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -4710,7 +4710,7 @@ func CopyPollFDSliceIn(task marshal.Task, addr usermem.Addr, dst []PollFD) (int, hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) + length, err := cc.CopyInBytes(addr, buf) // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -4718,7 +4718,7 @@ func CopyPollFDSliceIn(task marshal.Task, addr usermem.Addr, dst []PollFD) (int, } // CopyPollFDSliceOut copies a slice of PollFD objects to the task's memory. -func CopyPollFDSliceOut(task marshal.Task, addr usermem.Addr, src []PollFD) (int, error) { +func CopyPollFDSliceOut(cc marshal.CopyContext, addr usermem.Addr, src []PollFD) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -4735,7 +4735,7 @@ func CopyPollFDSliceOut(task marshal.Task, addr usermem.Addr, src []PollFD) (int hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) + length, err := cc.CopyOutBytes(addr, buf) // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. @@ -4829,7 +4829,7 @@ func (r *RSeqCriticalSection) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (r *RSeqCriticalSection) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (r *RSeqCriticalSection) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -4837,7 +4837,7 @@ func (r *RSeqCriticalSection) CopyOutN(task marshal.Task, addr usermem.Addr, lim hdr.Len = r.SizeBytes() hdr.Cap = r.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that r // must live until the use above. runtime.KeepAlive(r) // escapes: replaced by intrinsic. @@ -4846,13 +4846,13 @@ func (r *RSeqCriticalSection) CopyOutN(task marshal.Task, addr usermem.Addr, lim // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (r *RSeqCriticalSection) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return r.CopyOutN(task, addr, r.SizeBytes()) +func (r *RSeqCriticalSection) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return r.CopyOutN(cc, addr, r.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (r *RSeqCriticalSection) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (r *RSeqCriticalSection) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -4860,7 +4860,7 @@ func (r *RSeqCriticalSection) CopyIn(task marshal.Task, addr usermem.Addr) (int, hdr.Len = r.SizeBytes() hdr.Cap = r.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that r // must live until the use above. runtime.KeepAlive(r) // escapes: replaced by intrinsic. @@ -4970,7 +4970,7 @@ func (r *Rusage) Packed() bool { // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. func (r *Rusage) MarshalUnsafe(dst []byte) { - if r.STime.Packed() && r.UTime.Packed() { + if r.UTime.Packed() && r.STime.Packed() { safecopy.CopyIn(dst, unsafe.Pointer(r)) } else { // Type Rusage doesn't have a packed layout in memory, fallback to MarshalBytes. @@ -4980,7 +4980,7 @@ func (r *Rusage) MarshalUnsafe(dst []byte) { // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. func (r *Rusage) UnmarshalUnsafe(src []byte) { - if r.UTime.Packed() && r.STime.Packed() { + if r.STime.Packed() && r.UTime.Packed() { safecopy.CopyOut(unsafe.Pointer(r), src) } else { // Type Rusage doesn't have a packed layout in memory, fallback to UnmarshalBytes. @@ -4990,12 +4990,12 @@ func (r *Rusage) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (r *Rusage) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (r *Rusage) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !r.UTime.Packed() && r.STime.Packed() { // Type Rusage doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. r.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -5005,7 +5005,7 @@ func (r *Rusage) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = r.SizeBytes() hdr.Cap = r.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that r // must live until the use above. runtime.KeepAlive(r) // escapes: replaced by intrinsic. @@ -5014,17 +5014,17 @@ func (r *Rusage) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (r *Rusage) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return r.CopyOutN(task, addr, r.SizeBytes()) +func (r *Rusage) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return r.CopyOutN(cc, addr, r.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (r *Rusage) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (r *Rusage) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !r.UTime.Packed() && r.STime.Packed() { // Type Rusage doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. r.UnmarshalBytes(buf) // escapes: fallback. @@ -5038,7 +5038,7 @@ func (r *Rusage) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = r.SizeBytes() hdr.Cap = r.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that r // must live until the use above. runtime.KeepAlive(r) // escapes: replaced by intrinsic. @@ -5047,7 +5047,7 @@ func (r *Rusage) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { // WriteTo implements io.WriterTo.WriteTo. func (r *Rusage) WriteTo(writer io.Writer) (int64, error) { - if !r.UTime.Packed() && r.STime.Packed() { + if !r.STime.Packed() && r.UTime.Packed() { // Type Rusage doesn't have a packed layout in memory, fall back to MarshalBytes. buf := make([]byte, r.SizeBytes()) r.MarshalBytes(buf) @@ -5112,7 +5112,7 @@ func (s *SemidDS) UnmarshalBytes(src []byte) { // Packed implements marshal.Marshallable.Packed. //go:nosplit func (s *SemidDS) Packed() bool { - return s.SemCTime.Packed() && s.SemPerm.Packed() && s.SemOTime.Packed() + return s.SemPerm.Packed() && s.SemOTime.Packed() && s.SemCTime.Packed() } // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. @@ -5127,7 +5127,7 @@ func (s *SemidDS) MarshalUnsafe(dst []byte) { // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. func (s *SemidDS) UnmarshalUnsafe(src []byte) { - if s.SemPerm.Packed() && s.SemOTime.Packed() && s.SemCTime.Packed() { + if s.SemOTime.Packed() && s.SemCTime.Packed() && s.SemPerm.Packed() { safecopy.CopyOut(unsafe.Pointer(s), src) } else { // Type SemidDS doesn't have a packed layout in memory, fallback to UnmarshalBytes. @@ -5137,12 +5137,12 @@ func (s *SemidDS) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *SemidDS) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { - if !s.SemOTime.Packed() && s.SemCTime.Packed() && s.SemPerm.Packed() { +func (s *SemidDS) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { + if !s.SemPerm.Packed() && s.SemOTime.Packed() && s.SemCTime.Packed() { // Type SemidDS doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. s.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -5152,7 +5152,7 @@ func (s *SemidDS) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -5161,17 +5161,17 @@ func (s *SemidDS) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *SemidDS) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *SemidDS) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *SemidDS) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { - if !s.SemOTime.Packed() && s.SemCTime.Packed() && s.SemPerm.Packed() { +func (s *SemidDS) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + if !s.SemPerm.Packed() && s.SemOTime.Packed() && s.SemCTime.Packed() { // Type SemidDS doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. s.UnmarshalBytes(buf) // escapes: fallback. @@ -5185,7 +5185,7 @@ func (s *SemidDS) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -5259,7 +5259,7 @@ func (s *Sembuf) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *Sembuf) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *Sembuf) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -5267,7 +5267,7 @@ func (s *Sembuf) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -5276,13 +5276,13 @@ func (s *Sembuf) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *Sembuf) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *Sembuf) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *Sembuf) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *Sembuf) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -5290,7 +5290,7 @@ func (s *Sembuf) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -5314,7 +5314,7 @@ func (s *Sembuf) WriteTo(writer io.Writer) (int64, error) { } // CopySembufSliceIn copies in a slice of Sembuf objects from the task's memory. -func CopySembufSliceIn(task marshal.Task, addr usermem.Addr, dst []Sembuf) (int, error) { +func CopySembufSliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []Sembuf) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -5331,7 +5331,7 @@ func CopySembufSliceIn(task marshal.Task, addr usermem.Addr, dst []Sembuf) (int, hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) + length, err := cc.CopyInBytes(addr, buf) // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -5339,7 +5339,7 @@ func CopySembufSliceIn(task marshal.Task, addr usermem.Addr, dst []Sembuf) (int, } // CopySembufSliceOut copies a slice of Sembuf objects to the task's memory. -func CopySembufSliceOut(task marshal.Task, addr usermem.Addr, src []Sembuf) (int, error) { +func CopySembufSliceOut(cc marshal.CopyContext, addr usermem.Addr, src []Sembuf) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -5356,7 +5356,7 @@ func CopySembufSliceOut(task marshal.Task, addr usermem.Addr, src []Sembuf) (int hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) + length, err := cc.CopyOutBytes(addr, buf) // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. @@ -5459,12 +5459,12 @@ func (s *ShmidDS) UnmarshalBytes(src []byte) { // Packed implements marshal.Marshallable.Packed. //go:nosplit func (s *ShmidDS) Packed() bool { - return s.ShmPerm.Packed() && s.ShmAtime.Packed() && s.ShmDtime.Packed() && s.ShmCtime.Packed() + return s.ShmCtime.Packed() && s.ShmPerm.Packed() && s.ShmAtime.Packed() && s.ShmDtime.Packed() } // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. func (s *ShmidDS) MarshalUnsafe(dst []byte) { - if s.ShmDtime.Packed() && s.ShmCtime.Packed() && s.ShmPerm.Packed() && s.ShmAtime.Packed() { + if s.ShmPerm.Packed() && s.ShmAtime.Packed() && s.ShmDtime.Packed() && s.ShmCtime.Packed() { safecopy.CopyIn(dst, unsafe.Pointer(s)) } else { // Type ShmidDS doesn't have a packed layout in memory, fallback to MarshalBytes. @@ -5484,12 +5484,12 @@ func (s *ShmidDS) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *ShmidDS) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { - if !s.ShmCtime.Packed() && s.ShmPerm.Packed() && s.ShmAtime.Packed() && s.ShmDtime.Packed() { +func (s *ShmidDS) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { + if !s.ShmPerm.Packed() && s.ShmAtime.Packed() && s.ShmDtime.Packed() && s.ShmCtime.Packed() { // Type ShmidDS doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. s.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -5499,7 +5499,7 @@ func (s *ShmidDS) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -5508,17 +5508,17 @@ func (s *ShmidDS) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *ShmidDS) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *ShmidDS) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *ShmidDS) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { - if !s.ShmPerm.Packed() && s.ShmAtime.Packed() && s.ShmDtime.Packed() && s.ShmCtime.Packed() { +func (s *ShmidDS) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + if !s.ShmCtime.Packed() && s.ShmPerm.Packed() && s.ShmAtime.Packed() && s.ShmDtime.Packed() { // Type ShmidDS doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. s.UnmarshalBytes(buf) // escapes: fallback. @@ -5532,7 +5532,7 @@ func (s *ShmidDS) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -5614,7 +5614,7 @@ func (s *ShmParams) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *ShmParams) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *ShmParams) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -5622,7 +5622,7 @@ func (s *ShmParams) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (i hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -5631,13 +5631,13 @@ func (s *ShmParams) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (i // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *ShmParams) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *ShmParams) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *ShmParams) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *ShmParams) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -5645,7 +5645,7 @@ func (s *ShmParams) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -5728,7 +5728,7 @@ func (s *ShmInfo) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *ShmInfo) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *ShmInfo) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -5736,7 +5736,7 @@ func (s *ShmInfo) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -5745,13 +5745,13 @@ func (s *ShmInfo) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *ShmInfo) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *ShmInfo) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *ShmInfo) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *ShmInfo) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -5759,7 +5759,7 @@ func (s *ShmInfo) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -5817,7 +5817,7 @@ func (s *SignalSet) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *SignalSet) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *SignalSet) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -5825,7 +5825,7 @@ func (s *SignalSet) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (i hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -5834,13 +5834,13 @@ func (s *SignalSet) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (i // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *SignalSet) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *SignalSet) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *SignalSet) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *SignalSet) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -5848,7 +5848,7 @@ func (s *SignalSet) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -5927,7 +5927,7 @@ func (s *Sigevent) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *Sigevent) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *Sigevent) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -5935,7 +5935,7 @@ func (s *Sigevent) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -5944,13 +5944,13 @@ func (s *Sigevent) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *Sigevent) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *Sigevent) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *Sigevent) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *Sigevent) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -5958,7 +5958,7 @@ func (s *Sigevent) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -6022,7 +6022,7 @@ func (i *InetAddr) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *InetAddr) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *InetAddr) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -6030,7 +6030,7 @@ func (i *InetAddr) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -6039,13 +6039,13 @@ func (i *InetAddr) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *InetAddr) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *InetAddr) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *InetAddr) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *InetAddr) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -6053,7 +6053,7 @@ func (i *InetAddr) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -6135,12 +6135,12 @@ func (s *SockAddrInet) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *SockAddrInet) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *SockAddrInet) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !s.Addr.Packed() { // Type SockAddrInet doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. s.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -6150,7 +6150,7 @@ func (s *SockAddrInet) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -6159,17 +6159,17 @@ func (s *SockAddrInet) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *SockAddrInet) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *SockAddrInet) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *SockAddrInet) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *SockAddrInet) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !s.Addr.Packed() { // Type SockAddrInet doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. s.UnmarshalBytes(buf) // escapes: fallback. @@ -6183,7 +6183,7 @@ func (s *SockAddrInet) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -6255,7 +6255,7 @@ func (i *Inet6Addr) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *Inet6Addr) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *Inet6Addr) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -6263,7 +6263,7 @@ func (i *Inet6Addr) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (i hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -6272,13 +6272,13 @@ func (i *Inet6Addr) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (i // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *Inet6Addr) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *Inet6Addr) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *Inet6Addr) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *Inet6Addr) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -6286,7 +6286,7 @@ func (i *Inet6Addr) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -6365,7 +6365,7 @@ func (s *SockAddrInet6) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *SockAddrInet6) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *SockAddrInet6) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -6373,7 +6373,7 @@ func (s *SockAddrInet6) CopyOutN(task marshal.Task, addr usermem.Addr, limit int hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -6382,13 +6382,13 @@ func (s *SockAddrInet6) CopyOutN(task marshal.Task, addr usermem.Addr, limit int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *SockAddrInet6) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *SockAddrInet6) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *SockAddrInet6) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *SockAddrInet6) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -6396,7 +6396,7 @@ func (s *SockAddrInet6) CopyIn(task marshal.Task, addr usermem.Addr) (int, error hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -6483,7 +6483,7 @@ func (s *SockAddrLink) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *SockAddrLink) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *SockAddrLink) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -6491,7 +6491,7 @@ func (s *SockAddrLink) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -6500,13 +6500,13 @@ func (s *SockAddrLink) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *SockAddrLink) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *SockAddrLink) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *SockAddrLink) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *SockAddrLink) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -6514,7 +6514,7 @@ func (s *SockAddrLink) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -6581,7 +6581,7 @@ func (s *SockAddrUnix) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *SockAddrUnix) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *SockAddrUnix) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -6589,7 +6589,7 @@ func (s *SockAddrUnix) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -6598,13 +6598,13 @@ func (s *SockAddrUnix) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *SockAddrUnix) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *SockAddrUnix) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *SockAddrUnix) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *SockAddrUnix) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -6612,7 +6612,7 @@ func (s *SockAddrUnix) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -6674,7 +6674,7 @@ func (l *Linger) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (l *Linger) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (l *Linger) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -6682,7 +6682,7 @@ func (l *Linger) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = l.SizeBytes() hdr.Cap = l.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that l // must live until the use above. runtime.KeepAlive(l) // escapes: replaced by intrinsic. @@ -6691,13 +6691,13 @@ func (l *Linger) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (l *Linger) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return l.CopyOutN(task, addr, l.SizeBytes()) +func (l *Linger) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return l.CopyOutN(cc, addr, l.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (l *Linger) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (l *Linger) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -6705,7 +6705,7 @@ func (l *Linger) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = l.SizeBytes() hdr.Cap = l.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that l // must live until the use above. runtime.KeepAlive(l) // escapes: replaced by intrinsic. @@ -6943,7 +6943,7 @@ func (t *TCPInfo) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (t *TCPInfo) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (t *TCPInfo) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -6951,7 +6951,7 @@ func (t *TCPInfo) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -6960,13 +6960,13 @@ func (t *TCPInfo) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (t *TCPInfo) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return t.CopyOutN(task, addr, t.SizeBytes()) +func (t *TCPInfo) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return t.CopyOutN(cc, addr, t.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (t *TCPInfo) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (t *TCPInfo) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -6974,7 +6974,7 @@ func (t *TCPInfo) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -7040,7 +7040,7 @@ func (c *ControlMessageCredentials) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (c *ControlMessageCredentials) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (c *ControlMessageCredentials) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -7048,7 +7048,7 @@ func (c *ControlMessageCredentials) CopyOutN(task marshal.Task, addr usermem.Add hdr.Len = c.SizeBytes() hdr.Cap = c.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that c // must live until the use above. runtime.KeepAlive(c) // escapes: replaced by intrinsic. @@ -7057,13 +7057,13 @@ func (c *ControlMessageCredentials) CopyOutN(task marshal.Task, addr usermem.Add // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (c *ControlMessageCredentials) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return c.CopyOutN(task, addr, c.SizeBytes()) +func (c *ControlMessageCredentials) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return c.CopyOutN(cc, addr, c.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (c *ControlMessageCredentials) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (c *ControlMessageCredentials) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -7071,7 +7071,7 @@ func (c *ControlMessageCredentials) CopyIn(task marshal.Task, addr usermem.Addr) hdr.Len = c.SizeBytes() hdr.Cap = c.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that c // must live until the use above. runtime.KeepAlive(c) // escapes: replaced by intrinsic. @@ -7129,7 +7129,7 @@ func (t *TimeT) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (t *TimeT) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (t *TimeT) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -7137,7 +7137,7 @@ func (t *TimeT) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -7146,13 +7146,13 @@ func (t *TimeT) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (t *TimeT) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return t.CopyOutN(task, addr, t.SizeBytes()) +func (t *TimeT) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return t.CopyOutN(cc, addr, t.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (t *TimeT) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (t *TimeT) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -7160,7 +7160,7 @@ func (t *TimeT) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -7222,7 +7222,7 @@ func (t *Timespec) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (t *Timespec) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (t *Timespec) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -7230,7 +7230,7 @@ func (t *Timespec) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -7239,13 +7239,13 @@ func (t *Timespec) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (t *Timespec) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return t.CopyOutN(task, addr, t.SizeBytes()) +func (t *Timespec) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return t.CopyOutN(cc, addr, t.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (t *Timespec) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (t *Timespec) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -7253,7 +7253,7 @@ func (t *Timespec) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -7277,7 +7277,7 @@ func (t *Timespec) WriteTo(writer io.Writer) (int64, error) { } // CopyTimespecSliceIn copies in a slice of Timespec objects from the task's memory. -func CopyTimespecSliceIn(task marshal.Task, addr usermem.Addr, dst []Timespec) (int, error) { +func CopyTimespecSliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []Timespec) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -7294,7 +7294,7 @@ func CopyTimespecSliceIn(task marshal.Task, addr usermem.Addr, dst []Timespec) ( hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) + length, err := cc.CopyInBytes(addr, buf) // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -7302,7 +7302,7 @@ func CopyTimespecSliceIn(task marshal.Task, addr usermem.Addr, dst []Timespec) ( } // CopyTimespecSliceOut copies a slice of Timespec objects to the task's memory. -func CopyTimespecSliceOut(task marshal.Task, addr usermem.Addr, src []Timespec) (int, error) { +func CopyTimespecSliceOut(cc marshal.CopyContext, addr usermem.Addr, src []Timespec) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -7319,7 +7319,7 @@ func CopyTimespecSliceOut(task marshal.Task, addr usermem.Addr, src []Timespec) hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) + length, err := cc.CopyOutBytes(addr, buf) // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. @@ -7401,7 +7401,7 @@ func (t *Timeval) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (t *Timeval) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (t *Timeval) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -7409,7 +7409,7 @@ func (t *Timeval) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -7418,13 +7418,13 @@ func (t *Timeval) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (t *Timeval) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return t.CopyOutN(task, addr, t.SizeBytes()) +func (t *Timeval) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return t.CopyOutN(cc, addr, t.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (t *Timeval) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (t *Timeval) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -7432,7 +7432,7 @@ func (t *Timeval) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -7456,7 +7456,7 @@ func (t *Timeval) WriteTo(writer io.Writer) (int64, error) { } // CopyTimevalSliceIn copies in a slice of Timeval objects from the task's memory. -func CopyTimevalSliceIn(task marshal.Task, addr usermem.Addr, dst []Timeval) (int, error) { +func CopyTimevalSliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []Timeval) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -7473,7 +7473,7 @@ func CopyTimevalSliceIn(task marshal.Task, addr usermem.Addr, dst []Timeval) (in hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) + length, err := cc.CopyInBytes(addr, buf) // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -7481,7 +7481,7 @@ func CopyTimevalSliceIn(task marshal.Task, addr usermem.Addr, dst []Timeval) (in } // CopyTimevalSliceOut copies a slice of Timeval objects to the task's memory. -func CopyTimevalSliceOut(task marshal.Task, addr usermem.Addr, src []Timeval) (int, error) { +func CopyTimevalSliceOut(cc marshal.CopyContext, addr usermem.Addr, src []Timeval) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -7498,7 +7498,7 @@ func CopyTimevalSliceOut(task marshal.Task, addr usermem.Addr, src []Timeval) (i hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) + length, err := cc.CopyOutBytes(addr, buf) // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. @@ -7592,12 +7592,12 @@ func (i *Itimerspec) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *Itimerspec) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { - if !i.Interval.Packed() && i.Value.Packed() { +func (i *Itimerspec) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { + if !i.Value.Packed() && i.Interval.Packed() { // Type Itimerspec doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. i.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -7607,7 +7607,7 @@ func (i *Itimerspec) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -7616,17 +7616,17 @@ func (i *Itimerspec) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *Itimerspec) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *Itimerspec) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *Itimerspec) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *Itimerspec) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !i.Interval.Packed() && i.Value.Packed() { // Type Itimerspec doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. i.UnmarshalBytes(buf) // escapes: fallback. @@ -7640,7 +7640,7 @@ func (i *Itimerspec) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -7722,12 +7722,12 @@ func (i *ItimerVal) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *ItimerVal) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *ItimerVal) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !i.Interval.Packed() && i.Value.Packed() { // Type ItimerVal doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. i.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -7737,7 +7737,7 @@ func (i *ItimerVal) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (i hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -7746,17 +7746,17 @@ func (i *ItimerVal) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (i // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *ItimerVal) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *ItimerVal) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *ItimerVal) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *ItimerVal) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !i.Interval.Packed() && i.Value.Packed() { // Type ItimerVal doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. i.UnmarshalBytes(buf) // escapes: fallback. @@ -7770,7 +7770,7 @@ func (i *ItimerVal) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -7836,7 +7836,7 @@ func (c *ClockT) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (c *ClockT) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (c *ClockT) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -7844,7 +7844,7 @@ func (c *ClockT) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = c.SizeBytes() hdr.Cap = c.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that c // must live until the use above. runtime.KeepAlive(c) // escapes: replaced by intrinsic. @@ -7853,13 +7853,13 @@ func (c *ClockT) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (c *ClockT) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return c.CopyOutN(task, addr, c.SizeBytes()) +func (c *ClockT) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return c.CopyOutN(cc, addr, c.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (c *ClockT) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (c *ClockT) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -7867,7 +7867,7 @@ func (c *ClockT) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = c.SizeBytes() hdr.Cap = c.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that c // must live until the use above. runtime.KeepAlive(c) // escapes: replaced by intrinsic. @@ -7931,7 +7931,7 @@ func (t *Tms) Packed() bool { // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. func (t *Tms) MarshalUnsafe(dst []byte) { - if t.STime.Packed() && t.CUTime.Packed() && t.CSTime.Packed() && t.UTime.Packed() { + if t.UTime.Packed() && t.STime.Packed() && t.CUTime.Packed() && t.CSTime.Packed() { safecopy.CopyIn(dst, unsafe.Pointer(t)) } else { // Type Tms doesn't have a packed layout in memory, fallback to MarshalBytes. @@ -7951,12 +7951,12 @@ func (t *Tms) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (t *Tms) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (t *Tms) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !t.CUTime.Packed() && t.CSTime.Packed() && t.UTime.Packed() && t.STime.Packed() { // Type Tms doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(t.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(t.SizeBytes()) // escapes: okay. t.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -7966,7 +7966,7 @@ func (t *Tms) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, er hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -7975,17 +7975,17 @@ func (t *Tms) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, er // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (t *Tms) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return t.CopyOutN(task, addr, t.SizeBytes()) +func (t *Tms) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return t.CopyOutN(cc, addr, t.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (t *Tms) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (t *Tms) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !t.UTime.Packed() && t.STime.Packed() && t.CUTime.Packed() && t.CSTime.Packed() { // Type Tms doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(t.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(t.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. t.UnmarshalBytes(buf) // escapes: fallback. @@ -7999,7 +7999,7 @@ func (t *Tms) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -8065,7 +8065,7 @@ func (t *TimerID) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (t *TimerID) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (t *TimerID) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -8073,7 +8073,7 @@ func (t *TimerID) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -8082,13 +8082,13 @@ func (t *TimerID) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (t *TimerID) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return t.CopyOutN(task, addr, t.SizeBytes()) +func (t *TimerID) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return t.CopyOutN(cc, addr, t.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (t *TimerID) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (t *TimerID) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -8096,7 +8096,7 @@ func (t *TimerID) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -8162,7 +8162,7 @@ func (s *StatxTimestamp) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *StatxTimestamp) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *StatxTimestamp) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -8170,7 +8170,7 @@ func (s *StatxTimestamp) CopyOutN(task marshal.Task, addr usermem.Addr, limit in hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -8179,13 +8179,13 @@ func (s *StatxTimestamp) CopyOutN(task marshal.Task, addr usermem.Addr, limit in // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *StatxTimestamp) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *StatxTimestamp) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *StatxTimestamp) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *StatxTimestamp) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -8193,7 +8193,7 @@ func (s *StatxTimestamp) CopyIn(task marshal.Task, addr usermem.Addr) (int, erro hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -8255,7 +8255,7 @@ func (u *Utime) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (u *Utime) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (u *Utime) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -8263,7 +8263,7 @@ func (u *Utime) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = u.SizeBytes() hdr.Cap = u.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that u // must live until the use above. runtime.KeepAlive(u) // escapes: replaced by intrinsic. @@ -8272,13 +8272,13 @@ func (u *Utime) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (u *Utime) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return u.CopyOutN(task, addr, u.SizeBytes()) +func (u *Utime) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return u.CopyOutN(cc, addr, u.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (u *Utime) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (u *Utime) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -8286,7 +8286,7 @@ func (u *Utime) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = u.SizeBytes() hdr.Cap = u.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that u // must live until the use above. runtime.KeepAlive(u) // escapes: replaced by intrinsic. @@ -8356,7 +8356,7 @@ func (w *Winsize) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (w *Winsize) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (w *Winsize) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -8364,7 +8364,7 @@ func (w *Winsize) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int hdr.Len = w.SizeBytes() hdr.Cap = w.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that w // must live until the use above. runtime.KeepAlive(w) // escapes: replaced by intrinsic. @@ -8373,13 +8373,13 @@ func (w *Winsize) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (w *Winsize) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return w.CopyOutN(task, addr, w.SizeBytes()) +func (w *Winsize) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return w.CopyOutN(cc, addr, w.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (w *Winsize) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (w *Winsize) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -8387,7 +8387,7 @@ func (w *Winsize) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = w.SizeBytes() hdr.Cap = w.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that w // must live until the use above. runtime.KeepAlive(w) // escapes: replaced by intrinsic. @@ -8470,7 +8470,7 @@ func (t *Termios) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (t *Termios) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (t *Termios) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -8478,7 +8478,7 @@ func (t *Termios) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -8487,13 +8487,13 @@ func (t *Termios) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (t *Termios) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return t.CopyOutN(task, addr, t.SizeBytes()) +func (t *Termios) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return t.CopyOutN(cc, addr, t.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (t *Termios) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (t *Termios) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -8501,7 +8501,7 @@ func (t *Termios) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -8568,7 +8568,7 @@ func (w *WindowSize) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (w *WindowSize) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (w *WindowSize) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -8576,7 +8576,7 @@ func (w *WindowSize) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( hdr.Len = w.SizeBytes() hdr.Cap = w.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that w // must live until the use above. runtime.KeepAlive(w) // escapes: replaced by intrinsic. @@ -8585,13 +8585,13 @@ func (w *WindowSize) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (w *WindowSize) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return w.CopyOutN(task, addr, w.SizeBytes()) +func (w *WindowSize) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return w.CopyOutN(cc, addr, w.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (w *WindowSize) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (w *WindowSize) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -8599,7 +8599,7 @@ func (w *WindowSize) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = w.SizeBytes() hdr.Cap = w.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that w // must live until the use above. runtime.KeepAlive(w) // escapes: replaced by intrinsic. @@ -8707,7 +8707,7 @@ func (u *UtsName) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (u *UtsName) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (u *UtsName) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -8715,7 +8715,7 @@ func (u *UtsName) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int hdr.Len = u.SizeBytes() hdr.Cap = u.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that u // must live until the use above. runtime.KeepAlive(u) // escapes: replaced by intrinsic. @@ -8724,13 +8724,13 @@ func (u *UtsName) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (u *UtsName) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return u.CopyOutN(task, addr, u.SizeBytes()) +func (u *UtsName) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return u.CopyOutN(cc, addr, u.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (u *UtsName) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (u *UtsName) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -8738,7 +8738,7 @@ func (u *UtsName) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = u.SizeBytes() hdr.Cap = u.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that u // must live until the use above. runtime.KeepAlive(u) // escapes: replaced by intrinsic. diff --git a/pkg/abi/linux/linux_amd64_abi_autogen_unsafe.go b/pkg/abi/linux/linux_amd64_abi_autogen_unsafe.go index 05ec85c44..e2cf089be 100644 --- a/pkg/abi/linux/linux_amd64_abi_autogen_unsafe.go +++ b/pkg/abi/linux/linux_amd64_abi_autogen_unsafe.go @@ -68,7 +68,7 @@ func (e *EpollEvent) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (e *EpollEvent) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (e *EpollEvent) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -76,7 +76,7 @@ func (e *EpollEvent) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( hdr.Len = e.SizeBytes() hdr.Cap = e.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that e // must live until the use above. runtime.KeepAlive(e) // escapes: replaced by intrinsic. @@ -85,13 +85,13 @@ func (e *EpollEvent) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (e *EpollEvent) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return e.CopyOutN(task, addr, e.SizeBytes()) +func (e *EpollEvent) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return e.CopyOutN(cc, addr, e.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (e *EpollEvent) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (e *EpollEvent) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -99,7 +99,7 @@ func (e *EpollEvent) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = e.SizeBytes() hdr.Cap = e.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that e // must live until the use above. runtime.KeepAlive(e) // escapes: replaced by intrinsic. @@ -123,7 +123,7 @@ func (e *EpollEvent) WriteTo(writer io.Writer) (int64, error) { } // CopyEpollEventSliceIn copies in a slice of EpollEvent objects from the task's memory. -func CopyEpollEventSliceIn(task marshal.Task, addr usermem.Addr, dst []EpollEvent) (int, error) { +func CopyEpollEventSliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []EpollEvent) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -140,7 +140,7 @@ func CopyEpollEventSliceIn(task marshal.Task, addr usermem.Addr, dst []EpollEven hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) + length, err := cc.CopyInBytes(addr, buf) // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -148,7 +148,7 @@ func CopyEpollEventSliceIn(task marshal.Task, addr usermem.Addr, dst []EpollEven } // CopyEpollEventSliceOut copies a slice of EpollEvent objects to the task's memory. -func CopyEpollEventSliceOut(task marshal.Task, addr usermem.Addr, src []EpollEvent) (int, error) { +func CopyEpollEventSliceOut(cc marshal.CopyContext, addr usermem.Addr, src []EpollEvent) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -165,7 +165,7 @@ func CopyEpollEventSliceOut(task marshal.Task, addr usermem.Addr, src []EpollEve hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) + length, err := cc.CopyOutBytes(addr, buf) // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. @@ -288,7 +288,7 @@ func (s *Stat) UnmarshalBytes(src []byte) { // Packed implements marshal.Marshallable.Packed. //go:nosplit func (s *Stat) Packed() bool { - return s.CTime.Packed() && s.ATime.Packed() && s.MTime.Packed() + return s.ATime.Packed() && s.MTime.Packed() && s.CTime.Packed() } // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. @@ -313,12 +313,12 @@ func (s *Stat) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *Stat) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *Stat) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !s.MTime.Packed() && s.CTime.Packed() && s.ATime.Packed() { // Type Stat doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. s.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -328,7 +328,7 @@ func (s *Stat) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, e hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -337,17 +337,17 @@ func (s *Stat) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, e // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *Stat) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *Stat) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *Stat) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { - if !s.CTime.Packed() && s.ATime.Packed() && s.MTime.Packed() { +func (s *Stat) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + if !s.MTime.Packed() && s.CTime.Packed() && s.ATime.Packed() { // Type Stat doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. s.UnmarshalBytes(buf) // escapes: fallback. @@ -361,7 +361,7 @@ func (s *Stat) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -531,7 +531,7 @@ func (p *PtraceRegs) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (p *PtraceRegs) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (p *PtraceRegs) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -539,7 +539,7 @@ func (p *PtraceRegs) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( hdr.Len = p.SizeBytes() hdr.Cap = p.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that p // must live until the use above. runtime.KeepAlive(p) // escapes: replaced by intrinsic. @@ -548,13 +548,13 @@ func (p *PtraceRegs) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (p *PtraceRegs) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return p.CopyOutN(task, addr, p.SizeBytes()) +func (p *PtraceRegs) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return p.CopyOutN(cc, addr, p.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (p *PtraceRegs) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (p *PtraceRegs) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -562,7 +562,7 @@ func (p *PtraceRegs) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = p.SizeBytes() hdr.Cap = p.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that p // must live until the use above. runtime.KeepAlive(p) // escapes: replaced by intrinsic. diff --git a/pkg/abi/linux/linux_arm64_abi_autogen_unsafe.go b/pkg/abi/linux/linux_arm64_abi_autogen_unsafe.go index 3d399d1d9..b99b5c105 100644 --- a/pkg/abi/linux/linux_arm64_abi_autogen_unsafe.go +++ b/pkg/abi/linux/linux_arm64_abi_autogen_unsafe.go @@ -71,7 +71,7 @@ func (e *EpollEvent) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (e *EpollEvent) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (e *EpollEvent) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -79,7 +79,7 @@ func (e *EpollEvent) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( hdr.Len = e.SizeBytes() hdr.Cap = e.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that e // must live until the use above. runtime.KeepAlive(e) // escapes: replaced by intrinsic. @@ -88,13 +88,13 @@ func (e *EpollEvent) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (e *EpollEvent) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return e.CopyOutN(task, addr, e.SizeBytes()) +func (e *EpollEvent) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return e.CopyOutN(cc, addr, e.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (e *EpollEvent) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (e *EpollEvent) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -102,7 +102,7 @@ func (e *EpollEvent) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = e.SizeBytes() hdr.Cap = e.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that e // must live until the use above. runtime.KeepAlive(e) // escapes: replaced by intrinsic. @@ -126,7 +126,7 @@ func (e *EpollEvent) WriteTo(writer io.Writer) (int64, error) { } // CopyEpollEventSliceIn copies in a slice of EpollEvent objects from the task's memory. -func CopyEpollEventSliceIn(task marshal.Task, addr usermem.Addr, dst []EpollEvent) (int, error) { +func CopyEpollEventSliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []EpollEvent) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -143,7 +143,7 @@ func CopyEpollEventSliceIn(task marshal.Task, addr usermem.Addr, dst []EpollEven hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) + length, err := cc.CopyInBytes(addr, buf) // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -151,7 +151,7 @@ func CopyEpollEventSliceIn(task marshal.Task, addr usermem.Addr, dst []EpollEven } // CopyEpollEventSliceOut copies a slice of EpollEvent objects to the task's memory. -func CopyEpollEventSliceOut(task marshal.Task, addr usermem.Addr, src []EpollEvent) (int, error) { +func CopyEpollEventSliceOut(cc marshal.CopyContext, addr usermem.Addr, src []EpollEvent) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -168,7 +168,7 @@ func CopyEpollEventSliceOut(task marshal.Task, addr usermem.Addr, src []EpollEve hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) + length, err := cc.CopyOutBytes(addr, buf) // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. @@ -295,7 +295,7 @@ func (s *Stat) UnmarshalBytes(src []byte) { // Packed implements marshal.Marshallable.Packed. //go:nosplit func (s *Stat) Packed() bool { - return s.ATime.Packed() && s.MTime.Packed() && s.CTime.Packed() + return s.MTime.Packed() && s.CTime.Packed() && s.ATime.Packed() } // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. @@ -320,12 +320,12 @@ func (s *Stat) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *Stat) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { - if !s.ATime.Packed() && s.MTime.Packed() && s.CTime.Packed() { +func (s *Stat) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { + if !s.CTime.Packed() && s.ATime.Packed() && s.MTime.Packed() { // Type Stat doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. s.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -335,7 +335,7 @@ func (s *Stat) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, e hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -344,17 +344,17 @@ func (s *Stat) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, e // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *Stat) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *Stat) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *Stat) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { - if !s.ATime.Packed() && s.MTime.Packed() && s.CTime.Packed() { +func (s *Stat) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + if !s.MTime.Packed() && s.CTime.Packed() && s.ATime.Packed() { // Type Stat doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. s.UnmarshalBytes(buf) // escapes: fallback. @@ -368,7 +368,7 @@ func (s *Stat) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -451,7 +451,7 @@ func (p *PtraceRegs) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (p *PtraceRegs) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (p *PtraceRegs) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -459,7 +459,7 @@ func (p *PtraceRegs) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( hdr.Len = p.SizeBytes() hdr.Cap = p.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that p // must live until the use above. runtime.KeepAlive(p) // escapes: replaced by intrinsic. @@ -468,13 +468,13 @@ func (p *PtraceRegs) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (p *PtraceRegs) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return p.CopyOutN(task, addr, p.SizeBytes()) +func (p *PtraceRegs) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return p.CopyOutN(cc, addr, p.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (p *PtraceRegs) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (p *PtraceRegs) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -482,7 +482,7 @@ func (p *PtraceRegs) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = p.SizeBytes() hdr.Cap = p.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that p // must live until the use above. runtime.KeepAlive(p) // escapes: replaced by intrinsic. diff --git a/pkg/abi/linux/netfilter.go b/pkg/abi/linux/netfilter.go index 6ef91b402..1c5b34711 100644 --- a/pkg/abi/linux/netfilter.go +++ b/pkg/abi/linux/netfilter.go @@ -450,9 +450,9 @@ func (ke *KernelIPTGetEntries) UnmarshalUnsafe(src []byte) { } // CopyIn implements marshal.Marshallable.CopyIn. -func (ke *KernelIPTGetEntries) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { - buf := task.CopyScratchBuffer(ke.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. +func (ke *KernelIPTGetEntries) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + buf := cc.CopyScratchBuffer(ke.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. ke.UnmarshalBytes(buf) // escapes: fallback. @@ -460,21 +460,21 @@ func (ke *KernelIPTGetEntries) CopyIn(task marshal.Task, addr usermem.Addr) (int } // CopyOut implements marshal.Marshallable.CopyOut. -func (ke *KernelIPTGetEntries) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { +func (ke *KernelIPTGetEntries) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Type KernelIPTGetEntries doesn't have a packed layout in memory, fall // back to MarshalBytes. - return task.CopyOutBytes(addr, ke.marshalAll(task)) + return cc.CopyOutBytes(addr, ke.marshalAll(cc)) } // CopyOutN implements marshal.Marshallable.CopyOutN. -func (ke *KernelIPTGetEntries) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (ke *KernelIPTGetEntries) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Type KernelIPTGetEntries doesn't have a packed layout in memory, fall // back to MarshalBytes. - return task.CopyOutBytes(addr, ke.marshalAll(task)[:limit]) + return cc.CopyOutBytes(addr, ke.marshalAll(cc)[:limit]) } -func (ke *KernelIPTGetEntries) marshalAll(task marshal.Task) []byte { - buf := task.CopyScratchBuffer(ke.SizeBytes()) +func (ke *KernelIPTGetEntries) marshalAll(cc marshal.CopyContext) []byte { + buf := cc.CopyScratchBuffer(ke.SizeBytes()) ke.MarshalBytes(buf) return buf } diff --git a/pkg/abi/linux/netfilter_ipv6.go b/pkg/abi/linux/netfilter_ipv6.go index 347c8c591..a137940b6 100644 --- a/pkg/abi/linux/netfilter_ipv6.go +++ b/pkg/abi/linux/netfilter_ipv6.go @@ -128,9 +128,9 @@ func (ke *KernelIP6TGetEntries) UnmarshalUnsafe(src []byte) { } // CopyIn implements marshal.Marshallable.CopyIn. -func (ke *KernelIP6TGetEntries) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { - buf := task.CopyScratchBuffer(ke.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. +func (ke *KernelIP6TGetEntries) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + buf := cc.CopyScratchBuffer(ke.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results // in a partially unmarshalled struct. ke.UnmarshalBytes(buf) // escapes: fallback. @@ -138,21 +138,21 @@ func (ke *KernelIP6TGetEntries) CopyIn(task marshal.Task, addr usermem.Addr) (in } // CopyOut implements marshal.Marshallable.CopyOut. -func (ke *KernelIP6TGetEntries) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { +func (ke *KernelIP6TGetEntries) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Type KernelIP6TGetEntries doesn't have a packed layout in memory, // fall back to MarshalBytes. - return task.CopyOutBytes(addr, ke.marshalAll(task)) + return cc.CopyOutBytes(addr, ke.marshalAll(cc)) } // CopyOutN implements marshal.Marshallable.CopyOutN. -func (ke *KernelIP6TGetEntries) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (ke *KernelIP6TGetEntries) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Type KernelIP6TGetEntries doesn't have a packed layout in memory, fall // back to MarshalBytes. - return task.CopyOutBytes(addr, ke.marshalAll(task)[:limit]) + return cc.CopyOutBytes(addr, ke.marshalAll(cc)[:limit]) } -func (ke *KernelIP6TGetEntries) marshalAll(task marshal.Task) []byte { - buf := task.CopyScratchBuffer(ke.SizeBytes()) +func (ke *KernelIP6TGetEntries) marshalAll(cc marshal.CopyContext) []byte { + buf := cc.CopyScratchBuffer(ke.SizeBytes()) ke.MarshalBytes(buf) return buf } diff --git a/pkg/marshal/marshal.go b/pkg/marshal/marshal.go index 85b196f08..d8cb44b40 100644 --- a/pkg/marshal/marshal.go +++ b/pkg/marshal/marshal.go @@ -26,9 +26,10 @@ import ( "gvisor.dev/gvisor/pkg/usermem" ) -// Task provides a subset of kernel.Task, used in marshalling. We don't import -// the kernel package directly to avoid circular dependency. -type Task interface { +// CopyContext defines the memory operations required to marshal to and from +// user memory. Typically, kernel.Task is used to provide implementations for +// these operations. +type CopyContext interface { // CopyScratchBuffer provides a task goroutine-local scratch buffer. See // kernel.CopyScratchBuffer. CopyScratchBuffer(size int) []byte @@ -107,7 +108,7 @@ type Marshallable interface { // If the copy-in from the task memory is only partially successful, CopyIn // should still attempt to deserialize as much data as possible. See comment // for UnmarshalBytes. - CopyIn(task Task, addr usermem.Addr) (int, error) + CopyIn(cc CopyContext, addr usermem.Addr) (int, error) // CopyOut serializes a Marshallable type to a task's memory. This may only // be called from a task goroutine. This is more efficient than calling @@ -118,7 +119,7 @@ type Marshallable interface { // The copy-out to the task memory may be partially successful, in which // case CopyOut returns how much data was serialized. See comment for // MarshalBytes for implications. - CopyOut(task Task, addr usermem.Addr) (int, error) + CopyOut(cc CopyContext, addr usermem.Addr) (int, error) // CopyOutN is like CopyOut, but explicitly requests a partial // copy-out. Note that this may yield unexpected results for non-packed @@ -126,7 +127,7 @@ type Marshallable interface { // comment on MarshalBytes. // // The limit must be less than or equal to SizeBytes(). - CopyOutN(task Task, addr usermem.Addr, limit int) (int, error) + CopyOutN(cc CopyContext, addr usermem.Addr, limit int) (int, error) } // go-marshal generates additional functions for a type based on additional @@ -156,10 +157,10 @@ type Marshallable interface { // func UnmarshalUnsafeFooSlice(dst []Foo, src []byte) (int, error) { ... } // // // CopyFooSliceIn copies in a slice of Foo objects from the task's memory. -// func CopyFooSliceIn(task marshal.Task, addr usermem.Addr, dst []Foo) (int, error) { ... } +// func CopyFooSliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []Foo) (int, error) { ... } // // // CopyFooSliceIn copies out a slice of Foo objects to the task's memory. -// func CopyFooSliceOut(task marshal.Task, addr usermem.Addr, src []Foo) (int, error) { ... } +// func CopyFooSliceOut(cc marshal.CopyContext, addr usermem.Addr, src []Foo) (int, error) { ... } // // The name of the functions are of the format "Copy%sIn" and "Copy%sOut", where // %s is the first argument to the slice clause. This directive is not supported @@ -174,10 +175,10 @@ type Marshallable interface { // This is only valid on newtypes on primitives, and causes the generated // functions to accept slices of the inner type instead: // -// func CopyInt32SliceIn(task marshal.Task, addr usermem.Addr, dst []int32) (int, error) { ... } +// func CopyInt32SliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []int32) (int, error) { ... } // // Without "inner", they would instead be: // -// func CopyInt32SliceIn(task marshal.Task, addr usermem.Addr, dst []Int32) (int, error) { ... } +// func CopyInt32SliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []Int32) (int, error) { ... } // // This may help avoid a cast depending on how the generated functions are used. diff --git a/pkg/marshal/marshal_impl_util.go b/pkg/marshal/marshal_impl_util.go index 89c7d3575..69f33321e 100644 --- a/pkg/marshal/marshal_impl_util.go +++ b/pkg/marshal/marshal_impl_util.go @@ -63,16 +63,16 @@ func (StubMarshallable) UnmarshalUnsafe(src []byte) { } // CopyIn implements Marshallable.CopyIn. -func (StubMarshallable) CopyIn(task Task, addr usermem.Addr) (int, error) { +func (StubMarshallable) CopyIn(cc CopyContext, addr usermem.Addr) (int, error) { panic("Please implement your own CopyIn function") } // CopyOut implements Marshallable.CopyOut. -func (StubMarshallable) CopyOut(task Task, addr usermem.Addr) (int, error) { +func (StubMarshallable) CopyOut(cc CopyContext, addr usermem.Addr) (int, error) { panic("Please implement your own CopyOut function") } // CopyOutN implements Marshallable.CopyOutN. -func (StubMarshallable) CopyOutN(task Task, addr usermem.Addr, limit int) (int, error) { +func (StubMarshallable) CopyOutN(cc CopyContext, addr usermem.Addr, limit int) (int, error) { panic("Please implement your own CopyOutN function") } diff --git a/pkg/marshal/primitive/primitive.go b/pkg/marshal/primitive/primitive.go index 140a9b78c..dfdae5d60 100644 --- a/pkg/marshal/primitive/primitive.go +++ b/pkg/marshal/primitive/primitive.go @@ -101,18 +101,18 @@ func (b *ByteSlice) UnmarshalUnsafe(src []byte) { } // CopyIn implements marshal.Marshallable.CopyIn. -func (b *ByteSlice) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { - return task.CopyInBytes(addr, *b) +func (b *ByteSlice) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return cc.CopyInBytes(addr, *b) } // CopyOut implements marshal.Marshallable.CopyOut. -func (b *ByteSlice) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return task.CopyOutBytes(addr, *b) +func (b *ByteSlice) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return cc.CopyOutBytes(addr, *b) } // CopyOutN implements marshal.Marshallable.CopyOutN. -func (b *ByteSlice) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { - return task.CopyOutBytes(addr, (*b)[:limit]) +func (b *ByteSlice) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { + return cc.CopyOutBytes(addr, (*b)[:limit]) } // WriteTo implements io.WriterTo.WriteTo. @@ -130,9 +130,9 @@ var _ marshal.Marshallable = (*ByteSlice)(nil) // CopyInt16In is a convenient wrapper for copying in an int16 from the task's // memory. -func CopyInt16In(task marshal.Task, addr usermem.Addr, dst *int16) (int, error) { +func CopyInt16In(cc marshal.CopyContext, addr usermem.Addr, dst *int16) (int, error) { var buf Int16 - n, err := buf.CopyIn(task, addr) + n, err := buf.CopyIn(cc, addr) if err != nil { return n, err } @@ -142,16 +142,16 @@ func CopyInt16In(task marshal.Task, addr usermem.Addr, dst *int16) (int, error) // CopyInt16Out is a convenient wrapper for copying out an int16 to the task's // memory. -func CopyInt16Out(task marshal.Task, addr usermem.Addr, src int16) (int, error) { +func CopyInt16Out(cc marshal.CopyContext, addr usermem.Addr, src int16) (int, error) { srcP := Int16(src) - return srcP.CopyOut(task, addr) + return srcP.CopyOut(cc, addr) } // CopyUint16In is a convenient wrapper for copying in a uint16 from the task's // memory. -func CopyUint16In(task marshal.Task, addr usermem.Addr, dst *uint16) (int, error) { +func CopyUint16In(cc marshal.CopyContext, addr usermem.Addr, dst *uint16) (int, error) { var buf Uint16 - n, err := buf.CopyIn(task, addr) + n, err := buf.CopyIn(cc, addr) if err != nil { return n, err } @@ -161,18 +161,18 @@ func CopyUint16In(task marshal.Task, addr usermem.Addr, dst *uint16) (int, error // CopyUint16Out is a convenient wrapper for copying out a uint16 to the task's // memory. -func CopyUint16Out(task marshal.Task, addr usermem.Addr, src uint16) (int, error) { +func CopyUint16Out(cc marshal.CopyContext, addr usermem.Addr, src uint16) (int, error) { srcP := Uint16(src) - return srcP.CopyOut(task, addr) + return srcP.CopyOut(cc, addr) } // 32-bit integers // CopyInt32In is a convenient wrapper for copying in an int32 from the task's // memory. -func CopyInt32In(task marshal.Task, addr usermem.Addr, dst *int32) (int, error) { +func CopyInt32In(cc marshal.CopyContext, addr usermem.Addr, dst *int32) (int, error) { var buf Int32 - n, err := buf.CopyIn(task, addr) + n, err := buf.CopyIn(cc, addr) if err != nil { return n, err } @@ -182,16 +182,16 @@ func CopyInt32In(task marshal.Task, addr usermem.Addr, dst *int32) (int, error) // CopyInt32Out is a convenient wrapper for copying out an int32 to the task's // memory. -func CopyInt32Out(task marshal.Task, addr usermem.Addr, src int32) (int, error) { +func CopyInt32Out(cc marshal.CopyContext, addr usermem.Addr, src int32) (int, error) { srcP := Int32(src) - return srcP.CopyOut(task, addr) + return srcP.CopyOut(cc, addr) } // CopyUint32In is a convenient wrapper for copying in a uint32 from the task's // memory. -func CopyUint32In(task marshal.Task, addr usermem.Addr, dst *uint32) (int, error) { +func CopyUint32In(cc marshal.CopyContext, addr usermem.Addr, dst *uint32) (int, error) { var buf Uint32 - n, err := buf.CopyIn(task, addr) + n, err := buf.CopyIn(cc, addr) if err != nil { return n, err } @@ -201,18 +201,18 @@ func CopyUint32In(task marshal.Task, addr usermem.Addr, dst *uint32) (int, error // CopyUint32Out is a convenient wrapper for copying out a uint32 to the task's // memory. -func CopyUint32Out(task marshal.Task, addr usermem.Addr, src uint32) (int, error) { +func CopyUint32Out(cc marshal.CopyContext, addr usermem.Addr, src uint32) (int, error) { srcP := Uint32(src) - return srcP.CopyOut(task, addr) + return srcP.CopyOut(cc, addr) } // 64-bit integers // CopyInt64In is a convenient wrapper for copying in an int64 from the task's // memory. -func CopyInt64In(task marshal.Task, addr usermem.Addr, dst *int64) (int, error) { +func CopyInt64In(cc marshal.CopyContext, addr usermem.Addr, dst *int64) (int, error) { var buf Int64 - n, err := buf.CopyIn(task, addr) + n, err := buf.CopyIn(cc, addr) if err != nil { return n, err } @@ -222,16 +222,16 @@ func CopyInt64In(task marshal.Task, addr usermem.Addr, dst *int64) (int, error) // CopyInt64Out is a convenient wrapper for copying out an int64 to the task's // memory. -func CopyInt64Out(task marshal.Task, addr usermem.Addr, src int64) (int, error) { +func CopyInt64Out(cc marshal.CopyContext, addr usermem.Addr, src int64) (int, error) { srcP := Int64(src) - return srcP.CopyOut(task, addr) + return srcP.CopyOut(cc, addr) } // CopyUint64In is a convenient wrapper for copying in a uint64 from the task's // memory. -func CopyUint64In(task marshal.Task, addr usermem.Addr, dst *uint64) (int, error) { +func CopyUint64In(cc marshal.CopyContext, addr usermem.Addr, dst *uint64) (int, error) { var buf Uint64 - n, err := buf.CopyIn(task, addr) + n, err := buf.CopyIn(cc, addr) if err != nil { return n, err } @@ -241,7 +241,7 @@ func CopyUint64In(task marshal.Task, addr usermem.Addr, dst *uint64) (int, error // CopyUint64Out is a convenient wrapper for copying out a uint64 to the task's // memory. -func CopyUint64Out(task marshal.Task, addr usermem.Addr, src uint64) (int, error) { +func CopyUint64Out(cc marshal.CopyContext, addr usermem.Addr, src uint64) (int, error) { srcP := Uint64(src) - return srcP.CopyOut(task, addr) + return srcP.CopyOut(cc, addr) } diff --git a/pkg/marshal/primitive/primitive_abi_autogen_unsafe.go b/pkg/marshal/primitive/primitive_abi_autogen_unsafe.go index 5b4e6019b..1993ca3ba 100644 --- a/pkg/marshal/primitive/primitive_abi_autogen_unsafe.go +++ b/pkg/marshal/primitive/primitive_abi_autogen_unsafe.go @@ -58,7 +58,7 @@ func (i *Int8) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *Int8) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *Int8) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -66,7 +66,7 @@ func (i *Int8) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, e hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -75,13 +75,13 @@ func (i *Int8) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, e // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *Int8) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *Int8) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *Int8) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *Int8) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -89,7 +89,7 @@ func (i *Int8) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -114,7 +114,7 @@ func (i *Int8) WriteTo(w io.Writer) (int64, error) { // CopyInt8SliceIn copies in a slice of int8 objects from the task's memory. //go:nosplit -func CopyInt8SliceIn(task marshal.Task, addr usermem.Addr, dst []int8) (int, error) { +func CopyInt8SliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []int8) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -131,7 +131,7 @@ func CopyInt8SliceIn(task marshal.Task, addr usermem.Addr, dst []int8) (int, err hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -140,7 +140,7 @@ func CopyInt8SliceIn(task marshal.Task, addr usermem.Addr, dst []int8) (int, err // CopyInt8SliceOut copies a slice of int8 objects to the task's memory. //go:nosplit -func CopyInt8SliceOut(task marshal.Task, addr usermem.Addr, src []int8) (int, error) { +func CopyInt8SliceOut(cc marshal.CopyContext, addr usermem.Addr, src []int8) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -157,7 +157,7 @@ func CopyInt8SliceOut(task marshal.Task, addr usermem.Addr, src []int8) (int, er hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. @@ -235,7 +235,7 @@ func (u *Uint8) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (u *Uint8) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (u *Uint8) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -243,7 +243,7 @@ func (u *Uint8) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = u.SizeBytes() hdr.Cap = u.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that u // must live until the use above. runtime.KeepAlive(u) // escapes: replaced by intrinsic. @@ -252,13 +252,13 @@ func (u *Uint8) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (u *Uint8) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return u.CopyOutN(task, addr, u.SizeBytes()) +func (u *Uint8) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return u.CopyOutN(cc, addr, u.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (u *Uint8) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (u *Uint8) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -266,7 +266,7 @@ func (u *Uint8) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = u.SizeBytes() hdr.Cap = u.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that u // must live until the use above. runtime.KeepAlive(u) // escapes: replaced by intrinsic. @@ -291,7 +291,7 @@ func (u *Uint8) WriteTo(w io.Writer) (int64, error) { // CopyUint8SliceIn copies in a slice of uint8 objects from the task's memory. //go:nosplit -func CopyUint8SliceIn(task marshal.Task, addr usermem.Addr, dst []uint8) (int, error) { +func CopyUint8SliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []uint8) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -308,7 +308,7 @@ func CopyUint8SliceIn(task marshal.Task, addr usermem.Addr, dst []uint8) (int, e hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -317,7 +317,7 @@ func CopyUint8SliceIn(task marshal.Task, addr usermem.Addr, dst []uint8) (int, e // CopyUint8SliceOut copies a slice of uint8 objects to the task's memory. //go:nosplit -func CopyUint8SliceOut(task marshal.Task, addr usermem.Addr, src []uint8) (int, error) { +func CopyUint8SliceOut(cc marshal.CopyContext, addr usermem.Addr, src []uint8) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -334,7 +334,7 @@ func CopyUint8SliceOut(task marshal.Task, addr usermem.Addr, src []uint8) (int, hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. @@ -412,7 +412,7 @@ func (i *Int16) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *Int16) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *Int16) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -420,7 +420,7 @@ func (i *Int16) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -429,13 +429,13 @@ func (i *Int16) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *Int16) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *Int16) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *Int16) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *Int16) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -443,7 +443,7 @@ func (i *Int16) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -468,7 +468,7 @@ func (i *Int16) WriteTo(w io.Writer) (int64, error) { // CopyInt16SliceIn copies in a slice of int16 objects from the task's memory. //go:nosplit -func CopyInt16SliceIn(task marshal.Task, addr usermem.Addr, dst []int16) (int, error) { +func CopyInt16SliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []int16) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -485,7 +485,7 @@ func CopyInt16SliceIn(task marshal.Task, addr usermem.Addr, dst []int16) (int, e hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -494,7 +494,7 @@ func CopyInt16SliceIn(task marshal.Task, addr usermem.Addr, dst []int16) (int, e // CopyInt16SliceOut copies a slice of int16 objects to the task's memory. //go:nosplit -func CopyInt16SliceOut(task marshal.Task, addr usermem.Addr, src []int16) (int, error) { +func CopyInt16SliceOut(cc marshal.CopyContext, addr usermem.Addr, src []int16) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -511,7 +511,7 @@ func CopyInt16SliceOut(task marshal.Task, addr usermem.Addr, src []int16) (int, hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. @@ -589,7 +589,7 @@ func (u *Uint16) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (u *Uint16) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (u *Uint16) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -597,7 +597,7 @@ func (u *Uint16) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = u.SizeBytes() hdr.Cap = u.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that u // must live until the use above. runtime.KeepAlive(u) // escapes: replaced by intrinsic. @@ -606,13 +606,13 @@ func (u *Uint16) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (u *Uint16) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return u.CopyOutN(task, addr, u.SizeBytes()) +func (u *Uint16) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return u.CopyOutN(cc, addr, u.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (u *Uint16) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (u *Uint16) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -620,7 +620,7 @@ func (u *Uint16) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = u.SizeBytes() hdr.Cap = u.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that u // must live until the use above. runtime.KeepAlive(u) // escapes: replaced by intrinsic. @@ -645,7 +645,7 @@ func (u *Uint16) WriteTo(w io.Writer) (int64, error) { // CopyUint16SliceIn copies in a slice of uint16 objects from the task's memory. //go:nosplit -func CopyUint16SliceIn(task marshal.Task, addr usermem.Addr, dst []uint16) (int, error) { +func CopyUint16SliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []uint16) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -662,7 +662,7 @@ func CopyUint16SliceIn(task marshal.Task, addr usermem.Addr, dst []uint16) (int, hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -671,7 +671,7 @@ func CopyUint16SliceIn(task marshal.Task, addr usermem.Addr, dst []uint16) (int, // CopyUint16SliceOut copies a slice of uint16 objects to the task's memory. //go:nosplit -func CopyUint16SliceOut(task marshal.Task, addr usermem.Addr, src []uint16) (int, error) { +func CopyUint16SliceOut(cc marshal.CopyContext, addr usermem.Addr, src []uint16) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -688,7 +688,7 @@ func CopyUint16SliceOut(task marshal.Task, addr usermem.Addr, src []uint16) (int hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. @@ -766,7 +766,7 @@ func (i *Int32) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *Int32) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *Int32) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -774,7 +774,7 @@ func (i *Int32) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -783,13 +783,13 @@ func (i *Int32) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *Int32) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *Int32) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *Int32) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *Int32) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -797,7 +797,7 @@ func (i *Int32) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -822,7 +822,7 @@ func (i *Int32) WriteTo(w io.Writer) (int64, error) { // CopyInt32SliceIn copies in a slice of int32 objects from the task's memory. //go:nosplit -func CopyInt32SliceIn(task marshal.Task, addr usermem.Addr, dst []int32) (int, error) { +func CopyInt32SliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []int32) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -839,7 +839,7 @@ func CopyInt32SliceIn(task marshal.Task, addr usermem.Addr, dst []int32) (int, e hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -848,7 +848,7 @@ func CopyInt32SliceIn(task marshal.Task, addr usermem.Addr, dst []int32) (int, e // CopyInt32SliceOut copies a slice of int32 objects to the task's memory. //go:nosplit -func CopyInt32SliceOut(task marshal.Task, addr usermem.Addr, src []int32) (int, error) { +func CopyInt32SliceOut(cc marshal.CopyContext, addr usermem.Addr, src []int32) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -865,7 +865,7 @@ func CopyInt32SliceOut(task marshal.Task, addr usermem.Addr, src []int32) (int, hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. @@ -943,7 +943,7 @@ func (u *Uint32) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (u *Uint32) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (u *Uint32) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -951,7 +951,7 @@ func (u *Uint32) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = u.SizeBytes() hdr.Cap = u.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that u // must live until the use above. runtime.KeepAlive(u) // escapes: replaced by intrinsic. @@ -960,13 +960,13 @@ func (u *Uint32) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (u *Uint32) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return u.CopyOutN(task, addr, u.SizeBytes()) +func (u *Uint32) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return u.CopyOutN(cc, addr, u.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (u *Uint32) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (u *Uint32) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -974,7 +974,7 @@ func (u *Uint32) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = u.SizeBytes() hdr.Cap = u.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that u // must live until the use above. runtime.KeepAlive(u) // escapes: replaced by intrinsic. @@ -999,7 +999,7 @@ func (u *Uint32) WriteTo(w io.Writer) (int64, error) { // CopyUint32SliceIn copies in a slice of uint32 objects from the task's memory. //go:nosplit -func CopyUint32SliceIn(task marshal.Task, addr usermem.Addr, dst []uint32) (int, error) { +func CopyUint32SliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []uint32) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -1016,7 +1016,7 @@ func CopyUint32SliceIn(task marshal.Task, addr usermem.Addr, dst []uint32) (int, hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -1025,7 +1025,7 @@ func CopyUint32SliceIn(task marshal.Task, addr usermem.Addr, dst []uint32) (int, // CopyUint32SliceOut copies a slice of uint32 objects to the task's memory. //go:nosplit -func CopyUint32SliceOut(task marshal.Task, addr usermem.Addr, src []uint32) (int, error) { +func CopyUint32SliceOut(cc marshal.CopyContext, addr usermem.Addr, src []uint32) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -1042,7 +1042,7 @@ func CopyUint32SliceOut(task marshal.Task, addr usermem.Addr, src []uint32) (int hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. @@ -1120,7 +1120,7 @@ func (i *Int64) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (i *Int64) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (i *Int64) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -1128,7 +1128,7 @@ func (i *Int64) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -1137,13 +1137,13 @@ func (i *Int64) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (i *Int64) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return i.CopyOutN(task, addr, i.SizeBytes()) +func (i *Int64) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return i.CopyOutN(cc, addr, i.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (i *Int64) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (i *Int64) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -1151,7 +1151,7 @@ func (i *Int64) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = i.SizeBytes() hdr.Cap = i.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that i // must live until the use above. runtime.KeepAlive(i) // escapes: replaced by intrinsic. @@ -1176,7 +1176,7 @@ func (i *Int64) WriteTo(w io.Writer) (int64, error) { // CopyInt64SliceIn copies in a slice of int64 objects from the task's memory. //go:nosplit -func CopyInt64SliceIn(task marshal.Task, addr usermem.Addr, dst []int64) (int, error) { +func CopyInt64SliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []int64) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -1193,7 +1193,7 @@ func CopyInt64SliceIn(task marshal.Task, addr usermem.Addr, dst []int64) (int, e hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -1202,7 +1202,7 @@ func CopyInt64SliceIn(task marshal.Task, addr usermem.Addr, dst []int64) (int, e // CopyInt64SliceOut copies a slice of int64 objects to the task's memory. //go:nosplit -func CopyInt64SliceOut(task marshal.Task, addr usermem.Addr, src []int64) (int, error) { +func CopyInt64SliceOut(cc marshal.CopyContext, addr usermem.Addr, src []int64) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -1219,7 +1219,7 @@ func CopyInt64SliceOut(task marshal.Task, addr usermem.Addr, src []int64) (int, hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. @@ -1297,7 +1297,7 @@ func (u *Uint64) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (u *Uint64) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (u *Uint64) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -1305,7 +1305,7 @@ func (u *Uint64) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, hdr.Len = u.SizeBytes() hdr.Cap = u.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that u // must live until the use above. runtime.KeepAlive(u) // escapes: replaced by intrinsic. @@ -1314,13 +1314,13 @@ func (u *Uint64) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (u *Uint64) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return u.CopyOutN(task, addr, u.SizeBytes()) +func (u *Uint64) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return u.CopyOutN(cc, addr, u.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (u *Uint64) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (u *Uint64) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -1328,7 +1328,7 @@ func (u *Uint64) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = u.SizeBytes() hdr.Cap = u.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that u // must live until the use above. runtime.KeepAlive(u) // escapes: replaced by intrinsic. @@ -1353,7 +1353,7 @@ func (u *Uint64) WriteTo(w io.Writer) (int64, error) { // CopyUint64SliceIn copies in a slice of uint64 objects from the task's memory. //go:nosplit -func CopyUint64SliceIn(task marshal.Task, addr usermem.Addr, dst []uint64) (int, error) { +func CopyUint64SliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []uint64) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -1370,7 +1370,7 @@ func CopyUint64SliceIn(task marshal.Task, addr usermem.Addr, dst []uint64) (int, hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -1379,7 +1379,7 @@ func CopyUint64SliceIn(task marshal.Task, addr usermem.Addr, dst []uint64) (int, // CopyUint64SliceOut copies a slice of uint64 objects to the task's memory. //go:nosplit -func CopyUint64SliceOut(task marshal.Task, addr usermem.Addr, src []uint64) (int, error) { +func CopyUint64SliceOut(cc marshal.CopyContext, addr usermem.Addr, src []uint64) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -1396,7 +1396,7 @@ func CopyUint64SliceOut(task marshal.Task, addr usermem.Addr, src []uint64) (int hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. diff --git a/pkg/sentry/arch/arch_abi_autogen_unsafe.go b/pkg/sentry/arch/arch_abi_autogen_unsafe.go index 6a1b41bf6..fe68f921d 100644 --- a/pkg/sentry/arch/arch_abi_autogen_unsafe.go +++ b/pkg/sentry/arch/arch_abi_autogen_unsafe.go @@ -80,12 +80,12 @@ func (s *SignalAct) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *SignalAct) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *SignalAct) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !s.Mask.Packed() { // Type SignalAct doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. s.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -95,7 +95,7 @@ func (s *SignalAct) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (i hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -104,17 +104,17 @@ func (s *SignalAct) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (i // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *SignalAct) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *SignalAct) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *SignalAct) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *SignalAct) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !s.Mask.Packed() { // Type SignalAct doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. s.UnmarshalBytes(buf) // escapes: fallback. @@ -128,7 +128,7 @@ func (s *SignalAct) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -206,7 +206,7 @@ func (s *SignalStack) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *SignalStack) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *SignalStack) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -214,7 +214,7 @@ func (s *SignalStack) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -223,13 +223,13 @@ func (s *SignalStack) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *SignalStack) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *SignalStack) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *SignalStack) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *SignalStack) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -237,7 +237,7 @@ func (s *SignalStack) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -316,7 +316,7 @@ func (s *SignalInfo) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *SignalInfo) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *SignalInfo) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -324,7 +324,7 @@ func (s *SignalInfo) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -333,13 +333,13 @@ func (s *SignalInfo) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *SignalInfo) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *SignalInfo) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *SignalInfo) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *SignalInfo) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -347,7 +347,7 @@ func (s *SignalInfo) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. diff --git a/pkg/sentry/fsimpl/devpts/root_inode_refs.go b/pkg/sentry/fsimpl/devpts/root_inode_refs.go index 1b7090229..4abb66431 100644 --- a/pkg/sentry/fsimpl/devpts/root_inode_refs.go +++ b/pkg/sentry/fsimpl/devpts/root_inode_refs.go @@ -2,11 +2,10 @@ package devpts import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/fsimpl/fuse/inode_refs.go b/pkg/sentry/fsimpl/fuse/inode_refs.go index 12e7d6e6c..4fb4d4da7 100644 --- a/pkg/sentry/fsimpl/fuse/inode_refs.go +++ b/pkg/sentry/fsimpl/fuse/inode_refs.go @@ -2,11 +2,10 @@ package fuse import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/fsimpl/host/connected_endpoint_refs.go b/pkg/sentry/fsimpl/host/connected_endpoint_refs.go index 7fa5a516d..225f59782 100644 --- a/pkg/sentry/fsimpl/host/connected_endpoint_refs.go +++ b/pkg/sentry/fsimpl/host/connected_endpoint_refs.go @@ -2,11 +2,10 @@ package host import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/fsimpl/host/inode_refs.go b/pkg/sentry/fsimpl/host/inode_refs.go index c294b8b80..4075eae17 100644 --- a/pkg/sentry/fsimpl/host/inode_refs.go +++ b/pkg/sentry/fsimpl/host/inode_refs.go @@ -2,11 +2,10 @@ package host import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/fsimpl/kernfs/dentry_refs.go b/pkg/sentry/fsimpl/kernfs/dentry_refs.go index dd5325635..f99d4941a 100644 --- a/pkg/sentry/fsimpl/kernfs/dentry_refs.go +++ b/pkg/sentry/fsimpl/kernfs/dentry_refs.go @@ -2,11 +2,10 @@ package kernfs import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/fsimpl/kernfs/static_directory_refs.go b/pkg/sentry/fsimpl/kernfs/static_directory_refs.go index 80513f6aa..2b258010e 100644 --- a/pkg/sentry/fsimpl/kernfs/static_directory_refs.go +++ b/pkg/sentry/fsimpl/kernfs/static_directory_refs.go @@ -2,11 +2,10 @@ package kernfs import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/fsimpl/proc/fd_dir_inode_refs.go b/pkg/sentry/fsimpl/proc/fd_dir_inode_refs.go index 8ed286c46..467c32752 100644 --- a/pkg/sentry/fsimpl/proc/fd_dir_inode_refs.go +++ b/pkg/sentry/fsimpl/proc/fd_dir_inode_refs.go @@ -2,11 +2,10 @@ package proc import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/fsimpl/proc/fd_info_dir_inode_refs.go b/pkg/sentry/fsimpl/proc/fd_info_dir_inode_refs.go index 957c6a6dd..3fcda0948 100644 --- a/pkg/sentry/fsimpl/proc/fd_info_dir_inode_refs.go +++ b/pkg/sentry/fsimpl/proc/fd_info_dir_inode_refs.go @@ -2,11 +2,10 @@ package proc import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/fsimpl/proc/subtasks_inode_refs.go b/pkg/sentry/fsimpl/proc/subtasks_inode_refs.go index a80ec9e0a..2da6801c2 100644 --- a/pkg/sentry/fsimpl/proc/subtasks_inode_refs.go +++ b/pkg/sentry/fsimpl/proc/subtasks_inode_refs.go @@ -2,11 +2,10 @@ package proc import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/fsimpl/proc/task_inode_refs.go b/pkg/sentry/fsimpl/proc/task_inode_refs.go index c4835cbca..b6e19844c 100644 --- a/pkg/sentry/fsimpl/proc/task_inode_refs.go +++ b/pkg/sentry/fsimpl/proc/task_inode_refs.go @@ -2,11 +2,10 @@ package proc import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/fsimpl/proc/tasks_inode_refs.go b/pkg/sentry/fsimpl/proc/tasks_inode_refs.go index 5dfb34238..6207364e4 100644 --- a/pkg/sentry/fsimpl/proc/tasks_inode_refs.go +++ b/pkg/sentry/fsimpl/proc/tasks_inode_refs.go @@ -2,11 +2,10 @@ package proc import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/fsimpl/sys/dir_refs.go b/pkg/sentry/fsimpl/sys/dir_refs.go index c05154e2b..9d15d4c80 100644 --- a/pkg/sentry/fsimpl/sys/dir_refs.go +++ b/pkg/sentry/fsimpl/sys/dir_refs.go @@ -2,11 +2,10 @@ package sys import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/fsimpl/tmpfs/inode_refs.go b/pkg/sentry/fsimpl/tmpfs/inode_refs.go index 38cc30981..ff5e99c52 100644 --- a/pkg/sentry/fsimpl/tmpfs/inode_refs.go +++ b/pkg/sentry/fsimpl/tmpfs/inode_refs.go @@ -2,11 +2,10 @@ package tmpfs import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/kernel/auth/auth_abi_autogen_unsafe.go b/pkg/sentry/kernel/auth/auth_abi_autogen_unsafe.go index 2c76bf792..e7892288b 100644 --- a/pkg/sentry/kernel/auth/auth_abi_autogen_unsafe.go +++ b/pkg/sentry/kernel/auth/auth_abi_autogen_unsafe.go @@ -52,7 +52,7 @@ func (u *UID) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (u *UID) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (u *UID) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -60,7 +60,7 @@ func (u *UID) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, er hdr.Len = u.SizeBytes() hdr.Cap = u.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that u // must live until the use above. runtime.KeepAlive(u) // escapes: replaced by intrinsic. @@ -69,13 +69,13 @@ func (u *UID) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, er // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (u *UID) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return u.CopyOutN(task, addr, u.SizeBytes()) +func (u *UID) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return u.CopyOutN(cc, addr, u.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (u *UID) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (u *UID) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -83,7 +83,7 @@ func (u *UID) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = u.SizeBytes() hdr.Cap = u.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that u // must live until the use above. runtime.KeepAlive(u) // escapes: replaced by intrinsic. @@ -141,7 +141,7 @@ func (g *GID) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (g *GID) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (g *GID) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -149,7 +149,7 @@ func (g *GID) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, er hdr.Len = g.SizeBytes() hdr.Cap = g.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that g // must live until the use above. runtime.KeepAlive(g) // escapes: replaced by intrinsic. @@ -158,13 +158,13 @@ func (g *GID) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, er // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (g *GID) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return g.CopyOutN(task, addr, g.SizeBytes()) +func (g *GID) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return g.CopyOutN(cc, addr, g.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (g *GID) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (g *GID) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -172,7 +172,7 @@ func (g *GID) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = g.SizeBytes() hdr.Cap = g.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that g // must live until the use above. runtime.KeepAlive(g) // escapes: replaced by intrinsic. @@ -197,7 +197,7 @@ func (g *GID) WriteTo(w io.Writer) (int64, error) { // CopyGIDSliceIn copies in a slice of GID objects from the task's memory. //go:nosplit -func CopyGIDSliceIn(task marshal.Task, addr usermem.Addr, dst []GID) (int, error) { +func CopyGIDSliceIn(cc marshal.CopyContext, addr usermem.Addr, dst []GID) (int, error) { count := len(dst) if count == 0 { return 0, nil @@ -214,7 +214,7 @@ func CopyGIDSliceIn(task marshal.Task, addr usermem.Addr, dst []GID) (int, error hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that dst // must live until the use above. runtime.KeepAlive(dst) // escapes: replaced by intrinsic. @@ -223,7 +223,7 @@ func CopyGIDSliceIn(task marshal.Task, addr usermem.Addr, dst []GID) (int, error // CopyGIDSliceOut copies a slice of GID objects to the task's memory. //go:nosplit -func CopyGIDSliceOut(task marshal.Task, addr usermem.Addr, src []GID) (int, error) { +func CopyGIDSliceOut(cc marshal.CopyContext, addr usermem.Addr, src []GID) (int, error) { count := len(src) if count == 0 { return 0, nil @@ -240,7 +240,7 @@ func CopyGIDSliceOut(task marshal.Task, addr usermem.Addr, src []GID) (int, erro hdr.Len = size * count hdr.Cap = size * count - length, err := task.CopyOutBytes(addr, buf) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that src // must live until the use above. runtime.KeepAlive(src) // escapes: replaced by intrinsic. diff --git a/pkg/sentry/kernel/fd_table_refs.go b/pkg/sentry/kernel/fd_table_refs.go index 8973cac8a..a630289c9 100644 --- a/pkg/sentry/kernel/fd_table_refs.go +++ b/pkg/sentry/kernel/fd_table_refs.go @@ -2,11 +2,10 @@ package kernel import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/kernel/fs_context_refs.go b/pkg/sentry/kernel/fs_context_refs.go index c0e01dbb3..e8bb1e6ee 100644 --- a/pkg/sentry/kernel/fs_context_refs.go +++ b/pkg/sentry/kernel/fs_context_refs.go @@ -2,11 +2,10 @@ package kernel import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/kernel/kernel_abi_autogen_unsafe.go b/pkg/sentry/kernel/kernel_abi_autogen_unsafe.go index c8945fb0e..eaa2ebdb3 100644 --- a/pkg/sentry/kernel/kernel_abi_autogen_unsafe.go +++ b/pkg/sentry/kernel/kernel_abi_autogen_unsafe.go @@ -51,7 +51,7 @@ func (t *ThreadID) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (t *ThreadID) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (t *ThreadID) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -59,7 +59,7 @@ func (t *ThreadID) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. @@ -68,13 +68,13 @@ func (t *ThreadID) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (t *ThreadID) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return t.CopyOutN(task, addr, t.SizeBytes()) +func (t *ThreadID) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return t.CopyOutN(cc, addr, t.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (t *ThreadID) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (t *ThreadID) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -82,7 +82,7 @@ func (t *ThreadID) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = t.SizeBytes() hdr.Cap = t.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that t // must live until the use above. runtime.KeepAlive(t) // escapes: replaced by intrinsic. diff --git a/pkg/sentry/kernel/process_group_refs.go b/pkg/sentry/kernel/process_group_refs.go index 5ff83ab96..4b257d548 100644 --- a/pkg/sentry/kernel/process_group_refs.go +++ b/pkg/sentry/kernel/process_group_refs.go @@ -2,11 +2,10 @@ package kernel import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/kernel/seqatomic_taskgoroutineschedinfo_unsafe.go b/pkg/sentry/kernel/seqatomic_taskgoroutineschedinfo_unsafe.go index a0f2fe45c..90148bbb2 100644 --- a/pkg/sentry/kernel/seqatomic_taskgoroutineschedinfo_unsafe.go +++ b/pkg/sentry/kernel/seqatomic_taskgoroutineschedinfo_unsafe.go @@ -1,12 +1,12 @@ package kernel import ( - "unsafe" - "fmt" - "gvisor.dev/gvisor/pkg/sync" "reflect" "strings" + "unsafe" + + "gvisor.dev/gvisor/pkg/sync" ) // SeqAtomicLoad returns a copy of *ptr, ensuring that the read does not race diff --git a/pkg/sentry/kernel/session_refs.go b/pkg/sentry/kernel/session_refs.go index 9c51eda6c..204fdd060 100644 --- a/pkg/sentry/kernel/session_refs.go +++ b/pkg/sentry/kernel/session_refs.go @@ -2,11 +2,10 @@ package kernel import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/kernel/shm/shm_refs.go b/pkg/sentry/kernel/shm/shm_refs.go index 0da23fa5f..4bffdd0b3 100644 --- a/pkg/sentry/kernel/shm/shm_refs.go +++ b/pkg/sentry/kernel/shm/shm_refs.go @@ -2,11 +2,10 @@ package shm import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/kernel/task_usermem.go b/pkg/sentry/kernel/task_usermem.go index 14d765af1..ce134bf54 100644 --- a/pkg/sentry/kernel/task_usermem.go +++ b/pkg/sentry/kernel/task_usermem.go @@ -18,6 +18,7 @@ import ( "math" "gvisor.dev/gvisor/pkg/abi/linux" + "gvisor.dev/gvisor/pkg/marshal" "gvisor.dev/gvisor/pkg/syserror" "gvisor.dev/gvisor/pkg/usermem" ) @@ -280,29 +281,29 @@ func (t *Task) IovecsIOSequence(addr usermem.Addr, iovcnt int, opts usermem.IOOp }, nil } -// CopyContext wraps a task to allow copying memory to and from the -// task memory with user specified usermem.IOOpts. -type CopyContext struct { +// copyContext implements marshal.CopyContext. It wraps a task to allow copying +// memory to and from the task memory with custom usermem.IOOpts. +type copyContext struct { *Task opts usermem.IOOpts } // AsCopyContext wraps the task and returns it as CopyContext. -func (t *Task) AsCopyContext(opts usermem.IOOpts) *CopyContext { - return &CopyContext{t, opts} +func (t *Task) AsCopyContext(opts usermem.IOOpts) marshal.CopyContext { + return ©Context{t, opts} } // CopyInString copies a string in from the task's memory. -func (t *CopyContext) CopyInString(addr usermem.Addr, maxLen int) (string, error) { +func (t *copyContext) CopyInString(addr usermem.Addr, maxLen int) (string, error) { return usermem.CopyStringIn(t, t.MemoryManager(), addr, maxLen, t.opts) } // CopyInBytes copies task memory into dst from an IO context. -func (t *CopyContext) CopyInBytes(addr usermem.Addr, dst []byte) (int, error) { +func (t *copyContext) CopyInBytes(addr usermem.Addr, dst []byte) (int, error) { return t.MemoryManager().CopyIn(t, addr, dst, t.opts) } // CopyOutBytes copies src into task memoryfrom an IO context. -func (t *CopyContext) CopyOutBytes(addr usermem.Addr, src []byte) (int, error) { +func (t *copyContext) CopyOutBytes(addr usermem.Addr, src []byte) (int, error) { return t.MemoryManager().CopyOut(t, addr, src, t.opts) } diff --git a/pkg/sentry/mm/aio_mappable_refs.go b/pkg/sentry/mm/aio_mappable_refs.go index c80c56d94..141747137 100644 --- a/pkg/sentry/mm/aio_mappable_refs.go +++ b/pkg/sentry/mm/aio_mappable_refs.go @@ -2,11 +2,10 @@ package mm import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/mm/special_mappable_refs.go b/pkg/sentry/mm/special_mappable_refs.go index 5eb7e69e0..0921a5d18 100644 --- a/pkg/sentry/mm/special_mappable_refs.go +++ b/pkg/sentry/mm/special_mappable_refs.go @@ -2,11 +2,10 @@ package mm import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/platform/ring0/defs_impl_arm64.go b/pkg/sentry/platform/ring0/defs_impl_arm64.go index 424b66f76..eda1e1484 100644 --- a/pkg/sentry/platform/ring0/defs_impl_arm64.go +++ b/pkg/sentry/platform/ring0/defs_impl_arm64.go @@ -1,13 +1,13 @@ package ring0 import ( + "fmt" "gvisor.dev/gvisor/pkg/sentry/arch" "gvisor.dev/gvisor/pkg/sentry/platform/ring0/pagetables" - - "fmt" - "gvisor.dev/gvisor/pkg/usermem" "io" "reflect" + + "gvisor.dev/gvisor/pkg/usermem" ) // Useful bits. diff --git a/pkg/sentry/socket/unix/socket_refs.go b/pkg/sentry/socket/unix/socket_refs.go index 680ea06cd..39aaedc7f 100644 --- a/pkg/sentry/socket/unix/socket_refs.go +++ b/pkg/sentry/socket/unix/socket_refs.go @@ -2,11 +2,10 @@ package unix import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/socket/unix/transport/queue_refs.go b/pkg/sentry/socket/unix/transport/queue_refs.go index 17951eb2f..4c3dcd13f 100644 --- a/pkg/sentry/socket/unix/transport/queue_refs.go +++ b/pkg/sentry/socket/unix/transport/queue_refs.go @@ -2,11 +2,10 @@ package transport import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/syscalls/linux/linux_abi_autogen_unsafe.go b/pkg/sentry/syscalls/linux/linux_abi_autogen_unsafe.go index cd7afb24f..55b5bc248 100644 --- a/pkg/sentry/syscalls/linux/linux_abi_autogen_unsafe.go +++ b/pkg/sentry/syscalls/linux/linux_abi_autogen_unsafe.go @@ -67,25 +67,25 @@ func (o *oldDirentHdr) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (o *oldDirentHdr) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (o *oldDirentHdr) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Type oldDirentHdr doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(o.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(o.SizeBytes()) // escapes: okay. o.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (o *oldDirentHdr) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return o.CopyOutN(task, addr, o.SizeBytes()) +func (o *oldDirentHdr) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return o.CopyOutN(cc, addr, o.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (o *oldDirentHdr) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (o *oldDirentHdr) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Type oldDirentHdr doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(o.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(o.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. o.UnmarshalBytes(buf) // escapes: fallback. @@ -143,25 +143,25 @@ func (d *direntHdr) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (d *direntHdr) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (d *direntHdr) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Type direntHdr doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(d.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(d.SizeBytes()) // escapes: okay. d.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (d *direntHdr) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return d.CopyOutN(task, addr, d.SizeBytes()) +func (d *direntHdr) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return d.CopyOutN(cc, addr, d.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (d *direntHdr) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (d *direntHdr) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Type direntHdr doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(d.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(d.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. d.UnmarshalBytes(buf) // escapes: fallback. @@ -216,7 +216,7 @@ func (r *rlimit64) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (r *rlimit64) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (r *rlimit64) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -224,7 +224,7 @@ func (r *rlimit64) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in hdr.Len = r.SizeBytes() hdr.Cap = r.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that r // must live until the use above. runtime.KeepAlive(r) // escapes: replaced by intrinsic. @@ -233,13 +233,13 @@ func (r *rlimit64) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (in // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (r *rlimit64) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return r.CopyOutN(task, addr, r.SizeBytes()) +func (r *rlimit64) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return r.CopyOutN(cc, addr, r.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (r *rlimit64) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (r *rlimit64) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -247,7 +247,7 @@ func (r *rlimit64) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = r.SizeBytes() hdr.Cap = r.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that r // must live until the use above. runtime.KeepAlive(r) // escapes: replaced by intrinsic. @@ -305,7 +305,7 @@ func (s *SchedParam) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *SchedParam) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *SchedParam) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -313,7 +313,7 @@ func (s *SchedParam) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -322,13 +322,13 @@ func (s *SchedParam) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) ( // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *SchedParam) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *SchedParam) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *SchedParam) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *SchedParam) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -336,7 +336,7 @@ func (s *SchedParam) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -403,7 +403,7 @@ func (u *userSockFprog) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (u *userSockFprog) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (u *userSockFprog) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -411,7 +411,7 @@ func (u *userSockFprog) CopyOutN(task marshal.Task, addr usermem.Addr, limit int hdr.Len = u.SizeBytes() hdr.Cap = u.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that u // must live until the use above. runtime.KeepAlive(u) // escapes: replaced by intrinsic. @@ -420,13 +420,13 @@ func (u *userSockFprog) CopyOutN(task marshal.Task, addr usermem.Addr, limit int // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (u *userSockFprog) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return u.CopyOutN(task, addr, u.SizeBytes()) +func (u *userSockFprog) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return u.CopyOutN(cc, addr, u.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (u *userSockFprog) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (u *userSockFprog) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -434,7 +434,7 @@ func (u *userSockFprog) CopyIn(task marshal.Task, addr usermem.Addr) (int, error hdr.Len = u.SizeBytes() hdr.Cap = u.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that u // must live until the use above. runtime.KeepAlive(u) // escapes: replaced by intrinsic. @@ -524,7 +524,7 @@ func (m *MessageHeader64) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (m *MessageHeader64) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (m *MessageHeader64) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -532,7 +532,7 @@ func (m *MessageHeader64) CopyOutN(task marshal.Task, addr usermem.Addr, limit i hdr.Len = m.SizeBytes() hdr.Cap = m.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that m // must live until the use above. runtime.KeepAlive(m) // escapes: replaced by intrinsic. @@ -541,13 +541,13 @@ func (m *MessageHeader64) CopyOutN(task marshal.Task, addr usermem.Addr, limit i // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (m *MessageHeader64) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return m.CopyOutN(task, addr, m.SizeBytes()) +func (m *MessageHeader64) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return m.CopyOutN(cc, addr, m.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (m *MessageHeader64) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (m *MessageHeader64) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -555,7 +555,7 @@ func (m *MessageHeader64) CopyIn(task marshal.Task, addr usermem.Addr) (int, err hdr.Len = m.SizeBytes() hdr.Cap = m.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that m // must live until the use above. runtime.KeepAlive(m) // escapes: replaced by intrinsic. @@ -632,12 +632,12 @@ func (m *multipleMessageHeader64) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (m *multipleMessageHeader64) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (m *multipleMessageHeader64) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !m.msgHdr.Packed() { // Type multipleMessageHeader64 doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(m.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(m.SizeBytes()) // escapes: okay. m.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -647,7 +647,7 @@ func (m *multipleMessageHeader64) CopyOutN(task marshal.Task, addr usermem.Addr, hdr.Len = m.SizeBytes() hdr.Cap = m.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that m // must live until the use above. runtime.KeepAlive(m) // escapes: replaced by intrinsic. @@ -656,17 +656,17 @@ func (m *multipleMessageHeader64) CopyOutN(task marshal.Task, addr usermem.Addr, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (m *multipleMessageHeader64) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return m.CopyOutN(task, addr, m.SizeBytes()) +func (m *multipleMessageHeader64) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return m.CopyOutN(cc, addr, m.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (m *multipleMessageHeader64) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (m *multipleMessageHeader64) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !m.msgHdr.Packed() { // Type multipleMessageHeader64 doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(m.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(m.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. m.UnmarshalBytes(buf) // escapes: fallback. @@ -680,7 +680,7 @@ func (m *multipleMessageHeader64) CopyIn(task marshal.Task, addr usermem.Addr) ( hdr.Len = m.SizeBytes() hdr.Cap = m.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that m // must live until the use above. runtime.KeepAlive(m) // escapes: replaced by intrinsic. diff --git a/pkg/sentry/syscalls/linux/vfs2/vfs2_abi_autogen_unsafe.go b/pkg/sentry/syscalls/linux/vfs2/vfs2_abi_autogen_unsafe.go index 434631c74..ccd56285a 100644 --- a/pkg/sentry/syscalls/linux/vfs2/vfs2_abi_autogen_unsafe.go +++ b/pkg/sentry/syscalls/linux/vfs2/vfs2_abi_autogen_unsafe.go @@ -57,7 +57,7 @@ func (s *sigSetWithSize) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (s *sigSetWithSize) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (s *sigSetWithSize) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -65,7 +65,7 @@ func (s *sigSetWithSize) CopyOutN(task marshal.Task, addr usermem.Addr, limit in hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -74,13 +74,13 @@ func (s *sigSetWithSize) CopyOutN(task marshal.Task, addr usermem.Addr, limit in // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (s *sigSetWithSize) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return s.CopyOutN(task, addr, s.SizeBytes()) +func (s *sigSetWithSize) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return s.CopyOutN(cc, addr, s.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (s *sigSetWithSize) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (s *sigSetWithSize) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -88,7 +88,7 @@ func (s *sigSetWithSize) CopyIn(task marshal.Task, addr usermem.Addr) (int, erro hdr.Len = s.SizeBytes() hdr.Cap = s.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that s // must live until the use above. runtime.KeepAlive(s) // escapes: replaced by intrinsic. @@ -178,7 +178,7 @@ func (m *MessageHeader64) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (m *MessageHeader64) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (m *MessageHeader64) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -186,7 +186,7 @@ func (m *MessageHeader64) CopyOutN(task marshal.Task, addr usermem.Addr, limit i hdr.Len = m.SizeBytes() hdr.Cap = m.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that m // must live until the use above. runtime.KeepAlive(m) // escapes: replaced by intrinsic. @@ -195,13 +195,13 @@ func (m *MessageHeader64) CopyOutN(task marshal.Task, addr usermem.Addr, limit i // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (m *MessageHeader64) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return m.CopyOutN(task, addr, m.SizeBytes()) +func (m *MessageHeader64) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return m.CopyOutN(cc, addr, m.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (m *MessageHeader64) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (m *MessageHeader64) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { // Construct a slice backed by dst's underlying memory. var buf []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) @@ -209,7 +209,7 @@ func (m *MessageHeader64) CopyIn(task marshal.Task, addr usermem.Addr) (int, err hdr.Len = m.SizeBytes() hdr.Cap = m.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that m // must live until the use above. runtime.KeepAlive(m) // escapes: replaced by intrinsic. @@ -286,12 +286,12 @@ func (m *multipleMessageHeader64) UnmarshalUnsafe(src []byte) { // CopyOutN implements marshal.Marshallable.CopyOutN. //go:nosplit -func (m *multipleMessageHeader64) CopyOutN(task marshal.Task, addr usermem.Addr, limit int) (int, error) { +func (m *multipleMessageHeader64) CopyOutN(cc marshal.CopyContext, addr usermem.Addr, limit int) (int, error) { if !m.msgHdr.Packed() { // Type multipleMessageHeader64 doesn't have a packed layout in memory, fall back to MarshalBytes. - buf := task.CopyScratchBuffer(m.SizeBytes()) // escapes: okay. + buf := cc.CopyScratchBuffer(m.SizeBytes()) // escapes: okay. m.MarshalBytes(buf) // escapes: fallback. - return task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. } // Construct a slice backed by dst's underlying memory. @@ -301,7 +301,7 @@ func (m *multipleMessageHeader64) CopyOutN(task marshal.Task, addr usermem.Addr, hdr.Len = m.SizeBytes() hdr.Cap = m.SizeBytes() - length, err := task.CopyOutBytes(addr, buf[:limit]) // escapes: okay. + length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that m // must live until the use above. runtime.KeepAlive(m) // escapes: replaced by intrinsic. @@ -310,17 +310,17 @@ func (m *multipleMessageHeader64) CopyOutN(task marshal.Task, addr usermem.Addr, // CopyOut implements marshal.Marshallable.CopyOut. //go:nosplit -func (m *multipleMessageHeader64) CopyOut(task marshal.Task, addr usermem.Addr) (int, error) { - return m.CopyOutN(task, addr, m.SizeBytes()) +func (m *multipleMessageHeader64) CopyOut(cc marshal.CopyContext, addr usermem.Addr) (int, error) { + return m.CopyOutN(cc, addr, m.SizeBytes()) } // CopyIn implements marshal.Marshallable.CopyIn. //go:nosplit -func (m *multipleMessageHeader64) CopyIn(task marshal.Task, addr usermem.Addr) (int, error) { +func (m *multipleMessageHeader64) CopyIn(cc marshal.CopyContext, addr usermem.Addr) (int, error) { if !m.msgHdr.Packed() { // Type multipleMessageHeader64 doesn't have a packed layout in memory, fall back to UnmarshalBytes. - buf := task.CopyScratchBuffer(m.SizeBytes()) // escapes: okay. - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + buf := cc.CopyScratchBuffer(m.SizeBytes()) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Unmarshal unconditionally. If we had a short copy-in, this results in a // partially unmarshalled struct. m.UnmarshalBytes(buf) // escapes: fallback. @@ -334,7 +334,7 @@ func (m *multipleMessageHeader64) CopyIn(task marshal.Task, addr usermem.Addr) ( hdr.Len = m.SizeBytes() hdr.Cap = m.SizeBytes() - length, err := task.CopyInBytes(addr, buf) // escapes: okay. + length, err := cc.CopyInBytes(addr, buf) // escapes: okay. // Since we bypassed the compiler's escape analysis, indicate that m // must live until the use above. runtime.KeepAlive(m) // escapes: replaced by intrinsic. diff --git a/pkg/sentry/time/seqatomic_parameters_unsafe.go b/pkg/sentry/time/seqatomic_parameters_unsafe.go index f18440378..2cb001080 100644 --- a/pkg/sentry/time/seqatomic_parameters_unsafe.go +++ b/pkg/sentry/time/seqatomic_parameters_unsafe.go @@ -1,12 +1,12 @@ package time import ( - "unsafe" - "fmt" - "gvisor.dev/gvisor/pkg/sync" "reflect" "strings" + "unsafe" + + "gvisor.dev/gvisor/pkg/sync" ) // SeqAtomicLoad returns a copy of *ptr, ensuring that the read does not race diff --git a/pkg/sentry/vfs/file_description_refs.go b/pkg/sentry/vfs/file_description_refs.go index 5e612d7f0..6c7747259 100644 --- a/pkg/sentry/vfs/file_description_refs.go +++ b/pkg/sentry/vfs/file_description_refs.go @@ -2,11 +2,10 @@ package vfs import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/vfs/filesystem_refs.go b/pkg/sentry/vfs/filesystem_refs.go index aaa753c43..96f681831 100644 --- a/pkg/sentry/vfs/filesystem_refs.go +++ b/pkg/sentry/vfs/filesystem_refs.go @@ -2,11 +2,10 @@ package vfs import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/sentry/vfs/mount_namespace_refs.go b/pkg/sentry/vfs/mount_namespace_refs.go index 56b8d9903..4c422c81f 100644 --- a/pkg/sentry/vfs/mount_namespace_refs.go +++ b/pkg/sentry/vfs/mount_namespace_refs.go @@ -2,11 +2,10 @@ package vfs import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so diff --git a/pkg/tcpip/link/tun/tun_endpoint_refs.go b/pkg/tcpip/link/tun/tun_endpoint_refs.go index 7f80b1fa3..9a38142f5 100644 --- a/pkg/tcpip/link/tun/tun_endpoint_refs.go +++ b/pkg/tcpip/link/tun/tun_endpoint_refs.go @@ -2,11 +2,10 @@ package tun import ( "fmt" + "gvisor.dev/gvisor/pkg/log" refs_vfs1 "gvisor.dev/gvisor/pkg/refs" "runtime" "sync/atomic" - - "gvisor.dev/gvisor/pkg/log" ) // ownerType is used to customize logging. Note that we use a pointer to T so |