From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FB05606A333 for ; Wed, 2 Dec 2026 22:36:23 +0000 (UTC) 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=JeGV9BwK Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1B5AC112592; Wed, 2 Dec 2026 22:36:18 +0000 (UTC) Received: from mail-yx1-f54.google.com (mail-yx1-f54.google.com [74.125.224.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0043911259B for ; Wed, 2 Dec 2026 22:36:11 +0000 (UTC) Received: by mail-yx1-f54.google.com with SMTP id 956f58d0204a3-67dae7d3f7dso16374305d50.2 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=lists.freedesktop.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=JeGV9BwKiTw2Vx7htiGmHcYg80pp6kXI2pq9GPPBVLY0aNVwS8r4yD444UCCWm1BWn AR6pvvmWkBv3DBZlrVhtjhm9etZ4ykJ/TAawxEnHZBUxI0zPJ/RrY9UaFkdhDo/nswCt qi17R7pLGyonVmNcyMJLMDKIWWkdof6x7T/a3Ywkqz+1Ab1m0N92GxmZ2xh2tufP53Lo Q84knmQTfdBj+A+x1h2HubexEjC/HF1RpbLLxjA5DabCSw118xFpQZyaepBQ1bVOhLgI Ofk0x1z1Am1VJKCBvQxcrZKosu0l5A0BIlG/A5mf9HnBfr3YUvbIFfGGo9wM5OJ0tE1P TVZA== 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=rzAAsGqR2eKhnrla+r+VZX4itfsnC5K5qVF2vM/F6iV+kvJaOcpgWyvQvjUWW9xFjb /HICaYZ+U1RU2PTyfK4VfZm+Q8G3cn4j8szFIuWwOIX8cVy3JQvje4bbXACKKfgXy1O0 WwXML0VDXQt2wIp32i0u4Rqsh2c9rZrtz4Iqr91HfL15QqY0s6w03Lb0qP9SuAUMoWD5 ue7wYjh9ASq57rIt646hoSb/3ptcMhuO0S5EVrRHHzSktn+COtYgGTvSaTe3VEFS8m4E GWE3NhNgnlueJLG/YSVIQ3e//8oKrCAl1Orkte2Wi2shNJQQWj/vsA40nOTQe4HyfvNe 9FZA== X-Gm-Message-State: APuU4Z93Wl5RfLTAR2M682DCKNLLges+M9GpZwvksvFG8P4YRNfROoT3 lanGMG5FiksV62WltQEg2b4oZjOpG2to+diMJD1NCafevrdq1OFU5LrZiwSL7m+m3jI= X-Gm-Gg: AZFdTZestP1wh4d2aVZjWkP9zot8TxpMv094UQqWnoB+MECk7aW/BG1j/4R+6FnpXLn cnTMILeKdE6qpErq44AXecGkSUNijxsriH1bVylzuUdvvCzIgl2/JQpENFBtmOCU7mVzVEosPaI oiZOBj0mCWbVjVRqTGmZSBiVthj3slyLrg9NXL3ZX/vj9xAXg66Tw33mr5ctZGxhYXv4/z6rlsh qUsI3plbRS3xP4l10AauksFEGSqMuHSreC8v04VmUbrgtn1ISClWcWVV1cJm1yCH1x4EZ5wnblO shA4zRdyUP96mAS7i0P3NEsoa295V7ZRBcCKXWQAlknkOzGhYw77EEc9HPHRRb4MXLspHURCVf7 AwHYNYfM9CIp3BzEmVJDNOF9BLsC6QBAlu6xS4FzzQzwP5MMgo93q1+dEKtktTOdX7rAQVBEXrL e8aNDNkfa9XZ+5jlAvgC3Z0gLT4CslvdRNTKQqbEZyY3ZAv05XcM2PGHG4HNqWMiItFYzRP/Mqv kPyp+IHghvtXaLNBna9uunpYf6Vp69/8mUmLw12Jw+nMD7VhRM0BaP+Slny6x0Ly8L6uPkyC0b6 xgqaYLpVKaA3tLpkfNSz7wWhfkgqSXwLiBbg21ODfBjBwluz5QvMSQdcHQq36DZs6rc2b5M+8Ck t8c9gROfQ99aeLUVwGDH6js78ZEr65PUFKHpXz4ji8/FGqzmWQ25sytrpmS3fRpaOzk/M597gcS K0z5maFZ2ZH5b0f70nFUra6l5V/dXz56k44Bb+nI0= 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-Archived-By: 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 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "amd-gfx" X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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