19 Commits
Author SHA1 Message Date
54f52a216e Register NVIDIA driver version 615.15.00 in nvproxy.
The version is configured to inherit from `v610_43_02` as the UVM ABI
changes in `615.15.00`  (such as the removal of `length` from `UVM_FREE`
and `gpuUuid` from `UVM_UNREGISTER_CHANNEL`) are already implemented in
gVisor's `_V590` structures.

Co-authored-by: Jing Chen [email protected]
PiperOrigin-RevId: 944241063
2026-07-07 20:34:08 -07:00
Ayush RanjanandgVisor bot e39ef3577f nvproxy: Add support for NVIDIA driver version 610.43.02.
PiperOrigin-RevId: 931498048
2026-06-12 22:18:22 -07:00
Tamir Duberstein 1f12a0d388 Fix QF1012 violations and drop suppression 2026-02-10 11:56:10 -08:00
Ayush RanjanandgVisor bot 32d34dc396 Update nvidia_driver_differ to also check ioctl numbers.
Updated the tooling to fetch the ioctl number used in the driver source code
and compare it to the one used in nvproxy. It is possible that ioctl numbers
change across driver versions (under our foot). It is imperative that we mimic
these changes in nvproxy. For example, in 575.57.08 driver release,
NV2080_CTRL_CMD_FB_QUERY_DRAM_ENCRYPTION_INFOROM_SUPPORT changed from
0x20801358 to 0x20801357.

To achieve this effect, the AST parser has been updated in the previous change
to be able to parse numerical constants. However, it is unable to parse macros
that evaluate to constants (trust me, I tried). So as a workaround, the
nvidia_driver_differ declares "const uint64_t" variables in the source file
which is created with all relevant includes (see parser.WriteIncludeFile()).
These variables are defined with name "GVISOR_{IOCTL_MACRO} = IOCTL_MACRO" so
they should not conflict with anything in the driver. Then we use the AST
parser to evaluate the value of the const variable and return that.

PiperOrigin-RevId: 793350829
2025-08-10 12:01:26 -07:00
Ayush RanjanandgVisor bot 27a81c303b Add support for parsing constants from NVIDIA driver in driver_ast_parser.
The `driver_ast_parser` tool is now able to parse constants alongside with
structs. This is done by adding a new `constants` field in the JSON input, and
a `constants` field in the JSON output. This will be used later to detect
changes in constants between driver versions.

Also, the parser's `structs` argument was renamed to `input` to account for
both structs and constants.

PiperOrigin-RevId: 792677998
2025-08-08 10:39:19 -07:00
Ayush RanjanandgVisor bot 4fa9078c68 nvproxy: Remove SupportedStructNames() for simplification.
We have `SupportedStructTypes` which provides the same list of structs but
also includes their type.

This is also more performant, because TestStructDefinitionParity was calling
SupportedStructNames() and SupportedStructTypes(), which was doing duplicate
work of reconstructing the entire ABI twice.

This change also gets rid of TestSupportedStructNames. We are already testing
that in TestStructDefinitionParity. Should speed up tests as we don't have to
compile and analyze the driver source code twice for nvproxy_driver_parity_test

PiperOrigin-RevId: 789894363
2025-08-01 14:22:35 -07:00
Ayush RanjanandgVisor bot 5d3cd58e18 nvproxy: Refactor DriverVersion out to nvconf package.
This allows for runsc to be able to use DriverVersion without having to depend
on the entirety of nvproxy.

PiperOrigin-RevId: 733912696
2025-03-05 16:43:03 -08:00
Anthony CuiandgVisor bot 2f4b9cfc5a Have driver_ast_parser report offset of record fields.
PiperOrigin-RevId: 660490627
2024-08-07 12:25:44 -07:00
Anthony CuiandgVisor bot 4da6dfa62a Have driver_ast_parser track if a record is a union type.
PiperOrigin-RevId: 660480745
2024-08-07 12:01:30 -07:00
Anthony CuiandgVisor bot 7e6814cbab Have driver_ast_parser report the size of structs and types.
PiperOrigin-RevId: 660453033
2024-08-07 10:55:09 -07:00
Anthony CuiandgVisor bot 1a57cf540d Add nvproxy test verifying that ABI struct names exist in the source code.
PiperOrigin-RevId: 657773809
2024-07-30 16:46:30 -07:00
Anthony CuiandgVisor bot e291cf72b5 Create Go tool for diffing Nvidia driver code using the Clang AST parser.
PiperOrigin-RevId: 657761554
2024-07-30 16:05:13 -07:00
Anthony CuiandgVisor bot 0b0097e27e Add helper code to set up and run the parser on a given driver version.
PiperOrigin-RevId: 657727841
2024-07-30 14:22:03 -07:00
Anthony CuiandgVisor bot dd01749f67 Have tool recurse through all structs and TypeDefs.
This is an improvement from just comparing the fields of top-level structs.
As a part of this, we handle anonymous records and arrays as well.

PiperOrigin-RevId: 657652481
2024-07-30 10:51:57 -07:00
Anthony CuiandgVisor bot 9d91151d2f Don't pass file paths as strings.
Instead of passing file paths as strings, now pass os.File or directory paths
for compile_commands.json since it's always named that.

PiperOrigin-RevId: 657349644
2024-07-29 15:44:00 -07:00
Anthony CuiandgVisor bot 8e863a39a2 Add missing struct source files.
PiperOrigin-RevId: 656112382
2024-07-25 15:23:29 -07:00
Anthony CuiandgVisor bot 1af482f276 Add code to search and generate the necessary include files for the Clang tool.
PiperOrigin-RevId: 655691975
2024-07-24 14:04:56 -07:00
Anthony CuiandgVisor bot 6bb3f536e3 Generate necessary config files for the Clang tool on the Go side.
PiperOrigin-RevId: 655682520
2024-07-24 13:37:00 -07:00
Anthony CuiandgVisor bot 6efcd603af Add struct definitions from the Clang tool to the Go side.
PiperOrigin-RevId: 655623963
2024-07-24 10:51:16 -07:00