Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3707301pxf; Mon, 15 Mar 2021 16:51:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/FSNtVK2x3jpd3P75osgdTZArk+m67Nkf1xx2B110jF5ZtBLd5DwBhAhjOKetjan/o4mw X-Received: by 2002:a17:906:3882:: with SMTP id q2mr26097347ejd.540.1615852317678; Mon, 15 Mar 2021 16:51:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615852317; cv=none; d=google.com; s=arc-20160816; b=mjm6LvmrySS4UNmwHuLmDHvdXA/s9akVG5qr70IcNDR3RZ3YgAiWju0toH4vvMPumS slfSaxC+dXXJPbpPTw3+apRATZZTEfE7OqW5kxPksjHcF98QiB61HRYXZO3FRr6BiNLR /pBC6E8HQ+jh24HHavNIR1SG9cuKOWqsjYvBWpH/EM6KN6LNNVjcvuLmzuloTwAyEi8u NE+zfomvgRMUNFeesgN8ZMeDj71sgVU7rfeyCJlUtYeHRD/Q4M9Nbp9iewFHypOKeOLm eiaVkzuk8QzOxq476JD/TRcrdqLfA5+oGlfrgX0ssCNncDdsz4TzKZWSbUxdxj0jDCbF KFRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=v2HjbGIhGvuWN/p4wjJ96KHLGD4o/ABRVFbl69eEBO8=; b=trLdx+wMgauVC5ixDSosrznsx38MClQ36+kIhqqJPXYa4L+qML2gFO2OX2f/frFlAh WmQiGUAM16FZDwt+gz1ZGheMl62ejO3lnAMu8OqwcAWHQt17C1q+ra+EuSELgf6fEMEx 5E2XkEoyIPC33h0Dw2WF3qllLKlWF0X/tPQ6k5UlTnkq7giW+0Gr+umPDE5VLi6f2w5I m0FnxDWSndhu+fSqGVYyGBQ8SWVxYg0g2QdMTqG0alL79QUxWt+cKa1cA8xr4nW0tRKK 5XA623R4drv94fCbXOxIXEfOKcyn2f51FBzblWpZf/w4ofYrzxNls8bElEGsagltPlM7 AUEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=K198jd8G; 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 ly13si12205861ejb.649.2021.03.15.16.51.34; Mon, 15 Mar 2021 16:51:57 -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=K198jd8G; 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 S232852AbhCOSxp (ORCPT + 99 others); Mon, 15 Mar 2021 14:53:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232707AbhCOSxN (ORCPT ); Mon, 15 Mar 2021 14:53:13 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC569C06174A; Mon, 15 Mar 2021 11:53:12 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id a1so17507272ljp.2; Mon, 15 Mar 2021 11:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=v2HjbGIhGvuWN/p4wjJ96KHLGD4o/ABRVFbl69eEBO8=; b=K198jd8GCrMhGQV9zHTqbNijO9zf7hECliU2GYTo/l1yBT48UGhVAoSMrAYZOdidSR xL9r3gSdZzY62O/15Jac0+puQ0X4IIdemWdotS5KqAyzXnVFVpyHJDTrEJTNRteemBIh cnIFpJzmNnfaOaU2OevoS6zWzDFL20smLwAojHiU4RppLAcatpcpyWrov06OJZPXGrV8 WkYTND0+aNAxRbUantlOmxsS+ZHgfValm+k5J/rzAxXkO0eEaUrqZsuYiOi0/04vNmKi aS6V/tdU0TRbkt4v6vJpR0drVnH04yp3UC6+TB16K6aFlWX0JH0NJLL+1ofkmuXquoiB w0KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=v2HjbGIhGvuWN/p4wjJ96KHLGD4o/ABRVFbl69eEBO8=; b=Rr91BYgj+UZX7Qabz0hA73pbyzD9pyzBNEnfe71cbzGkcS9A7V1p14y+22S+Oimdqs LI9Ji+rfTSf7U6DJ9BkG4SLmfJXxaXg/AzwRwxK2bcVWlKv/BlM24vXQT68l1tS5d0d9 BI3ohLalz/iGAKtYXAodnwzMs6HW8OFb/myKISEkXJa5GY62BKQwltCnpugQnZ43dOPz FrZryfEazpgOTTzamfxJEs3GrzJ1oiNhxAwLpzxLmu1siy4Id43CloUn41SOJcd/yjcg iUTEgqaQuaIt+EqxiBKvwFI2V9crCMEhLLhCHlcbhBeCspzyiR80MIDSefQVufqmrZv4 1wTg== X-Gm-Message-State: AOAM5300Cic5XMuD9mkLP6eu7cJ8zBAuQLXOcyTLyUCNFySZGPcEbFft KuoDHion9f3a6fqJksIvVJVMU2zxt0U= X-Received: by 2002:a05:651c:339:: with SMTP id b25mr263022ljp.406.1615834391036; Mon, 15 Mar 2021 11:53:11 -0700 (PDT) Received: from [192.168.2.145] (109-252-193-52.dynamic.spd-mgts.ru. [109.252.193.52]) by smtp.googlemail.com with ESMTPSA id f9sm2764475lft.242.2021.03.15.11.53.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Mar 2021 11:53:10 -0700 (PDT) Subject: Re: [PATCH v4] iommu/tegra-smmu: Add pagetable mappings to debugfs To: Nicolin Chen , joro@8bytes.org, thierry.reding@gmail.com, will@kernel.org Cc: vdumpa@nvidia.com, jonathanh@nvidia.com, linux-tegra@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20210315033504.23937-1-nicoleotsuka@gmail.com> From: Dmitry Osipenko Message-ID: Date: Mon, 15 Mar 2021 21:53:09 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210315033504.23937-1-nicoleotsuka@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 15.03.2021 06:35, Nicolin Chen пишет: > This patch dumps all active mapping entries from pagetable > to a debugfs directory named "mappings". > > Ataching an example: Attaching > > SWGROUP: hc > ASID: 0 > reg: 0x250 > PTB_ASID: 0xe0080004 > as->pd_dma: 0x80004000 > { > [1023] 0xf008000b (1) > { > PTE RANGE | ATTR | PHYS | IOVA | SIZE > [#1023, #1023] | 0x5 | 0x0000000111a8d000 | 0x00000000fffff000 | 0x1000 > } > } > Total PDE count: 1 > Total PTE count: 1 > > Signed-off-by: Nicolin Chen > --- Good to me, thanks. Tested-by: Dmitry Osipenko Reviewed-by: Dmitry Osipenko > + for (pd_index = 0; pd_index < SMMU_NUM_PDE; pd_index++) { > + struct page *pt_page; > + u32 *addr; > + unsigned int i; Unimportant nit: I'd keep lines arranged by length for consistency with the rest of the code. ... > + group_debug = devm_kcalloc(dev, soc->num_swgroups, sizeof(*group_debug), GFP_KERNEL); Another nit: this is a long line, I'd split it into two lines to keep coding style consistent and to improve readability for those who have a side-by-side code viewing setup.