From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.182 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796250972; b=x+uNsduV4ceXjcYrAcOrKp0IKmxYHM9OptaBn5Gnq0LDl33cXW0soR/+SCeK3kDhGc/j M5kaRZwTa7jr4EqV1XIePCGsee7Gmb0Yk/hsoh09OyDNFtKQcHVV9xT8oFE0RwqCc4Ktw JnmiZL+sJ5At48Z75Xg4kOJ167G8idwm7gHSazCXf/TnQ3uXxRxQ0F2JBcKWGlEX99B/l hBkqf6DbLGeQ3P6//doLU7LN5/20luG83G9GyGSR9ffR2rtG5A49JD2AWmhqZyqACg9cA JJ6tSRMio8hSiQdyJe3KbGvXXUIoiOmw3QBfQ2wKq3Gtmi1j7cYVzECYp2TiD3xHtVw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796250972; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Subject:Date:Message-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key; bh=950kHuTl9YaQOepDya9g9f1mpbTKNfSorY+yzeWAukM=; b=1TNip00FnQtsiLtdKOdzq52jyo85iEGBwJ/O+n8x25wNMsK548tUhujmXZR0wUW153Bw QQdoI/fqFy0tnFtV6YMewYzS7FiyDAdPgo0dqTARaJV233bhlPnWkeMG6SSgNf/aWcDoK umxsnwZuJlj7u6uzFzvuNz/EkhbU8Xk8ia71pOLjbwW/zPlNCSjgEOtWiw1CaWTjuCDCP ydBK3uEuYRWbq0wgq0pwVexTkcOD5N9pM3j2VaFh9MdquyEf05aQ7eOpjYel4EZ5McCvX Ys7j3termrsXwshrfEWUV9jwMRQ9IQLvVNtu6OfOv5jKVNvvEIGjSbTkfaFqAE0LJ3w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=vKqHmibW; arc=none smtp.remote-ip=209.85.128.182 Received: from mail-yw1-f182.google.com (mail-yw1-f182.google.com [209.85.128.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00EB0606A322 for ; Wed, 2 Dec 2026 22:36:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 00EB0606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=vKqHmibW Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-8b2d14968c9so132926987b3.0 for ; Wed, 02 Dec 2026 14:36:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796250971; x=1796855771; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:content-type:mime-version :message-id:date:subject:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=950kHuTl9YaQOepDya9g9f1mpbTKNfSorY+yzeWAukM=; b=vKqHmibWpKS91HLg0fTyDNKbNoh3A+mxxq1UVCxECiMLis74Bz8/2E8GwgREM53j4p tFen2opzHabTnLOx5JdiakD/kND2i+ER91SI8bbHK2sQg1s1jsTlxx7WsH5y2c8uquGt Ayb5Ez5OY6hy0z0rXWOQwR04DwpC14O3CBwYGMFNINkxfauMxefLNTrLCgSZthWzgkUx WfqWRxgt/bPAH79+vg0v+z+Fnqi3jmoft9g5///kFAX8H2fLvgwa09fKErb9KuQYj2Ij bh5Gt6RUJuu+LAd1u4AnHk3XM80Eer21tlS0qaeTxr6m3uTzBn7fRbI9XOMaLWwR5kUV hyjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796250971; x=1796855771; h=cc:to:content-transfer-encoding:content-type:mime-version :message-id:date:subject:from:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=950kHuTl9YaQOepDya9g9f1mpbTKNfSorY+yzeWAukM=; b=kzX9JlAl4eXwDmOu/MJsioCE9dJVrWSRKXQ7irLxHTicrnFSIB7blWzI+sOgqeJvAO lBM8FnR5t0AiLaDSnnoB+Sp5eLY4Cvn2MS4clb5HV2VemkrjDxpQwxRej8qdmsF4tbI5 oKC5A8ar9iW4DAK+1SXkgawM34Y/48K4GEzhorAVj7LiGbnwceXGqhKKlchpkqSFWIVD EGlVPh3SuOF57yxiVTAva+w4NtynCE7Y5IiKhUIOLxQ8P3A85DyEYIp4VMNhnPAPYlFr /GglG3tRjmNi7zMHBjWQRUu47hiuNm7p4CvXP3exGGc9K2+VQJMbZTMuTPotOCa0w5PQ CDwQ== X-Forwarded-Encrypted: i=1; AL+hErFchor3tWFCKxrpPurzhZrbkuJEdBpa7bRusrAeDeBikSOh+h/8ovksj4TzVXl6Dn4nm9LVTShVHNH4LSk=@vger.kernel.org X-Gm-Message-State: APuU4Z9hT8uYxqcjXYMHOgmAVDb2uywsibLYC/R1T6aypYTrIqD6UbUU hiBHyCXAtvu9XgyluImBCNYBxv7r3qfhREVeBuPPgHciiXa/BbAfzmtU X-Gm-Gg: AZFdTZdC54EgpKwr5pQObCGNsT23KuDUHxaG8BEQESYDd6hx/X2xeDUN6bXkNhvg0nV M4TmQNgTIzO6re3Tjyh/s2BT86MLWoTq4i1YeVQNpk5fZV3hL2hBv1b2cPoHgP01MeilJ+OosvT +5ejO2gWzlmXQ6LvksI1CF9nQf2oPngyHCBML+QTvO3t8KVXGkBxIPojdNc2H8XKLMOKpK85Q/x 5U+vMW198m+419raKSYJ3IAdrSpLen7ozAkuD8MvVuEEgb7lk7sBi3UQEnTSIrUMe/EqDDSLG75 JqyUS6lsUKpud2Z5r9iOtmsHV/6MLrP1v851QJoPnitQZqacMZfFnr1GuQZ0q78Yam8Nowvizec JRLYQpRaMB3Zu/hIabVYwx7pRft6NyTAmTllHl5ahSourBCTcPX1TRo8700LS4gnGuyMTpyaLWU vUqq56KUSN203dAZgyQoIWPgFP/ZLNtA06KbQJ/sA+03JIvQfbbvFn7/Jupm7dZ+CKLsHfWtr3Q e3sjFdoMqGudTRCDAZY8mZymSN2Vbili6jBobrWQgDcU89NNRyOGu4LA+Qfnx7nv15o217e+qMF dLJ5B31asUn0Jg4OIIxfCKRnLJJd94w/QlaRFAAH1IBqHyjB8tNi8h4UCG4Q5f8KMCGCXtwP+5+ SzseXUKhQaFQzO9oQH+E1V1cHh+47xUy62Lcb1d5W2paCQo+qSY0xxRv9jCS0BBKOzlEalariGZ GDTPxxRC8ircB0fkZGJy1ZZUKEPYIukrCrRazXInw= X-Received: by 2002:a05:690e:438d:b0:67d:b9c2:3d39 with SMTP id 956f58d0204a3-67df44556ecmr9588402d50.97.1796250970769; Wed, 02 Dec 2026 14:36:10 -0800 (PST) Received: from localhost (107-220-129-194.lightspeed.chrlnc.sbcglobal.net. [107.220.129.194]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-67df31fa7afsm18302013d50.1.2026.12.02.14.36.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 14:36:10 -0800 (PST) From: Matt Turner Subject: [PATCH 00/14] drm/amdgpu: capture more of the hang state in the devcoredump Date: Wed, 02 Dec 2026 17:36:06 -0500 Message-Id: <20261202-amdgpu-devcoredump-v1-0-3dfa0e033b97@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/22OzY7DIAwGXyXyeZFwSMDkVVY9EGMaDvlZklQrV X330lZ72+NInvF3h11Klh2G5g5FbnnP61IBvxrgKSxXUTlWhla3FhFJhTlet1NFufFaJJ7zplJ 0wRsmpwWhiluRlH/f0e9L5THsosYSFp5eqf8K7/OPWuTnrDOOjw9bOHiqI4YmdYnE94yuFe7sy EI2dUHTqDWiYyckMToDfy95ned8DA2ZvqfEiQyzRxTtvW0lVIXIhBh7b521rOHyeDwBnEWJDBE BAAA= X-Change-ID: 20261118-amdgpu-devcoredump-fd7a93c870e1 To: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Sunil Khatri , Trigger Huang Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Matt Turner , Gregoire Pean X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4809; i=mattst88@gmail.com; h=from:subject:message-id; bh=n2QVQePMaaXA/2TjyWcouesizDFoaruQ0t5c26jSHdE=; b=owGbwMvMwCW25rVmCc8sv+mMp9WSGLIF5kZcvz9T6rDOIjVDT4uSoiuqUa9PPW2+sGkmg2XJ5 Jk/S0tTOz6yMIhxMcwUU2SJW6/IMqttx1Kf09K/YOawMoEMkRZpYAACFga+3MS8UiMdIz1TbUM9 QyBDxygeIqfHoJFZXFyaWqSbVlDkkJdfkliSmZ9XrJdfkJpXkF6gl5aZVpKRkV9UnAo0Qi8vtcT U1dHNyNDAxNLRwszJwtHUxNnZydDJzdHR2dXJyNLcxMDZ0tHE1dKcgYtTAOaa1AMM/4yWf43fXZ +2U2/y73ViundqNkbtucjbJLCqb8W+J+JBt24wMmzTiWPtvxWeFbD70KU7T0zE75d/j+u+6v+qi 2ulMndOFj8A X-Developer-Key: i=mattst88@gmail.com; a=openpgp; fpr=3BB639E56F861FA2E86505690FDD682D974CA72A The amdgpu devcoredump often doesn't have enough in it to tell why a job hung, and some of what it has describes the wrong moment. The IB contents are read from the coredump worker, which runs concurrently with recovery, so by then the process may have been killed or VRAM lost, and a later hang or fault can replace the IP registers and the VM fault info before the dump is formatted. Nothing in the dump shows which part of a ring belongs to which submission, which BO an address belongs to, or what the memory the IBs point at contained. When a dump is dropped, nothing says so. Patches 1 to 5 fix dumps that describe the wrong state or are missing. An XGMI hive dumped only the requesting device, and dumped it again after suspending it, and every device in the hive was given the hung job. A second hang could overwrite the IP registers while the first dump was being formatted. Resets done by a reset handler produced no coredump. The VM fault info was read when the dump was formatted rather than when the hang was detected. Patch 6 adds CP_STAT to the gfx10, gfx11 and gfx12 IP dumps, and the IB2 progress registers to the per gfx queue dumps of gfx11 and gfx12. Patches 7 and 8 copy the IB contents before formatting, and then from the job timeout handler itself, before soft recovery or a reset can change them. That path is a dma_fence signaling critical section, so everything there is trylocked, allocated with GFP_NOWAIT and read without the slow MMIO path for CPU invisible VRAM, and at most 8 MiB is copied there so as not to hold up recovery. What can't be copied is retried from the worker and marked as such. Patches 9 to 12 add the submitting thread of the hung job, the unsignaled fences of each ring, a count of dropped dumps, and the VM mappings of the hung job. Patch 13 adds AMDGPU_VM_PAGE_DUMP, a mapping flag with which userspace asks for the contents of a mapping to be included in the coredump, subject to size limits. The RADV side is https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/47015. Patch 14 bumps the coredump version, since the format has changed. This series depends on "drm/amdgpu: fix IB content read in the devcoredump" from the "drm/amdgpu: devcoredump and reset fixes" series, and not on the other patches there. Signed-off-by: Matt Turner --- Matt Turner (14): drm/amdgpu: dump the IP state of each device in an XGMI hive drm/amdgpu: only give the hung job to its own device's coredump drm/amdgpu: don't overwrite the IP state while a coredump is formatted drm/amdgpu: take a coredump before resets done by a reset handler drm/amdgpu: copy the VM fault info when the hang is detected drm/amdgpu/gfx10-12: dump CP_STAT and the IB2 state of each gfx queue drm/amdgpu: copy the IB contents before formatting the devcoredump drm/amdgpu: copy the IB contents when the hang is detected drm/amdgpu: record the submitting thread of the hung job in the coredump drm/amdgpu: dump the unsignaled fences of each ring in the coredump drm/amdgpu: report dropped devcoredumps drm/amdgpu: list the VM mappings of the hung job in the coredump drm/amdgpu: add AMDGPU_VM_PAGE_DUMP to include BOs in the coredump drm/amdgpu: bump the devcoredump version drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 + drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 5 + drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 980 ++++++++++++++++++++--- drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.h | 74 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 31 +- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 9 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 12 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.h | 6 + drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 40 +- drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 57 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 5 + drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 + drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 5 + drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 5 + drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 1 + include/uapi/drm/amdgpu_drm.h | 6 + 19 files changed, 1096 insertions(+), 155 deletions(-) --- base-commit: 83558fcf83cc911e09962ea17c883add596766c0 change-id: 20261118-amdgpu-devcoredump-fd7a93c870e1 prerequisite-patch-id: f4f8e95c172ec46bce86f4a08b00117c7e8edd73 Best regards, -- Matt Turner