summaryrefslogtreecommitdiffstats
path: root/userspace/sdks/nv570/inc/nvdump.h
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-13 18:36:21 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-13 18:36:21 -0400
commit00e54c13c7c9030c4d5f7151467f2d85a3730e29 (patch)
tree17a45239df8d2e4912ff3697ed06e85a10b969de /userspace/sdks/nv570/inc/nvdump.h
downloadopen-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/nvdump.h')
-rw-r--r--userspace/sdks/nv570/inc/nvdump.h164
1 files changed, 164 insertions, 0 deletions
diff --git a/userspace/sdks/nv570/inc/nvdump.h b/userspace/sdks/nv570/inc/nvdump.h
new file mode 100644
index 0000000..45f607f
--- /dev/null
+++ b/userspace/sdks/nv570/inc/nvdump.h
@@ -0,0 +1,164 @@
+/*
+ * SPDX-FileCopyrightText: Copyright (c) 1993-2022 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.
+ */
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Module: nvDump.h
+// Shared definitions for HW/SW dumping facility residing in resman/rc.
+//
+// **************************************************************************
+
+#ifndef _NVDUMP_H_
+#define _NVDUMP_H_
+
+#include "nvtypes.h"
+
+//-------------------------------------------------------------------------
+// DEFINTIONS
+//-------------------------------------------------------------------------
+
+#define NVDUMP_SUB_ALLOC_NOT_ENCODED 0x01
+#define NVDUMP_SUB_ALLOC_VALID 0x02
+#define NVDUMP_SUB_ALLOC_HAS_MORE 0x04
+
+#define NVDUMP_DEBUG_BUFFER_MAX_SIZE 4096 // max of 4K per buffer
+#define NVDUMP_DEBUG_BUFFER_MAX_SUBALLOCATIONS 256
+
+#define NVDUMP_CONFIG_SIGNATURE "NVDUMPCONFIGSIG" // multiple of 8 bytes
+
+typedef enum
+{
+ // The following components are GPU instance specific:
+ NVDUMP_COMPONENT_DEBUG_BUFFERS = 0,
+ NVDUMP_COMPONENT_ENG_MC,
+ NVDUMP_COMPONENT_ENG_FIFO,
+ NVDUMP_COMPONENT_ENG_GRAPHICS,
+ NVDUMP_COMPONENT_ENG_FB,
+ NVDUMP_COMPONENT_ENG_DISP,
+ NVDUMP_COMPONENT_ENG_FAN,
+ NVDUMP_COMPONENT_ENG_THERMAL,
+ NVDUMP_COMPONENT_ENG_FUSE,
+ NVDUMP_COMPONENT_ENG_VBIOS,
+ NVDUMP_COMPONENT_ENG_PERF,
+ NVDUMP_COMPONENT_ENG_BUS,
+ NVDUMP_COMPONENT_ENG_PMU,
+ NVDUMP_COMPONENT_ENG_ALL,
+ NVDUMP_COMPONENT_ENG_CE,
+ NVDUMP_COMPONENT_ENG_GPU,
+ NVDUMP_COMPONENT_ENG_LPWR,
+ NVDUMP_COMPONENT_ENG_NVD,
+ NVDUMP_COMPONENT_ENG_VOLT,
+ NVDUMP_COMPONENT_ENG_CLK,
+ NVDUMP_COMPONENT_ENG_SEC2,
+ NVDUMP_COMPONENT_ENG_NVLINK,
+ NVDUMP_COMPONENT_ENG_NVDEC,
+ NVDUMP_COMPONENT_ENG_DPU,
+ NVDUMP_COMPONENT_ENG_FBFLCN,
+ NVDUMP_COMPONENT_ENG_HDA,
+ NVDUMP_COMPONENT_ENG_NVENC,
+ NVDUMP_COMPONENT_ENG_GSP,
+ NVDUMP_COMPONENT_ENG_INFOROM,
+ NVDUMP_COMPONENT_ENG_GCX,
+ NVDUMP_COMPONENT_ENG_KGSP,
+ // The following components are global to the system:
+ NVDUMP_COMPONENT_SYS_RCDB = 0x400,
+ NVDUMP_COMPONENT_SYS_SYSINFO,
+ NVDUMP_COMPONENT_SYS_ALL,
+ // The following components are nvlog related.
+ NVDUMP_COMPONENT_NVLOG_RM = 0x800,
+ NVDUMP_COMPONENT_NVLOG_ALL,
+ // Reserved
+ NVDUMP_COMPONENT_NVLOG_RESERVED = 0xB00,
+} NVDUMP_COMPONENT;
+
+#define NVDUMP_IS_GPU_COMPONENT(c) ((c) < NVDUMP_COMPONENT_SYS_RCDB)
+#define NVDUMP_IS_SYS_COMPONENT(c) (((c) >= NVDUMP_COMPONENT_SYS_RCDB) && \
+ ((c) < NVDUMP_COMPONENT_NVLOG_RM))
+#define NVDUMP_IS_NVLOG_COMPONENT(c) (((c) >= NVDUMP_COMPONENT_NVLOG_RM) && \
+ ((c) < NVDUMP_COMPONENT_NVLOG_RESERVED))
+
+typedef enum
+{
+ NVDUMP_BUFFER_PROVIDED = 0, // Dump buffer provided by caller
+ NVDUMP_BUFFER_ALLOCATE, // Dump buffer to be allocated
+ NVDUMP_BUFFER_COUNT, // Just count, no buffer needed
+} NVDUMP_BUFFER_POLICY;
+
+typedef enum
+{
+ NVDUMP_STATUS_IDLE,
+ NVDUMP_STATUS_ERROR,
+ NVDUMP_STATUS_COUNT_REQUESTED,
+ NVDUMP_STATUS_COUNT_COMPLETE,
+ NVDUMP_STATUS_DUMP_REQUESTED,
+ NVDUMP_STATUS_DUMP_BUFFER_FULL,
+ NVDUMP_STATUS_DUMP_END_OF_MSG,
+ NVDUMP_STATUS_DUMP_COMPLETE,
+} NVDUMP_STATUS;
+
+//
+// The following structures require that all elements are precisely sized
+// and aligned on natural boundaries.
+//
+
+typedef struct
+{
+ NvP64 address NV_ALIGN_BYTES(8);
+ NvU32 size;
+ NvU32 curNumBytes;
+} NVDUMP_BUFFER;
+
+// Max number of bytes that can be returned in a dump buffer
+#define NVDUMP_MAX_DUMP_SIZE (1 << 20) // 1 MB
+
+typedef struct
+{
+ NvU8 sigHead[sizeof(NVDUMP_CONFIG_SIGNATURE)] NV_ALIGN_BYTES(8);
+
+ NvP64 debuggerControlFuncAddr NV_ALIGN_BYTES(8);
+ NVDUMP_BUFFER buffer;
+ NvU32 gpuSelect;
+ NvU32 component;
+ NvU32 dumpStatus;
+ NvU32 rmStatus;
+
+ NvU8 sigTail[sizeof(NVDUMP_CONFIG_SIGNATURE)] NV_ALIGN_BYTES(8);
+} NVDUMP_CONFIG;
+
+typedef struct
+{
+ NvU16 length;
+ NvU16 start;
+ NvU16 end;
+ NvU16 flags;
+ NvU16 tag;
+} NVDUMP_SUB_ALLOC_HEADER;
+
+//
+// Export is needed to allow remote kernel debuggers without symbols
+// to find global NVDUMP_CONFIG variables in driver export address table.
+//
+#define NVDUMP_EXPORT
+
+#endif // _NVDUMP_H_
+