Consistently use "handler is undefined" for missing handlers.

nvproxy additionally branches at the following points which are not covered by
the ABI struct:
1. Frontend ioctl NV_ESC_RM_ALLOC_MEMORY on
   nv_ioctl_nvos02_parameters_with_fd::params::hClass.
2. Frontend ioctl NV_ESC_RM_VID_HEAP_CONTROL on NVOS32_PARAMETERS::function.

In case nvproxy doesn't implement one of the values, it should print a warning
with the same prefix of "handler is undefined" which is used for other branch
points. This will make it easier to grep for missing nvproxy functionality.

Also update documentation for nvproxy debugging. Earlier, nvproxy logged
"nvproxy: unknown ..." for such situations. That changed with 6953ca0ca3
("Add NVIDIA driver capability segmentation support to nvproxy."), which moved
to using "nvproxy: handler is undefined ...".

PiperOrigin-RevId: 726565029
This commit is contained in:
Ayush Ranjan
2025-02-13 11:22:19 -08:00
committed by gVisor bot
parent dd8ea25e78
commit 5457cf6def
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -207,8 +207,8 @@ Please
[open a GitHub issue](https://github.com/google/gvisor/issues/new?labels=type%3A+bug,area%3A+gpu&template=bug_report.yml)
to describe about your use case. If a missing `ioctl` implementation is the
problem, then the [debug logs](/docs/user_guide/debugging/) will contain
warnings with prefix `nvproxy: unknown *`. See below on how to run the
`ioctl_sniffer` tool.
warnings with prefix `nvproxy: handler is undefined *`. See below on how to run
the `ioctl_sniffer` tool.
### Debugging
+2 -2
View File
@@ -450,7 +450,7 @@ func rmAllocMemory(fi *frontendIoctlState) (uintptr, error) {
case nvgpu.NV01_MEMORY_SYSTEM_OS_DESCRIPTOR:
return rmAllocOSDescriptor(fi, &ioctlParams)
default:
fi.ctx.Warningf("nvproxy: unknown NV_ESC_RM_ALLOC_MEMORY class %v", ioctlParams.Params.HClass)
fi.ctx.Warningf("nvproxy: %s for NV_ESC_RM_ALLOC_MEMORY class %v", errUndefinedHandler.Error(), ioctlParams.Params.HClass)
return 0, linuxerr.EINVAL
}
}
@@ -1305,7 +1305,7 @@ func rmVidHeapControl(fi *frontendIoctlState) (uintptr, error) {
case nvgpu.NVOS32_FUNCTION_ALLOC_SIZE:
return rmVidHeapControlAllocSize(fi, &ioctlParams)
default:
fi.ctx.Warningf("nvproxy: unknown VID_HEAP_CONTROL function %d", ioctlParams.Function)
fi.ctx.Warningf("nvproxy: %s for VID_HEAP_CONTROL function %d", errUndefinedHandler.Error(), ioctlParams.Function)
return 0, linuxerr.EINVAL
}
}