Commit Graph

31 Commits

Author SHA1 Message Date
gVisor bot aae5455fe3 Merge release-20210301.0-5-ga9441aea2 (automated) 2021-03-03 18:43:27 +00:00
Ayush Ranjan a9441aea27 [op] Replace syscall package usage with golang.org/x/sys/unix in pkg/.
The syscall package has been deprecated in favor of golang.org/x/sys.

Note that syscall is still used in the following places:
- pkg/sentry/socket/hostinet/stack.go: some netlink related functionalities
  are not yet available in golang.org/x/sys.
- syscall.Stat_t is still used in some places because os.FileInfo.Sys() still
  returns it and not unix.Stat_t.

Updates #214

PiperOrigin-RevId: 360701387
2021-03-03 10:25:58 -08:00
gVisor bot 2d9dc3c1b7 Merge release-20210208.0-64-gf051ec646 (automated) 2021-02-18 01:45:49 +00:00
Jamie Liu f051ec6463 Add gohacks.Slice/StringHeader.
See https://github.com/golang/go/issues/19367 for rationale. Note that the
upstream decision arrived at in that thread, while useful for some of our use
cases, doesn't account for all of our SliceHeader use cases (we often use
SliceHeader to extract pointers from slices in a way that avoids bounds
checking and/or handles nil slices correctly) and also doesn't exist yet.

PiperOrigin-RevId: 358071574
2021-02-17 17:41:10 -08:00
gVisor bot 1b5d08596a Merge release-20201130.0-67-gf6cb96bd5 (automated) 2020-12-09 23:55:41 +00:00
Andrei Vagin 658f874b94 Prepare for supporting cross compilation.
PiperOrigin-RevId: 346496532
2020-12-09 15:51:33 -08:00
gVisor bot 893488fca8 Merge release-20201109.0-54-g938aabeec (automated) 2020-11-17 03:04:04 +00:00
Jamie Liu 938aabeecb Minor flipcall refactoring.
PiperOrigin-RevId: 342768550
2020-11-16 19:00:39 -08:00
gVisor bot 8c844b60d2 Merge release-20200810.0-74-g129018ab3 (automated) 2020-08-20 20:36:02 +00:00
Michael Pratt 129018ab3d Consistent precondition formatting
Our "Preconditions:" blocks are very useful to determine the input invariants,
but they are bit inconsistent throughout the codebase, which makes them harder
to read (particularly cases with 5+ conditions in a single paragraph).

I've reformatted all of the cases to fit in simple rules:

1. Cases with a single condition are placed on a single line.
2. Cases with multiple conditions are placed in a bulleted list.

This format has been added to the style guide.

I've also mentioned "Postconditions:", though those are much less frequently
used, and all uses already match this style.

PiperOrigin-RevId: 327687465
2020-08-20 13:32:24 -07:00
gVisor bot 2efbd43549 Merge release-20200522.0-132-gd2cc9a888 (automated) 2020-06-11 20:00:32 +00:00
gVisor bot d2cc9a888e Factor out flipcall mmap for internal use
PiperOrigin-RevId: 315959279
2020-06-11 12:57:56 -07:00
gVisor bot 84452958e1 Merge release-20200518.0-45-g0bc022b7 (automated) 2020-05-27 17:51:40 +00:00
gVisor bot 03a34f6ddd Merge release-20200422.0-51-g1f4087e (automated) 2020-05-07 20:23:43 +00:00
gVisor bot 51a2b73123 Merge release-20200323.0-215-g0c58694 (automated) 2020-04-23 00:54:53 +00:00
Andrei Vagin 0c586946ea Specify a memory file in platform.New().
PiperOrigin-RevId: 307941984
2020-04-22 17:50:10 -07:00
gVisor bot 971856a978 Merge release-20200127.0-85-g1b6a12a (automated) 2020-02-06 06:49:12 +00:00
gVisor bot 02dbbe7666 Merge release-20200127.0-65-g95ce8bb (automated) 2020-02-04 22:49:52 +00:00
Adin Scannell d29e59af9f Standardize on tools directory.
PiperOrigin-RevId: 291745021
2020-01-27 12:21:00 -08:00
gVisor bot d09b1da02d Merge release-20191213.0-96-g27500d5 (automated) 2020-01-10 06:14:54 +00:00
Ian Gudger 27500d529f New sync package.
* Rename syncutil to sync.
* Add aliases to sync types.
* Replace existing usage of standard library sync package.

This will make it easier to swap out synchronization primitives. For example,
this will allow us to use primitives from github.com/sasha-s/go-deadlock to
check for lock ordering violations.

Updates #1472

PiperOrigin-RevId: 289033387
2020-01-09 22:02:24 -08:00
gVisor bot b3f49ebd74 Merge release-20191114.0-18-gc0f89eb (automated) 2019-11-21 19:43:52 +00:00
Adin Scannell c0f89eba6e Import and structure cleanup.
PiperOrigin-RevId: 281795269
2019-11-21 11:41:30 -08:00
gVisor bot e7f30113e2 Merge release-20190806.1-360-g5694bd0 (automated) 2019-11-01 18:47:47 +00:00
Jamie Liu 5694bd080e Don't log "p9.channel.service: flipcall connection shutdown".
This gets quite spammy, especially in tests.

PiperOrigin-RevId: 277970468
2019-11-01 11:45:02 -07:00
gVisor bot e14a0a36cb Merge release-20190806.1-143-ga8834fc (automated) 2019-09-13 06:41:23 +00:00
Michael Pratt df5d377521 Remove go_test from go_stateify and go_marshal
They are no-ops, so the standard rule works fine.

PiperOrigin-RevId: 268776264
2019-09-12 15:10:17 -07:00
Jamie Liu 9e1cbdf565 Indicate flipcall synchronization to the Go race detector.
Since each Endpoint has a distinct mapping of the packet window, the Go race
detector does not recognize accesses by connected Endpoints to be related. This
means that this change isn't necessary for the Go race detector to accept
accesses of flipcall.Endpoint.Data(), but it *is* necessary for it to accept
accesses to shared variables outside the scope of flipcall that are
synchronized by flipcall.Endpoint state; see updated test for an example.

RaceReleaseMerge is needed (instead of RaceRelease) because calls to
raceBecomeInactive() from *unrelated* Endpoints can occur in any order.
(DowngradableRWMutex.RUnlock() has a similar property: calls to RUnlock() on
the same DowngradableRWMutex from different goroutines can occur in any order.
Remove the TODO asking to explain this now that this is understood.)

PiperOrigin-RevId: 267705325
2019-09-06 17:25:07 -07:00
Jamie Liu eb94066ef2 Ensure that flipcall.Endpoint.Shutdown() shuts down inactive peers.
PiperOrigin-RevId: 267022978
2019-09-03 15:10:51 -07:00
Jamie Liu cbe145247a Flipcall refinements.
Note that some of these changes affect the protocol in
backward-incompatible ways.

- Replace use of "initially-active" and "initially-inactive" with
"client" and "server" respectively for clarity.

- Fix a race condition involving Endpoint.Shutdown() by repeatedly
invoking FUTEX_WAKE until it is confirmed that no local thread is
blocked in FUTEX_WAIT.

- Drop flipcall.ControlMode.

PiperOrigin-RevId: 260981382
2019-07-31 12:56:04 -07:00
Jamie Liu e806466fc5 Add //pkg/flipcall.
Flipcall is a (conceptually) simple local-only RPC mechanism. Compared
to unet, Flipcall does not support passing FDs (support for which will
be provided out of band by another package), requires users to establish
connections manually, and requires user management of concurrency since
each connected Endpoint pair supports only a single RPC at a time;
however, it improves performance by using shared memory for data
(reducing memory copies) and using futexes for control signaling (which
is much cheaper than sendto/recvfrom/sendmsg/recvmsg).

PiperOrigin-RevId: 254471986
2019-06-21 14:47:04 -07:00