Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp57873pxj; Thu, 10 Jun 2021 14:45:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynrq+mOFpgqzm2uHEgr7D7rZvhxFAytwzocv6GbMcPeYRvFIjmK/0w3yyXDGouDsY4xwPv X-Received: by 2002:a05:6402:5256:: with SMTP id t22mr575665edd.54.1623361530759; Thu, 10 Jun 2021 14:45:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623361530; cv=none; d=google.com; s=arc-20160816; b=g9WnHbWH6gArXSvxoh9H4YKluFMlUog2Ktns7x1eg/XI97yLgef4Cn3LIV/JkC6Phm F/kIsGoEbfCbcmyUjSTMplFW+/H4G80ohWUjRLUVTLClQHPW5O9625T7KY1hcJCKCuok vu5qy9qxObwi6SmcXkAj5tyJm0lUDnOUE4JauQsVp7F8QLSXeBKmQGjJmQEAmL+ni+kV f9/Eieqfjywe5OLP/QgwQCqkWhvDgc0ZU6itJGjWcUwVsDEQtDZLEXUhsOyGcrOD6ibK fmTfZXrCKNcxOEn9BMxkMFlwDSupj/UTttav2Q1IMPtCs3FT3UAADU3qSXNEgS0ruSrn 72Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=YXpzcgNJpQHDdAAXuY/oQ+b/W0CaqN4oZOi6cgulc3w=; b=wNy4y8mejBSCtsWL1Hh9QCuu71d+BxYOxbdOy56KlsB6jQFs9SXcJQiYV0UqcU6g43 9wgDmmrrylFggUdPFxfwf2UtL3SJEfuw7Ww+fHUuFEU+yqSKj2FEMJ6P9J66BD9dGm2i KQzZ+5MToEngK7oDHV78ObuFXJSJBKn6A7cMG/ossNxdO+kyf7tmOTAA3/uNYhRketvr zZs1hT33hK3v6GirSbYFxn6Fng68xvyd55z5pUstXEsj9HXfupV4Q2HaJ3yM9NWqqpcE szeFjr2cFfO0m5lDlMe17fM8k+Dmd8hijWmOjjyaTdTKgvQf/oh98Ai2AdnDW/s9q4QG b0jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E2rbXL6C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jj27si3049764ejc.580.2021.06.10.14.45.05; Thu, 10 Jun 2021 14:45:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E2rbXL6C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230160AbhFJVp6 (ORCPT + 99 others); Thu, 10 Jun 2021 17:45:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbhFJVp6 (ORCPT ); Thu, 10 Jun 2021 17:45:58 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FCF6C061574; Thu, 10 Jun 2021 14:44:01 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id v13so1750154ple.9; Thu, 10 Jun 2021 14:44:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YXpzcgNJpQHDdAAXuY/oQ+b/W0CaqN4oZOi6cgulc3w=; b=E2rbXL6CzPIKl7GWbqD7FCanhZAzWtfGCuqJrFoaEQgsw5urIjzABVakFeezgw+MF9 dPS1G7lhP/5pp/WE5+VtaBnHKjR/0QzthCWTcHRwkPDCAvNwJ6mn6Kbh1Tho8cDO0wrb R5YhgKOtFkV8qrAPER3NbSwhY/JPpabWfzpYzd1AvK9MthQJD50skgQ/v93OLH0fU2T/ l1Z4dfXrQoxVTMMJOrkwKLmi6+hghrguF987nlMO+Kd+QlIfzXFR3nfoAMdEFti6YXAL Agwug7Eiwl+gQ36hHVAnaJXxQ//VEBvG71kovgdzds+Kn85Lyb3UhS1DqIYWyIbT7vSf X4Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YXpzcgNJpQHDdAAXuY/oQ+b/W0CaqN4oZOi6cgulc3w=; b=qmoO/ChjKbzfHPiQcND32rXagLhKCdxL3ToS+/mVXKLJSgUE79EjWvp9jO8LKxf1Q9 30xo45TtR48kQnjblxgc/0oqQTl9EW8AGRnDyzw2r8PJ2n3FYqiFsMeIomVhQvCzMQ+5 /jLMK0gWaNRqsuWcUw8dLKwqruHuKQ5cH34EaArBxoq1bTYPpQkMAL0rgAxPq2NfgUdA JrAFWQgqa6SoGK6jKSruKuZd8MVn4VzRwfP8CUjbF1X+UHp3NO66VRP/k5i67SYLi4Zq f59V7PlFJV1xvW2GrURlle9LPI2CJIAbtlOlcFPK34BjvrMLFpXDVpafJBy1Um312KU0 JYHA== X-Gm-Message-State: AOAM531r+Jn0ZAvB9N2GV0iHW0aeMKTSECw3QRzuzMA26kmqmvVCRjVd sd7dJuTrseTigNwQSCJi0CU= X-Received: by 2002:a17:902:f54d:b029:107:b14c:423d with SMTP id h13-20020a170902f54db0290107b14c423dmr746664plf.77.1623361440568; Thu, 10 Jun 2021 14:44:00 -0700 (PDT) Received: from localhost ([2601:1c0:5200:a6:307:a401:7b76:c6e5]) by smtp.gmail.com with ESMTPSA id d15sm3173040pfd.35.2021.06.10.14.43.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jun 2021 14:43:59 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org, iommu@lists.linux-foundation.org Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Jordan Crouse , Rob Clark , Akhil P Oommen , AngeloGioacchino Del Regno , Bjorn Andersson , Douglas Anderson , Eric Anholt , "Isaac J. Manjarres" , Joerg Roedel , John Stultz , Jonathan Marek , Konrad Dybcio , Krishna Reddy , "Kristian H. Kristensen" , Lee Jones , linux-arm-kernel@lists.infradead.org (moderated list:ARM SMMU DRIVERS), linux-kernel@vger.kernel.org (open list), Marijn Suijten , Robin Murphy , Sai Prakash Ranjan , Sharat Masetty , Will Deacon , Zhenzhong Duan Subject: [PATCH v5 0/5] iommu/arm-smmu: adreno-smmu page fault handling Date: Thu, 10 Jun 2021 14:44:08 -0700 Message-Id: <20210610214431.539029-1-robdclark@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rob Clark This picks up an earlier series[1] from Jordan, and adds additional support needed to generate GPU devcore dumps on iova faults. Original description: This is a stack to add an Adreno GPU specific handler for pagefaults. The first patch starts by wiring up report_iommu_fault for arm-smmu. The next patch adds a adreno-smmu-priv function hook to capture a handful of important debugging registers such as TTBR0, CONTEXTIDR, FSYNR0 and others. This is used by the third patch to print more detailed information on page fault such as the TTBR0 for the pagetable that caused the fault and the source of the fault as determined by a combination of the FSYNR1 register and an internal GPU register. This code provides a solid base that we can expand on later for even more extensive GPU side page fault debugging capabilities. v5: [Rob] Use RBBM_STATUS3.SMMU_STALLED_ON_FAULT to detect case where GPU snapshotting needs to avoid crashdumper, and check the RBBM_STATUS3.SMMU_STALLED_ON_FAULT in GPU hang irq paths v4: [Rob] Add support to stall SMMU on fault, and let the GPU driver resume translation after it has had a chance to snapshot the GPUs state v3: Always clear FSR even if the target driver is going to handle resume v2: Fix comment wording and function pointer check per Rob Clark [1] https://lore.kernel.org/dri-devel/20210225175135.91922-1-jcrouse@codeaurora.org/ Jordan Crouse (3): iommu/arm-smmu: Add support for driver IOMMU fault handlers iommu/arm-smmu-qcom: Add an adreno-smmu-priv callback to get pagefault info drm/msm: Improve the a6xx page fault handler Rob Clark (2): iommu/arm-smmu-qcom: Add stall support drm/msm: devcoredump iommu fault support drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 23 +++- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 110 +++++++++++++++++++- drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 42 ++++++-- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 15 +++ drivers/gpu/drm/msm/msm_gem.h | 1 + drivers/gpu/drm/msm/msm_gem_submit.c | 1 + drivers/gpu/drm/msm/msm_gpu.c | 48 +++++++++ drivers/gpu/drm/msm/msm_gpu.h | 17 +++ drivers/gpu/drm/msm/msm_gpummu.c | 5 + drivers/gpu/drm/msm/msm_iommu.c | 22 +++- drivers/gpu/drm/msm/msm_mmu.h | 5 +- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 50 +++++++++ drivers/iommu/arm/arm-smmu/arm-smmu.c | 9 +- drivers/iommu/arm/arm-smmu/arm-smmu.h | 2 + include/linux/adreno-smmu-priv.h | 38 ++++++- 15 files changed, 367 insertions(+), 21 deletions(-) -- 2.31.1