summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_priv.h')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_priv.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
index acd0e41e744c..90f010cbe54e 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
@@ -952,11 +952,32 @@ struct kfd_process {
struct idr event_idr;
/* Event page */
u64 signal_handle;
- struct kfd_signal_page *signal_page;
+ /*
+ * Each signal event needs a 64-bit signal slot where the signaler will
+ * write a 1 before sending an interrupt. (This is needed because some
+ * interrupts do not contain enough spare data bits to identify an
+ * event.) The signal page is allocated in user mode and mapped to the
+ * kernel; individual signal events use their event_id as slot index.
+ */
+ uint64_t *signal_page;
size_t signal_mapped_size;
size_t signal_event_count;
bool signal_event_limit_reached;
+ /**
+ * @kfd_sigbus_delay_ms: Per-process KFD SIGBUS delivery option for
+ * poison/RAS events (set via DRM_IOCTL_AMDGPU_PROC_OPTIONS /
+ * AMDGPU_PROC_OPTIONS_OP_KFD_SIGBUS_DELAY).
+ *
+ * 0 - send SIGBUS immediately (default)
+ * 0xFFFFFFFF - suppress SIGBUS delivery
+ * other - delay SIGBUS delivery by this many milliseconds
+ */
+ atomic_t kfd_sigbus_delay_ms;
+
+ /* Delayed signal delivery to user */
+ struct delayed_work signal_work;
+
/* Information used for memory eviction */
void *kgd_process_info;
/* Eviction fence that is attached to all the BOs of this process. The
@@ -1525,7 +1546,6 @@ extern const struct kfd_device_global_init_class device_global_init_class_cik;
int kfd_event_init_process(struct kfd_process *p);
void kfd_event_free_process(struct kfd_process *p);
-int kfd_event_mmap(struct kfd_process *process, struct vm_area_struct *vma);
int kfd_wait_on_events(struct kfd_process *p,
uint32_t num_events, void __user *data,
bool all, uint32_t *user_timeout_ms,
@@ -1554,6 +1574,7 @@ void kfd_signal_vm_fault_event(struct kfd_process_device *pdd,
void kfd_signal_reset_event(struct kfd_node *dev);
void kfd_signal_poison_consumed_event(struct kfd_node *dev, u32 pasid);
+void kfd_signal_sigbus_delayed_fn(struct work_struct *work);
void kfd_signal_process_terminate_event(struct kfd_process *p);
static inline void kfd_flush_tlb(struct kfd_process_device *pdd)