From patchwork Tue Aug 27 18:17:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 13780005 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AEC58C54731 for ; Tue, 27 Aug 2024 18:18:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=5Qqm4VTqFnRP1C9/26fHK+dHKryok08NkyH9r7+ILNc=; b=0hMYlGGAouSUGzIpOXUG4H91NP 8u7erfynyTg1GMx9FHeZJNf4cXJ+jF9NpKSIRQqx4f2p3EtLTj9+d6gNhe3Xh3nSXaFod0WrUJhfB lr0Mmc6pFYcErldSFy6+H0Lf+TkwpKXDNv3UciRijqYvitiWdXd1aJED9Eljw3vbm4PCnJnlcHQKD 4jhub+BGDYna7hUHHnU8Q6ay/NapMrkp3GeI04/hxVugUk3JmRSz5zTkwje+AUZReHsuD4KsOm+xa mox0+kXN4XB63XlVcu4MvyxhMsTGuG9mfCcCa8fkbxfljtP9q1mukFzq58wWbfJOBqgOWj/O8q0Ys rBVaiILA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sj0m8-0000000CSos-1YCa; Tue, 27 Aug 2024 18:18:40 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sj0kt-0000000CSRp-3pEr for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2024 18:17:25 +0000 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-2d3e44b4613so4274191a91.3 for ; Tue, 27 Aug 2024 11:17:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724782642; x=1725387442; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5Qqm4VTqFnRP1C9/26fHK+dHKryok08NkyH9r7+ILNc=; b=GcCjYW57wUSBHPo0GaM8UpwUVSDinzfJ0yRlfBJJEtruAVRpsOS3Tj6uTvgADe+S5Z gpokvBK+/ZBpcjTBUOTko9DA47+ytQrmCR3MUDR0ThsAQDG07YIiHsC6AZ7IeoDuuxe9 ydOU+RtEPzJ78141EqzRRmsLMuF8bj9tqhH4jY5qAc42qepogU+RqImnNGshzJhYquMM ESOJZTlbQTx0zmjRa+rgf3j0BXWrF+keoEcmkDt7e+zQLlYqo9JFCtdqKtejUUPy/+Pm rJpmen9g/SxWVlw2F/UNdxqcwAde2aPJlI/McHeVZ4FS63SIN2k4ovO8Vr/rCUkdz6WY sCHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724782642; x=1725387442; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5Qqm4VTqFnRP1C9/26fHK+dHKryok08NkyH9r7+ILNc=; b=brUU6Xc4RZphpOSbK0OU0133atoR/IHp/UcJVG44XrTCw0AF5ZmZjTv4y6jQ8qnTrs A/h06bnxsP8tbBWlkHthSA8DjapTFDyoeupMVDBnTpLPCm5kq3aa9rWguyuWN2LgPFCa a9L1B9n/ZvwOs4ewTelJKQ601B5GJjKp11hQVoP6HK+URyh1g2p5579MKX6tEeG+kCSs DTuGsUZwrsWa3txlVpYnogG8lrj58Jo3Zwt6Yy1dOcAhJZc4ghKXSkE07HeNXw5GA/Lw 7utr+o9J8Mp+7o02w7gBeIwfd1+QYCUre7oGawqpkbzH8cD2yFQ3gHhUME9GyNWFR/hT /oAQ== X-Forwarded-Encrypted: i=1; AJvYcCUv6bDfj7r7EgpN6ixN2gwSp1jnf2HO8JPWAnGZNXEf/aYN/v9kpG7EJgR0VL7syw9QF2W59k5UrhwdbTSEB+ON@lists.infradead.org X-Gm-Message-State: AOJu0YyQVG7P9BVgrd8qRYNqBD5b2lVGI5osGmIHAPdHW+JgVpT2De0A wK9ZawAKvmGdY/v4btVfgSsK2AaSsAY2VZkoTw0sTa0rg0vOP0LF X-Google-Smtp-Source: AGHT+IH0n0TFg5/hRPO6Qh7jcBNG5pKNGVUs+INu5ONwGclHNTvAiowUqwIyW92ev15iZ2fiZpT+nw== X-Received: by 2002:a17:90b:88d:b0:2c3:2557:3de8 with SMTP id 98e67ed59e1d1-2d646d24df4mr13634871a91.33.1724782641772; Tue, 27 Aug 2024 11:17:21 -0700 (PDT) Received: from localhost ([2a00:79e1:2e00:1301:12e9:d196:a1e9:ab67]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2d613a6123fsm12436271a91.33.2024.08.27.11.17.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2024 11:17:20 -0700 (PDT) From: Rob Clark To: iommu@lists.linux.dev Cc: Will Deacon , Robin Murphy , Rob Clark , Boris Brezillon , dri-devel@lists.freedesktop.org (open list:DRM DRIVER for Qualcomm Adreno GPUs), freedreno@lists.freedesktop.org (open list:DRM DRIVER for Qualcomm Adreno GPUs), Jason Gunthorpe , Joao Martins , Kevin Tian , Konrad Dybcio , linux-arm-kernel@lists.infradead.org (moderated list:ARM SMMU DRIVERS), linux-arm-msm@vger.kernel.org (open list:DRM DRIVER for Qualcomm Adreno GPUs), linux-kernel@vger.kernel.org (open list), linux-pm@vger.kernel.org (open list:SUSPEND TO RAM), Marijn Suijten , "Rafael J. Wysocki" , Sean Paul , Steven Price Subject: [PATCH v9 0/4] io-pgtable-arm + drm/msm: Extend iova fault debugging Date: Tue, 27 Aug 2024 11:17:08 -0700 Message-ID: <20240827181717.187245-1-robdclark@gmail.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240827_111723_984527_3743DECF X-CRM114-Status: GOOD ( 11.43 ) 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. This is a respin of https://patchwork.freedesktop.org/series/94968/ (minus a patch that was already merged) v2: Fix an armv7/32b build error in the last patch v3: Incorperate Will Deacon's suggestion to make the interface callback based. v4: Actually wire up the callback v5: Drop the callback approach v6: Make walk-data struct pgtable specific and rename io_pgtable_walk_data to arm_lpae_io_pgtable_walk_data v7: Re-use the pgtable walker added for arm_lpae_read_and_clear_dirty() v8: Pass pte pointer to callback so it can modify the actual pte v9: Fix selftests_running case Rob Clark (4): iommu/io-pgtable-arm: Make pgtable walker more generic iommu/io-pgtable-arm: Re-use the pgtable walk for iova_to_phys iommu/io-pgtable-arm: Add way to debug pgtable walk drm/msm: Extend gpu devcore dumps with pgtbl info drivers/gpu/drm/msm/adreno/adreno_gpu.c | 10 ++ drivers/gpu/drm/msm/msm_gpu.c | 9 ++ drivers/gpu/drm/msm/msm_gpu.h | 8 ++ drivers/gpu/drm/msm/msm_iommu.c | 22 ++++ drivers/gpu/drm/msm/msm_mmu.h | 3 +- drivers/iommu/io-pgtable-arm.c | 149 +++++++++++++++--------- include/linux/io-pgtable.h | 15 +++ 7 files changed, 160 insertions(+), 56 deletions(-)