From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: gpu: nova-core: export Rust symbols for dependent modules Date: Thu, 28 May 2026 12:22:00 +1000 Message-ID: In-Reply-To: <20260527-nova-exports-v2-4-06de4c556d55@nvidia.com> References: <20260527-nova-exports-v2-0-06de4c556d55@nvidia.com> <20260527-nova-exports-v2-4-06de4c556d55@nvidia.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review This is the core workaround. The approach: 1. Use `nm -p --defined-only` to extract global text symbols starting with `_R` (Rust v0 mangling prefix) 2. Generate `extern void sym(void); EXPORT_SYMBOL_GPL(sym);` for each 3. Compile the generated header into `nova_core_exports.o` ```makefile rust_exports = \ $(NM) -p --defined-only $(1) | \ awk '$$2 == "T" && $$3 ~ /^_R/ { \ printf "extern void %s(void); EXPORT_SYMBOL_GPL(%s);\n", $$3, $$3 \ }' ``` **Observations:** - Filtering on `$$2 == "T"` (global text) and `$$3 ~ /^_R/` is correct for Rust v0 mangled symbols. This won't accidentally pick up C symbols. - The `extern void sym(void)` declarations are technically type-incorrect (the actual functions have different signatures), but this is only used for `EXPORT_SYMBOL_GPL()` which just needs the symbol address. This is the same pattern used elsewhere in the kernel for cross-language symbol exports. - Using `filechk` ensures the header is regenerated when the object changes. - `nova_core_exports.c` is clean and minimal. **Potential concern:** This exports *all* global Rust text symbols from `nova_core.o`, not just the ones `nova-drm` actually needs. This is a broad export surface. The cover letter acknowledges this is a workaround, so this is acceptable for now, but a comment noting that a more targeted approach would be preferable long-term might be useful. **No blocking issues.** --- Generated by Claude Code Patch Reviewer