package tpuproxy

import "gvisor.dev/gvisor/pkg/sentry/devices/tpuproxy"

Package tpuproxy contains tpu backend driver proxy implementations and helper functions.

Index

Variables

var (
	// TPUv4DeviceRegex is the regex for detecting TPUv4 device paths.
	TPUv4DeviceRegex = regexp.MustCompile(`/dev/accel(\d+)`)

	// TPUv5DeviceRegex is the regex for detecting TPUv5 device paths.
	TPUv5DeviceRegex = regexp.MustCompile(`/dev/vfio/(\d+)`)
)

Functions

func Filters

func Filters() seccomp.SyscallRules

Filters returns seccomp-bpf filters for this package.

func RegisterTPUv4Device

func RegisterTPUv4Device(ctx context.Context, creds *auth.Credentials, root vfs.VirtualDentry, vfsObj *vfs.VirtualFilesystem, devPath string, minorNum uint32) error

RegisterTPUv4Device registers the TPUv4 device with the provided minor number where the corresponding PCI device is located at pciPath. Accel devices always have their device file number set to their minor number.

func RegisterTPUv5Device

func RegisterTPUv5Device(vfsObj *vfs.VirtualFilesystem, devPath string, minorNum uint32) error

RegisterTPUv5Device registers the TPUv5 device with the provided device path and minor number.

Source Files

seccomp_filter.go tpuproxy.go

Directories

PathSynopsis
pkg/sentry/devices/tpuproxy/accelPackage accel implements a proxy for gasket based accel devices.
pkg/sentry/devices/tpuproxy/utilPackage util contains helper functions for tpuproxy implementations.
pkg/sentry/devices/tpuproxy/vfioPackage vfio implements a proxy for VFIO devices.
Version
v0.0.0-20250605235530-a6711d1e1dc6 (latest)
Published
Jun 5, 2025
Platform
linux/amd64
Imports
19 packages
Last checked
4 hours ago

Tools for package owners.