History

drm/amdgpu: add ioctl to handle RAS poison error

Add a new DRM_IOCTL_AMDGPU_PROC_OPTIONS ioctl with the AMDGPU_PROC_OPTIONS_OP_KFD_SIGBUS_DELAY option, allowing userspace (ROCr) to control per-process SIGBUS delivery. Userspace for this can be found at: https://github.com/ROCm/rocm-systems/pull/6190

Yifan Zhang committed 6 months ago

Commit 445075e1 parent a665d098 files · +173 −1Browse files

Showing the changes to include/uapi (1 of 8 files). Show all

Unified · Split

include/uapi/drm/amdgpu_drm.h+21−0
@@ -58,6 +58,7 @@ extern "C" { · 57 unmodified lines
5858 #define DRM_AMDGPU_USERQ_SIGNAL 0x17
5959 #define DRM_AMDGPU_USERQ_WAIT 0x18
6060 #define DRM_AMDGPU_GEM_LIST_HANDLES 0x19
61+#define DRM_AMDGPU_PROC_OPTIONS 0x1A
6162
6263 #define DRM_IOCTL_AMDGPU_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_CREATE, union drm_amdgpu_gem_create)
6364 #define DRM_IOCTL_AMDGPU_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_MMAP, union drm_amdgpu_gem_mmap)
@@ -79,6 +80,7 @@ extern "C" { · 15 unmodified lines
7980 #define DRM_IOCTL_AMDGPU_USERQ_SIGNAL DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_USERQ_SIGNAL, struct drm_amdgpu_userq_signal)
8081 #define DRM_IOCTL_AMDGPU_USERQ_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_USERQ_WAIT, struct drm_amdgpu_userq_wait)
8182 #define DRM_IOCTL_AMDGPU_GEM_LIST_HANDLES DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_LIST_HANDLES, struct drm_amdgpu_gem_list_handles)
83+#define DRM_IOCTL_AMDGPU_PROC_OPTIONS DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_PROC_OPTIONS, struct drm_amdgpu_proc_options)
8284
8385 /**
8486 * DOC: memory domains
@@ -1673,6 +1675,25 @@ struct drm_amdgpu_info_uq_metadata { · 1588 unmodified lines
16731675 #define AMDGPU_FAMILY_GC_11_5_4 154 /* GC 11.5.4 */
16741676 #define AMDGPU_FAMILY_GC_12_0_0 152 /* GC 12.0.0 */
16751677
1678+/*
1679+ * Definition of user options
1680+ *
1681+ * option: AMDGPU_PROC_OPTIONS_OP_KFD_SIGBUS_DELAY
1682+ * 0: Disable sigbus delay - SIGBUS will be raised immediately
1683+ * 0xFFFFFFFF: SIGBUS will not be raised
1684+ * other: Set the sigbus delay in milliseconds
1685+ */
1686+#define AMDGPU_PROC_OPTIONS_OP_KFD_SIGBUS_DELAY 0
1687+
1688+#define AMDGPU_PROC_OPTIONS_KFD_SIGBUS_DELAY_DISABLED 0xFFFFFFFFu
1689+
1690+struct drm_amdgpu_proc_options {
1691+ __u32 op;
1692+ struct {
1693+ __u32 value;
1694+ } kfd_sigbus_delay;
1695+};
1696+
16761697 #if defined(__cplusplus)
16771698 }
16781699 #endif