drm/amdgpu: Add guest driver CUID support
authorchong li <chongli2@amd.com>
Wed, 6 May 2026 09:21:23 +0000 (17:21 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 18 May 2026 22:13:28 +0000 (18:13 -0400)
commit3635e1104aa21a01c2e6e7dde02a5b3641f4c46c
treea332a6d95537810a93b1ac09612af4d8be012945
parentd3f5bbd007133c64a20e81ef290a93e46c75df40
drm/amdgpu: Add guest driver CUID support

v3:
improve the coding style.

v2:
use debugfs_create_x64 and debugfs_create_x8 to create node.

v1:
1. Add guest driver CUID support
2. Do not expose vf index(variable "fcn_idx") to customers,
   replace the fcn_idx with pad.
   Only expose the unitid to customers.

background:
Change fcn_idx to pad, VF index won't expose to guest vm.
Introduce a new unitid field as the VF identifier to replace the VF index:
 1).unitid is assigned by the host driver
 2).It is delivered to the guest via the pf2vf message
 3).The application or umd can retrieve united from the sysfs node

Signed-off-by: chong li <chongli2@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h