Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4538929pxf; Tue, 16 Mar 2021 16:44:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXkha3w9ykctOqVNz40Ey0tX9UccTlqxHM7tGNVKTFPiYmM5MTDE8MYSeShZ6/rqbelFpu X-Received: by 2002:a17:906:2bc3:: with SMTP id n3mr4090888ejg.418.1615938292418; Tue, 16 Mar 2021 16:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615938292; cv=none; d=google.com; s=arc-20160816; b=W1s3dtdpEtKc905z1Otghm2dS91yHyP0GU8XfyOuUpwYDBfK4yZKaMyc1ZdqJhLUau pLyMRGXRTmd0F7ceMzZaYRNZnhPxRUIxCWt990qjgLkw/S3rlKvsbx5MlsCfW7YlddgX oqpmN5KO4+WqxplaL2JuWg8DAZBAN5S5AeBnhd5YWeCRFwCZLPBKZL9TGJBdWR5iUMwu EbHhbXJ0lbul9Q1ote1o8dUv5+jFYEDPE8EcJXOYmorHzWZlEDEM1nfXgTU1FxCyUfCO 0J82brL3QflKiR+ejwcjTWuK46StBawV0vHRD+nLTPmf6PKKfwFXG1ZeXuPNjpI+76Ha 0KzQ== 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=jYFeGyHV2zNDVLbB4/9V9Cq/DhTaZRm/v1+BiD8VFOw=; b=IZJQt2UdryYsK7cCjmFpNdUsdEsJs1Wec7f3RI0vUzqzWSO4xwPaIKu+MRrnOjPacC vU7mLdHtR+ICRrZJ2YHe0pBFUHzlFr2riNsmNRehY0jhyl4jrMWIZ6K+lh77YV3QY4TV 8A9MwARbkGTV9zS8kmPrPy8+s4hjaosnFmVc6p5BpEarb6m4PmcNHhPFYeWySHSI1u9J qta7XQ7vhALqhGm0SY1TZ1zYehv7v3ccRG5yobSxM09dc28zNbMXX/HyIO2Jui8zzTOK b3QS/bExGcB6xcs+sfqsIxPJFyky8OEykfAQBJXYAW/bROK1JQcWHB/JYN6CegRuRgBW H/ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pNUpWJqu; 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 y1si14880660edp.405.2021.03.16.16.44.25; Tue, 16 Mar 2021 16:44:52 -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=pNUpWJqu; 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 S229585AbhCPXnY (ORCPT + 99 others); Tue, 16 Mar 2021 19:43:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbhCPXnD (ORCPT ); Tue, 16 Mar 2021 19:43:03 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71DDEC06174A; Tue, 16 Mar 2021 16:43:03 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id f26so925569ljp.8; Tue, 16 Mar 2021 16:43:03 -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=jYFeGyHV2zNDVLbB4/9V9Cq/DhTaZRm/v1+BiD8VFOw=; b=pNUpWJquTOQ7GETDBARhVTlBvYZv2Ugf0ssuCBNJrHVNUldN7HWfC9c3HLEKrZqUp7 3WqcHiK53HI/HzDw+ttHJIqIsBGt/9JoRFsni32AWrM1diyNRlPOs8DDgk9EhFi2aOB7 2IT6ivIlQ6RGScxniU6NBKnLIKHAyJkFfT3ltQ0OFA3SiOvd7s46m52XmeHEZHxVOeTc uev4xIbU7Ajc9lLWY2li5KX9bB4q49TxEU1KbPcIYeI8DskKwoN+ti1IZGGndq+lsAVZ LUU0NQ89catzxMdN+QYiyKt30a2USwIHp2RpeEA/Njr5EdSDXTmIPgnfPQlcsLkUHHMX ZxVg== 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=jYFeGyHV2zNDVLbB4/9V9Cq/DhTaZRm/v1+BiD8VFOw=; b=YJJAz71WiIQ3wlk/paXgPt2/gU7ire7UF6xX3vkJVTEGSbs5EQzv7GyeuRi4jjDL1y i2z8grdVUF/kq63TtluV/q1SvjbQQ9uOl18Yb0ZC486s/JJ7eAoiBuaxHTOjBsUtgmnQ Si8u3u6dpa6C2Z4NjtokuIKdMYqxNiTUCa6YraiF7iUUqIeAnypgsnUvVu2AOlIKL3af lrpS9+AaYhb6DZEqHasTAijn0v1uQayKRWHZfzAKjwTsJ1pCVNaZcoDAMOxLabtsuJ4T sI0WXm1gH9Qu/xSIJU6tDUVon0x0PedC/+6eYJz8ZTB67u1uVPHZJwzt+Yy0yhcfdJUc iNgw== X-Gm-Message-State: AOAM531DGQZfXIzLE7YIDc6DChI6IJvLW3fPHcvVaQQ6pbzySZs17whk B9ruQPUfEB2KkeeYmD9K7cUUkTnRjMY= X-Received: by 2002:a2e:b6c6:: with SMTP id m6mr640889ljo.411.1615938181757; Tue, 16 Mar 2021 16:43:01 -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 k1sm3207658lfe.208.2021.03.16.16.43.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Mar 2021 16:43:01 -0700 (PDT) Subject: Re: [PATCH v5] 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: <20210315203631.24990-1-nicoleotsuka@gmail.com> From: Dmitry Osipenko Message-ID: Date: Wed, 17 Mar 2021 02:43:00 +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: <20210315203631.24990-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 23:36, Nicolin Chen пишет: > +static int tegra_smmu_mappings_show(struct seq_file *s, void *data) > +{ > + struct tegra_smmu_group_debug *group_debug = s->private; > + const struct tegra_smmu_swgroup *group; > + struct tegra_smmu_as *as; > + struct tegra_smmu *smmu; > + unsigned int pd_index; > + unsigned int pt_index; > + unsigned long flags; > + u64 pte_count = 0; > + u32 pde_count = 0; > + u32 val, ptb_reg; > + u32 *pd; > + > + if (!group_debug || !group_debug->priv || !group_debug->group) > + return 0; I'm also now curious how difficult would be to read out the actual h/w state, i.e. check whether ASID is enabled and then dynamically map the pointed pages instead of using pages allocated by driver. This will show us the real h/w state. For example this may show mappings left after bootloader or after reboot/kexec, which could be handy to see.