From patchwork Tue Oct 5 15:16:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 12537019 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72053C433EF for ; Tue, 5 Oct 2021 15:13:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 47C926115A for ; Tue, 5 Oct 2021 15:13:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 47C926115A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=DhjNkgnUv7bjbrafpZLq4xpCynNjacadiSDdaGlMxWI=; b=13Qtobsxs+rZI/ 6sWBi8WTGZMZ+fSxhHNlQ5IOiHK9dZN3VJX1Jv5diT+V2X198VohF78yV6Oryw3KA0fKKeW+DMuPz 6pd/xGOzLcBF+gxikjzKA7a7vYYtXL6aGH+wMbia0UcIjyK6McD7WIcOTfqeh/CR1mR8FgIoqjfIH Z4uekoFIxavJHMLY5/1ekANLliDY8uStZveSOxQC5pMHu7ZuJG3D2SFmrwqDGVgFpS0q7s+fTH4UG 1waXu/DTp168OyIppp45TU7NdNb3ViNs8k2j8L6C/S4n5VlUdbGFWOZZ8TEo9w/Tx57I2xA0TP9i7 zyj4byQE4amtN48RfpWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXm6v-00Azvs-H3; Tue, 05 Oct 2021 15:12:05 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXm6q-00Azqz-EH for linux-arm-kernel@lists.infradead.org; Tue, 05 Oct 2021 15:12:02 +0000 Received: by mail-pf1-x433.google.com with SMTP id p1so11622745pfh.8 for ; Tue, 05 Oct 2021 08:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QSrcQ531lYvMDyqtMmSNSg1D9eOHYmXdh6Sn4g0VZLQ=; b=LE+nGxihu74oC3P/yXCbRUT8joVuLjedGgQjvKmK8f3RDbhsFz2Vi3/sS9u9wXnGcX K2GgrTHQM2kjOTjbHfEDKSOGaIQ95GlbZ/QF327Ospm5XEbm5TPf6490GoZyuWQ1E/y+ IeJKKHDWKXVrwoDC9bWA7CsdXkqo8n4aTYFKKesOpEGc2WcdjcTgXydrApYSun1UVsgw iY76WfnFfYcz9KR5eDOdItpIDV0s68u3xP+x9H5iDGJotHLBIZgkU1UDs/KH+Jtv0Uja Hd84BWPjshr5CEK7HmMKnP/2imJsZdYLGNfIk8+cWZQTHfe+FZ/z7BP+9G5U4gsshMEp MPpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QSrcQ531lYvMDyqtMmSNSg1D9eOHYmXdh6Sn4g0VZLQ=; b=XqkdHNr8TGsIkmNOEMcLUvM/N93y05j036Hz0e+vTQ47A5MjCnEG3CakhsHN/fg13D hVttw3G7lcGHs5KaclXxx6GveFxo5raWAv5ncPg6wy7FeNTY4DreguU45Ai3qLxcgWP/ UdxuaTNWqIMx/L8sCvlXRnkved8eyLNKiCNdPSzgK5tC7hxuLu3usU71d/qqJVRe10ZW 0E/6Aky6hzUkCJxvZ6oyhXvagSpisfrlGFMk13f7AjLUUttxMMH+d+RCqJew5JbNIQqT 6Xsi85M1CBMYfgRpQ1tPNBJhUkbkUzBBFC4TQl/rh804QyCO6QYcgvLajlCtx4EXWh0v rngw== X-Gm-Message-State: AOAM533yUCbR1wtzXZRuVBxq29rD8Kj0GESmkb/742YgyXxz73vbsjJX bTXUSTffDka3a2GK8lQ1ZmE= X-Google-Smtp-Source: ABdhPJxO3G+HWzM6JzFUJostwno3QxJkFsVc0ojvp/XHIKEdzTvHkYlD/6vx1y3wEb8mXk5HXIWGFA== X-Received: by 2002:aa7:828c:0:b0:44c:28d1:46b9 with SMTP id s12-20020aa7828c000000b0044c28d146b9mr19508978pfm.43.1633446713563; Tue, 05 Oct 2021 08:11:53 -0700 (PDT) Received: from localhost (c-73-25-156-94.hsd1.or.comcast.net. [73.25.156.94]) by smtp.gmail.com with ESMTPSA id k22sm18388032pfi.149.2021.10.05.08.11.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 08:11:51 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: linux-arm-kernel@lists.infradead.org, freedreno@lists.freedesktop.org, Jordan Crouse , Robin Murphy , Will Deacon , Rob Clark , Akhil P Oommen , =?utf-8?q?Christian_K=C3=B6nig?= , Douglas Anderson , Georgi Djakov , iommu@lists.linux-foundation.org (open list:IOMMU DRIVERS), "Isaac J. Manjarres" , Joerg Roedel , Jonathan Marek , Konrad Dybcio , linux-arm-msm@vger.kernel.org (open list:DRM DRIVER FOR MSM ADRENO GPU), linux-kernel@vger.kernel.org (open list), Sai Prakash Ranjan , Sharat Masetty , Stephen Boyd , Suravee Suthikulpanit , Sven Peter , Yangtao Li , Yong Wu Subject: [PATCH v2 0/3] io-pgtable-arm + drm/msm: Extend iova fault debugging Date: Tue, 5 Oct 2021 08:16:24 -0700 Message-Id: <20211005151633.1738878-1-robdclark@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211005_081200_496716_B6B0F81A X-CRM114-Status: GOOD ( 13.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Rob Clark This series extends io-pgtable-arm with a method to retrieve the page table entries traversed in the process of address translation, and then beefs up drm/msm gpu devcore dump to include this (and additional info) in the devcore dump. The motivation is tracking down an obscure iova fault triggered crash on the address of the IB1 cmdstream. This is one of the few places where the GPU address written into the cmdstream is soley under control of the kernel mode driver, so I don't think it can be a userspace bug. The logged cmdstream from the devcore's I've looked at look correct, and the TTBR0 read back from arm-smmu agrees with the kernel emitted cmdstream. Unfortunately it happens infrequently enough (something like once per 1000hrs of usage, from what I can tell from our telemetry) that actually reproducing it with an instrumented debug kernel is not an option. So further spiffying out the devcore dumps and hoping we can spot a clue is the plan I'm shooting for. See https://gitlab.freedesktop.org/drm/msm/-/issues/8 for more info on the issue I'm trying to debug. v2: Fix an armv7/32b build error in the last patch Rob Clark (3): iommu/io-pgtable-arm: Add way to debug pgtable walk drm/msm: Show all smmu info for iova fault devcore dumps drm/msm: Extend gpu devcore dumps with pgtbl info drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 35 +++++++++++++++++----- drivers/gpu/drm/msm/msm_gpu.c | 10 +++++++ drivers/gpu/drm/msm/msm_gpu.h | 10 ++++++- drivers/gpu/drm/msm/msm_iommu.c | 17 +++++++++++ drivers/gpu/drm/msm/msm_mmu.h | 2 ++ drivers/iommu/io-pgtable-arm.c | 40 ++++++++++++++++++++----- include/linux/io-pgtable.h | 9 ++++++ 8 files changed, 107 insertions(+), 18 deletions(-)