9879 Commits

Author SHA1 Message Date
Lucas Manning 3a9ba17351 Fix device FD reference leaks and add support for VFIO_GROUP_UNSET_CONTAINER.
Fixes #11545

PiperOrigin-RevId: 739274186
2025-03-21 13:07:59 -07:00
gVisor bot 225a7bc0d2 Internal change.
PiperOrigin-RevId: 739263572
2025-03-21 12:32:21 -07:00
Ayush Ranjan 738e1d995f nvproxy: Add HasStatus.SetStatus and provide failWithStatus() util functions.
This creates a more centralized way for nvproxy to return errors to the the
user mode driver via the NvStatus field in ioctl structs. As opposed to failing
the ioctl with mysterious EINVALs.

Also updated the following structs to NOT implement HasStatus interface:
- IoctlRegisterFD
- RMAPIVersion
- IoctlSysParams

These don't have a Status field so it is misleading for them to implement
HasStatus. Created frontendIoctlSimpleNoStatus() and
frontendIoctlInvokeNoStatus() for such structs to use.

PiperOrigin-RevId: 738959856
2025-03-20 15:29:44 -07:00
Jamie Liu c16d3fdfad pgalloc: log async page loading progress and info about awaited loads
PiperOrigin-RevId: 738555942
2025-03-19 15:17:36 -07:00
Ayush Ranjan 97820ce5c9 nvproxy: Add support for 570.124.06.
The following command does not report any changes in the structs we proxy:
```
make run TARGETS=//tools/nvidia_driver_differ:run_differ \
  ARGS="--base 570.86.15 --next 570.124.06"
```

PiperOrigin-RevId: 738093448
2025-03-18 12:06:36 -07:00
Ayush Ranjan 1da6370925 Update "Root Filesystem Overlay" section about default rootfs overlay.
Fixes #11559

PiperOrigin-RevId: 738072702
2025-03-18 11:11:59 -07:00
gVisor bot 25d30ccc2c Merge pull request #11529 from tianyuzhou95:albert/mmap-test
PiperOrigin-RevId: 738050948
2025-03-18 10:13:53 -07:00
Jimmy Tran 8d5f3c982a Handle sighandling.KillItself() return error.
Call dumpAndPanicSyscallError for the rare case where we fail to kill the the
Sentry upon detecting an unexpected stub exit. This will provide enough
information determine if a panic occur due to failed SIGKILL attempt or an
unexpected event.

PiperOrigin-RevId: 737751257
2025-03-17 14:29:52 -07:00
Jamie Liu 768c0364e4 kvm: unlock OS thread during machine.available.Wait()
PiperOrigin-RevId: 737750303
2025-03-17 14:25:23 -07:00
Lucas Manning 129d4b63a7 Add support for more TPU devices.
PiperOrigin-RevId: 737696637
2025-03-17 11:53:29 -07:00
Jamie Liu fbca0560dd kvm: honor memmap.File.MemoryType()
Updates #11436

PiperOrigin-RevId: 737689743
2025-03-17 11:34:50 -07:00
Lucas Manning 8482715727 Enable save/restore with TPUproxy.
This change also adds some small cleanup to TPU code.

PiperOrigin-RevId: 737673712
2025-03-17 10:55:06 -07:00
Nayana Bidari e6b6f2aa11 Allow IPv6 addresses to be enabled/disabled in runsc based on the sysctl.
By default in runsc, we have both IPv4 and IPv6 addresses enabled on all the
interfaces. However, in runc this is based on the sysctl
net.ipv6.conf.all.disable_ipv6. This CL will make runsc behave similar to runc.
- If net.ipv6.conf.all.disable_ipv6 is > 0, then only IPv4 addresses will be
enabled on the interfaces including loopback when network mode is "sandbox".

PiperOrigin-RevId: 737656607
2025-03-17 10:10:46 -07:00
Nicolas Lacasse 6b0a0af862 Implement basic packet mode support for ptys.
From man TIOCPKT:
"""
In packet mode, each subsequent read(2) will return a packet that either
contains a single nonzero control byte, or has a single byte containing zero
('\0') followed by data written on the slave side of the pseudoterminal."
"""

This CL implements only the data portion of packet mode, not the control bytes,
but that seems to be enough to get xfce4-terminal to work.

PiperOrigin-RevId: 737175092
2025-03-15 09:26:56 -07:00
Jamie Liu b01944883b Add memmap.File.MemoryType()
This has no effect (outside of debug logging) until cl/723723715.

Updates #11436

PiperOrigin-RevId: 736686635
2025-03-13 17:08:52 -07:00
Lucas Manning 11aeff69c2 Fix host-backed event FD restore.
Before this change, host-backed event FDs would always crash the sandbox
during exit when the sentry tried to wait on the fdnotifier for an FD that
wasn't there.

PiperOrigin-RevId: 736585573
2025-03-13 11:51:37 -07:00
Ayush Ranjan 06f2254962 Deflake TestExecProcList.
There is a race in the test where the goroutine running Container.executeSync()
calls WaitPID() => IsSandboxRunning() which accesses Container.Sandbox.

This can race with the defer Container.Destroy which sets Sandbox = nil.

This race was introduced in 0968254ce7 ("Speed up container_test") which got
rid of the read on channel `ch`.

Fix the race by exec-ing asynchronously. This maintains the old behavior of not
checking if the exit status of sleep.

Fixes 0968254ce7 ("Speed up container_test")

PiperOrigin-RevId: 736572600
2025-03-13 11:18:16 -07:00
Ayush Ranjan 906fb319cc nvproxy: Add option to use the device gofer optionally.
We always use the device gofer in runsc, because the sandbox's filesystem
does not have the GPU devices mounted in it.

PiperOrigin-RevId: 736316547
2025-03-12 17:08:54 -07:00
Jing Chen 63f6dd704d Install CNI plugins from the containerd repo.
Remove the legacy settings, the minimum supported CNI version is 0.4.0.

PiperOrigin-RevId: 736255397
2025-03-12 13:57:52 -07:00
Nayana Bidari c68fb31992 Save runsc version in the metadata during save to compare it during restore.
PiperOrigin-RevId: 736035156
2025-03-12 01:02:48 -07:00
Nicolas Lacasse f9b1ce2f7d Clean up tty.CheckChange and call it in SetForegroundProcessGroup.
Previously, CheckChange (corresponding to Linux's tty/tty_check_change()) was
only used the host TTY implementation, not the devpts implementation.

Furthermore, ThreadGroup.SetForegroundProcessGroup() duplicated some of the
logic in CheckChange, notably sending SIGTTOU to background tasks. This means
that, for host TTYs, we could send SIGTTOU multiple times. In some
circumstances, this leads the ioctl returning ERESTARTSYS in an infinite loop.

PiperOrigin-RevId: 735934036
2025-03-11 16:46:55 -07:00
gVisor bot 93536059ca Merge pull request #11082 from BobyMCbobs:update-gvisor-knative-user-guide
PiperOrigin-RevId: 735931626
2025-03-11 16:40:30 -07:00
Jing Chen c16484e6e8 Reduce the number of containerd tests in buildkite pipelines.
PiperOrigin-RevId: 735553455
2025-03-10 16:40:47 -07:00
Jamie Liu 44b9737347 Increase GOMAXPROCS during aio.GoQueue usage
PiperOrigin-RevId: 735048540
2025-03-08 23:52:19 -08:00
Jamie Liu 8153170320 nvproxy: reduce kernel mmap_lock contention from rmAllocOSDescriptor()
PiperOrigin-RevId: 734667529
2025-03-07 13:23:48 -08:00