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
58#define DRM_AMDGPU_USERQ_SIGNAL 0x1758#define DRM_AMDGPU_USERQ_SIGNAL 0x17
59#define DRM_AMDGPU_USERQ_WAIT 0x1859#define DRM_AMDGPU_USERQ_WAIT 0x18
60#define DRM_AMDGPU_GEM_LIST_HANDLES 0x1960#define DRM_AMDGPU_GEM_LIST_HANDLES 0x19
61#define DRM_AMDGPU_PROC_OPTIONS 0x1A
61 62
62#define DRM_IOCTL_AMDGPU_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_CREATE, union drm_amdgpu_gem_create)63#define DRM_IOCTL_AMDGPU_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_CREATE, union drm_amdgpu_gem_create)
63#define DRM_IOCTL_AMDGPU_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_MMAP, union drm_amdgpu_gem_mmap)64#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
79#define DRM_IOCTL_AMDGPU_USERQ_SIGNAL DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_USERQ_SIGNAL, struct drm_amdgpu_userq_signal)80#define DRM_IOCTL_AMDGPU_USERQ_SIGNAL DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_USERQ_SIGNAL, struct drm_amdgpu_userq_signal)
80#define DRM_IOCTL_AMDGPU_USERQ_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_USERQ_WAIT, struct drm_amdgpu_userq_wait)81#define DRM_IOCTL_AMDGPU_USERQ_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_USERQ_WAIT, struct drm_amdgpu_userq_wait)
81#define DRM_IOCTL_AMDGPU_GEM_LIST_HANDLES DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_LIST_HANDLES, struct drm_amdgpu_gem_list_handles)82#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)
82 84
83/**85/**
84 * DOC: memory domains86 * DOC: memory domains
@@ -1673,6 +1675,25 @@ struct drm_amdgpu_info_uq_metadata { · 1588 unmodified lines
1673#define AMDGPU_FAMILY_GC_11_5_4 154 /* GC 11.5.4 */1675#define AMDGPU_FAMILY_GC_11_5_4 154 /* GC 11.5.4 */
1674#define AMDGPU_FAMILY_GC_12_0_0 152 /* GC 12.0.0 */1676#define AMDGPU_FAMILY_GC_12_0_0 152 /* GC 12.0.0 */
1675 1677
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
1690struct drm_amdgpu_proc_options {
1691 __u32 op;
1692 struct {
1693 __u32 value;
1694 } kfd_sigbus_delay;
1695};
1696
1676#if defined(__cplusplus)1697#if defined(__cplusplus)
1677}1698}
1678#endif1699#endif