diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-13 18:36:21 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-13 18:36:21 -0400 |
| commit | 00e54c13c7c9030c4d5f7151467f2d85a3730e29 (patch) | |
| tree | 17a45239df8d2e4912ff3697ed06e85a10b969de /userspace/sdks/nv570/inc/ctrl/ctrl208f/ctrl208fucodeinstrumentation.h | |
| download | open-iov-00e54c13c7c9030c4d5f7151467f2d85a3730e29.tar.gz open-iov-00e54c13c7c9030c4d5f7151467f2d85a3730e29.zip | |
Initial commit: Open-IOV vGPU-IO complete stack
- Firmware decompilation: GSP 570.144W (28.5MB ELF, RV64IMAC), 132 decompiled C files
- Kernel modules: nvidia.ko (34MB, OpenRM), open-iov-vfio.ko (2.8MB, VFIO mdev), gsp-vgpu.ko (1.8MB, guest driver)
- Userspace: libiov.so/libvgpu.so (76KB), example_vgpu (28KB), rpc_emulator.c
- PCI config space emulation (256B with PM, MSI, MSI-X, PCIe caps)
- 12 RPC types fully mapped from firmware decompilation
- BAR trap, WPR, scheduling, notification, migration emulation
- Helper scripts: load_vgpu_stack, create_mdev, launch_qemu_vgpu, test_vgpu_stack, setup_guest_driver, unload_vgpu_stack
- Architecture documentation
- Wiki: 10 technical documents
- Git LFS for large binaries (.ko, .bin, .iso, .img, .o, ghidra repos)
- nvidia-open-gpu-kernel-modules as submodule
Diffstat (limited to 'userspace/sdks/nv570/inc/ctrl/ctrl208f/ctrl208fucodeinstrumentation.h')
| -rw-r--r-- | userspace/sdks/nv570/inc/ctrl/ctrl208f/ctrl208fucodeinstrumentation.h | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/userspace/sdks/nv570/inc/ctrl/ctrl208f/ctrl208fucodeinstrumentation.h b/userspace/sdks/nv570/inc/ctrl/ctrl208f/ctrl208fucodeinstrumentation.h new file mode 100644 index 0000000..f368cc4 --- /dev/null +++ b/userspace/sdks/nv570/inc/ctrl/ctrl208f/ctrl208fucodeinstrumentation.h @@ -0,0 +1,156 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#pragma once + +#include <nvtypes.h> + +// +// This file was generated with FINN, an NVIDIA coding tool. +// Source file: ctrl/ctrl208f/ctrl208fucodeinstrumentation.finn +// + +#include "ctrl/ctrl208f/ctrl208fbase.h" + +/* Numerical ID for each ucode */ +#define NV208F_UCODE_INSTRUMENTATION_SEC2 1 +#define NV208F_UCODE_INSTRUMENTATION_PMU 2 +#define NV208F_UCODE_INSTRUMENTATION_GSP_TASK_RM 3 +#define NV208F_UCODE_INSTRUMENTATION_GSP_TASK_VGPU 4 + +/* Coverage Type */ +#define NV208F_SANITIZER_COVERAGE_TYPE 0 +#define NV208F_BULLSEYE_COVERAGE_TYPE 1 + +/* + * NV208F_CTRL_UCODE_INSTRUMENTATION_STATE_PARAMS + * + * Parameters struct shared by the control calls + * NV208F_CTRL_CMD_UCODE_INSTRUMENTATION_GET_STATE and + * NV208F_CTRL_CMD_UCODE_INSTRUMENTATION_SET_STATE. + */ +typedef struct NV208F_CTRL_UCODE_INSTRUMENTATION_STATE_PARAMS { + NvU32 ucode; + NvU32 gfid; + NvBool bEnabled; + NvBool bClear; + NvU32 instrumentationType; +} NV208F_CTRL_UCODE_INSTRUMENTATION_STATE_PARAMS; + +/* + * NV208F_CTRL_CMD_UCODE_INSTRUMENTATION_GET_STATE + * + * Retrieves the status of the target ucode's instrumentation + * + * ucode numeric id of the desired ucode to target + * gfid specifies which partition to send the command to + * (applies to ucode=NV208F_UCODE_INSTRUMENTATION_GSP_TASK_VGPU only) + * bEnabled whether the ucode's SanitizerCoverage run-time data gathering + * is enabled (NV_TRUE) or not (NV_FALSE) + * instrumentationType determines if using SanitizerCoverage or BullseyeCoverage + * + * Possible status values returned are + * NV_OK + * NV_ERR_INVALID_ARGUMENT + * NV_ERR_INVALID_STATE + */ +#define NV208F_CTRL_CMD_UCODE_INSTRUMENTATION_GET_STATE (0x208f1901) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_DIAG_UCODE_INSTRUMENTATION_INTERFACE_ID << 8) | NV208F_CTRL_UCODE_INSTRUMENTATION_GET_STATE_PARAMS_MESSAGE_ID" */ + +#define NV208F_CTRL_UCODE_INSTRUMENTATION_GET_STATE_PARAMS_MESSAGE_ID (0x1U) + +typedef NV208F_CTRL_UCODE_INSTRUMENTATION_STATE_PARAMS NV208F_CTRL_UCODE_INSTRUMENTATION_GET_STATE_PARAMS; + +/* + * NV208F_CTRL_CMD_UCODE_INSTRUMENTATION_SET_STATE + * + * Enables/disables and optionally clears instrumentation data of the target ucode + * + * ucode numeric id of the desired ucode to target + * gfid specifies which partition to send the command to + * (applies to ucode=NV208F_UCODE_INSTRUMENTATION_GSP_TASK_VGPU only) + * bEnabled whether to enable (NV_TRUE) or disable (NV_FALSE) instrumentation for the given ucode + * bClear whether to clear instrumentation prior to enabling enabling instrumentation + * instrumentationType determines if using SanitizerCoverage or BullseyeCoverage + * + * Possible status values returned are + * NV_OK + * NV_ERR_INVALID_ARGUMENT + * NV_ERR_INVALID_STATE + */ +#define NV208F_CTRL_CMD_UCODE_INSTRUMENTATION_SET_STATE (0x208f1902) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_DIAG_UCODE_INSTRUMENTATION_INTERFACE_ID << 8) | NV208F_CTRL_UCODE_INSTRUMENTATION_SET_STATE_PARAMS_MESSAGE_ID" */ + +#define NV208F_CTRL_UCODE_INSTRUMENTATION_SET_STATE_PARAMS_MESSAGE_ID (0x2U) + +typedef NV208F_CTRL_UCODE_INSTRUMENTATION_STATE_PARAMS NV208F_CTRL_UCODE_INSTRUMENTATION_SET_STATE_PARAMS; + +/* + * NV208F_UCODE_INSTRUMENTATION_RPC_MAX_BYTES_* + * + * Maximum number of bytes that can be retrieved by one RPC call + * (potentially differs per-ucode). These are used to size the buffer in the + * respective ucode RPC parameters. + */ +#define NV208F_UCODE_INSTRUMENTATION_RPC_MAX_BYTES_PMU 128 +#define NV208F_UCODE_INSTRUMENTATION_RPC_MAX_BYTES_GSPRM 65536 + +/* + * NV208F_CTRL_CMD_UCODE_INSTRUMENTATION_GET_DATA + * + * Retrieves instrumentation data of the target ucode in chunks. + * Call repeatedly with increasing offset until bComplete is NV_TRUE. + * + * Inputs: + * ucode [in] Numeric ID of the desired ucode to retrieve data from + * gfid [in] Specifies which partition to send the command to + * (applies to ucode=NV208F_UCODE_INSTRUMENTATION_GSP_TASK_VGPU only) + * offset [in] Byte offset from start of coverage data stream. + * Pass 0 on first call, then pass cumulative dataSize + * from previous calls. + * instrumentationType [in] Determines if using SanitizerCoverage or BullseyeCoverage + * + * Outputs: + * data [out] Buffer containing retrieved coverage data + * dataSize [out] Number of bytes written to data[] in this call + * bComplete [out] NV_TRUE when all data has been retrieved, + * NV_FALSE if more chunks remain + * + * Possible status values returned are + * NV_OK + * NV_ERR_INVALID_ARGUMENT + * NV_ERR_INVALID_STATE + */ +#define NV208F_CTRL_CMD_UCODE_INSTRUMENTATION_GET_DATA (0x208f1903) /* finn: Evaluated from "(FINN_NV20_SUBDEVICE_DIAG_UCODE_INSTRUMENTATION_INTERFACE_ID << 8) | NV208F_CTRL_UCODE_INSTRUMENTATION_GET_DATA_PARAMS_MESSAGE_ID" */ + +#define NV208F_CTRL_UCODE_INSTRUMENTATION_GET_DATA_PARAMS_MESSAGE_ID (0x3U) + +typedef struct NV208F_CTRL_UCODE_INSTRUMENTATION_GET_DATA_PARAMS { + NvU32 ucode; + NvU32 gfid; + NvU32 offset; + NvU32 instrumentationType; + NvU8 data[NV208F_UCODE_INSTRUMENTATION_RPC_MAX_BYTES_GSPRM]; + NvU32 dataSize; + NvBool bComplete; +} NV208F_CTRL_UCODE_INSTRUMENTATION_GET_DATA_PARAMS; + +/* _ctrl208fucodeinstrumentation_h_ */ |
