Visitar URL original
nvidia-uvm: propagate EGM DMA mapping failures by arpitkjaiswal · Pull Request #1423 · NVIDIA/open-gpu-kernel-modules · GitHub
Skip to content

nvidia-uvm: propagate EGM DMA mapping failures - #1423

Open
arpitkjaiswal wants to merge 1 commit into
NVIDIA:mainfrom
arpitkjaiswal:fix/uvm-egm-dma-errors
Open

arpitkjaiswal wants to merge 1 commit into
NVIDIA:mainfrom
arpitkjaiswal:fix/uvm-egm-dma-errors

Conversation

@arpitkjaiswal

Copy link
Copy Markdown

Return the recorded status from uvm_gpu_map_cpu_pages_for_egm() instead of unconditionally reporting NV_OK. This propagates DMA link and sync failures and restores the caller's NV_ERR_NOT_SUPPORTED fallback when the DMA IOVA API is unavailable.

Add host regression tests that compile the actual mapping function and its caller with platform stubs in both API configurations. Verify error propagation, unlink behavior, accounting, and mapping-cache updates.

Return the recorded status from uvm_gpu_map_cpu_pages_for_egm() instead
of unconditionally reporting NV_OK. This propagates DMA link and sync
failures and restores the caller's NV_ERR_NOT_SUPPORTED fallback when
the DMA IOVA API is unavailable.

Add host regression tests that compile the actual mapping function and
its caller with platform stubs in both API configurations. Verify error
propagation, unlink behavior, accounting, and mapping-cache updates.
@arpitkjaiswal

Copy link
Copy Markdown
Author

uvm_gpu_map_cpu_pages_for_egm() records DMA link/sync failures and NV_ERR_NOT_SUPPORTED, but always returns NV_OK. Its caller consequently records a mapping that was never established, and the unsupported-API fallback is unreachable.

Return the recorded status. Existing success paths, sync-failure cleanup, output handling, and byte accounting are preserved. The caller can now propagate real errors or fall back to non-EGM access without caching an invalid mapping.

Add a host regression suite that extracts and compiles the actual mapping function and uvm_cpu_chunk_map_gpu_egm() with platform stubs, with the DMA IOVA API both enabled and disabled.

Validation:

All 10 tests pass after the fix.
The same suite produces seven failed error-path assertions on the original source.
Covers link and sync errors, unlink cleanup, unsupported-API fallback, mapping-cache state, accounting, disabled/legacy EGM, identity mappings, and valid zero-offset mappings.
git diff --check passes; published file hashes match the tested files.
Run: python3 -m unittest discover -s tests -p 'test_uvm_egm_dma_mapping.py' -v

Tests use GCC 13.3 and Python 3.12. Platform dependencies are stubbed; a full kernel module build and GPU hardware testing have not been performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant