On 9/17/2026 5:13 PM, Christian König wrote:
On 9/17/26 11:05, Srinivasan Shanmugam wrote:
Replace amdgpu_bo_kmap()/amdgpu_bo_kunmap() in the trap handler code
with ttm_bo_vmap()/ttm_bo_vunmap().

Store the mapping as struct iosys_map and use iosys_map helpers for
memory access. This aligns the trap code with the modern DRM/TTM mapping
interfaces.

Using iosys_map allows the code to use common DRM mapping helpers
instead of directly accessing memory through raw CPU pointers.
I'm really wondering if we shouldn't rework amdgpu_bo_kmap() into 
amdgpu_bo_vmap() and use that everywhere?

Hi Christian,

Thanks, that's a very good point.

Introducing amdgpu_bo_vmap()/amdgpu_bo_vunmap() and gradually
converting existing amdgpu_bo_kmap() users sounds like a useful
cleanup for AMDGPU in general.

I did a quick grep and found amdgpu_bo_kmap() users in a number
of AMDGPU/KFD files, so this seems broader than the trap-specific
conversion.

Would it make sense to keep this trap change focused on the
original conversion and handle the wider AMDGPU migration as a
separate follow-up cleanup activity?

I'd be happy to look into that separately as well.

Regards,
Srini


We can of course start with backward compatible return the kernel poiunter and 
then switch other users of amdgpu_bo_kmap() over to iosys_map one by one.

Regards,
Christian.

Reply via email to