Signal MEMORY_EXCEPTION EVENTFD subscriptions from the KGD-side VM fault
interrupt handler.

Reuse the existing VM fault interrupt handler which already decodes the
fault address and status. MEMORY_EXCEPTION subscriptions are currently
GPU-scoped, so eventfd signaling uses queue_id = 0.

EVENTFD remains notification-only.

Cc: Alex Deucher <[email protected]>
Cc: Christian König <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c 
b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
index 8eb9847d9e1e..15f9d259e2b5 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
@@ -135,6 +135,19 @@ static int gmc_v11_0_process_interrupt(struct 
amdgpu_device *adev,
 
                amdgpu_vm_update_fault_cache(adev, entry->pasid, addr, status,
                                             entry->vmid_src ? AMDGPU_MMHUB0(0) 
: AMDGPU_GFXHUB(0));
+
+               if (adev_to_drm(adev)) {
+                       struct drm_file *file;
+
+                       list_for_each_entry(file, &adev_to_drm(adev)->filelist, 
lhead) {
+                               struct amdgpu_fpriv *fpriv = file->driver_priv;
+
+                               if (fpriv)
+                                       
amdgpu_eventfd_signal(&fpriv->eventfd_mgr,
+                                                             
DRM_AMDGPU_EVENT_TYPE_MEMORY_EXCEPTION,
+                                                             0);
+                       }
+               }
        }
 
        if (printk_ratelimit()) {
-- 
2.34.1

Reply via email to