Received: by 10.223.176.46 with SMTP id f43csp1303922wra; Fri, 26 Jan 2018 15:53:30 -0800 (PST) X-Google-Smtp-Source: AH8x225JaCbWlPNYZz5SBdA4RePzqblcVsJOWAV9YDcLySxfno9ttAZ1S1/gQKClC3LwKm7MsYFf X-Received: by 2002:a17:902:aa88:: with SMTP id d8-v6mr15237747plr.171.1517010810736; Fri, 26 Jan 2018 15:53:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517010810; cv=none; d=google.com; s=arc-20160816; b=vCM7ZyRdRO/pQQikiATihIuFrEqU5mIHnYXMXlqtC1tdO8yGM28MXr9q5Ow32lmm0Z DxKbT5gEeaokG3CBU0o3fvmjbWTlPVqYlb9YBQUD863qLxAxwU1ukkxqkRrAYnVdrHbm n0Yf38CFHbGc7xskJ6U74DnzAyL1bSiqEZoCI1DEa2Yn9FTgwzS0AR8xhct1MMlZjuBv uUdxyMXAvdRX9jDK28rhUKXA8RNfC0WHFMhIycYuaGKF/Gz4A748LEZXNtIbX5YvWbYf NRl7qQQWtu+aLff0eXtR/hySlnErMfcfQ1CCFeUBa86ilD4ngfcq4MENu2gUG28MNl7z pIEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dkim-signature:arc-authentication-results; bh=o0xAzW1Tbny/JlV0onFAl4v2INcIvqO7EvVRVq4ImPA=; b=SFbb4n2OfDtFfBcfyKkTsdZzMVxHXRct/gOm2Yxpre/h5MYDA4QDFOIO+jjVVpKolx EKNJ+3ZywT7BpcmoOsBCOJB4ha98uHo8A3A4QR7MOJOFyCWUH1wBZ5Gp5dz2r/ZF04jW wUnavlojUHiTmOPu1CkDz/u0SneSIk/B5MnhWzGuiKH2dKpq4R3LSmLvj1mla4p7Q2xs jqa48CcFGJoGwBZD/X5Mj7zUNCFD+0/5RoueKi53r6NOw/SKl1hagHrUirRzl/MCfnuO oo+z4r4O3Iy2dBhyQEuKtBWOnNiCj0RXRTMZ7DfOslTzUoxNgbBUwWtowUZO69oEPtWu DFvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=myUM2+2E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si3617600pgf.622.2018.01.26.15.53.16; Fri, 26 Jan 2018 15:53:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=myUM2+2E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752547AbeAZXwg (ORCPT + 99 others); Fri, 26 Jan 2018 18:52:36 -0500 Received: from mail-dm3nam03on0084.outbound.protection.outlook.com ([104.47.41.84]:21584 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752340AbeAZXwc (ORCPT ); Fri, 26 Jan 2018 18:52:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=o0xAzW1Tbny/JlV0onFAl4v2INcIvqO7EvVRVq4ImPA=; b=myUM2+2E7XeEqUt/3QuibNeh1RuPO+I6li+cy/Y5HvaROtyK1vP6AvqQkn0wOEv6J67g21aZ967sBNbjNmXafRjFk/tKdak03FUiLmGSbHSP4xgwTibZYLk3BifFhj/MrmNuw1oyJllPIAdGZpC1hpd98FkT8ek71VOUTNtCTKo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Gary.Hook@amd.com; Received: from [127.0.1.1] (165.204.78.1) by CY4PR12MB1205.namprd12.prod.outlook.com (10.168.164.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Fri, 26 Jan 2018 23:52:29 +0000 Subject: [PATCH 2/5] iommu/amd - Add a 'verbose' switch for IOMMU debugfs From: Gary R Hook To: iommu@lists.linux-foundation.org Cc: joro@8bytes.org, linux-kernel@vger.kernel.org Date: Fri, 26 Jan 2018 17:52:26 -0600 Message-ID: <151701074611.16448.6376879206073473408.stgit@taos> In-Reply-To: <151701071164.16448.3611271062222336838.stgit@taos> References: <151701071164.16448.3611271062222336838.stgit@taos> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: BL0PR1501CA0019.namprd15.prod.outlook.com (52.132.16.32) To CY4PR12MB1205.namprd12.prod.outlook.com (10.168.164.149) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c879e83c-6d10-4db1-322c-08d56517dcbf X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:CY4PR12MB1205; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1205;3:zutRuWKeEIOpxLv+ZTkkCOPphanZZauSWW1tG117TSMnJzMmIIxw7/SlvpquHpxxgGKetVoshnXFLb2dx6gHP06Gq+TsNSe0sMwg5t5L0iS4TGZReGHLif5pVK+yBRdF41/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Igne4d8+qNapaIGsaRZkNXIX89B/WT2EqTYaXs38XjjviBWphyB+c4VlOEl+JrigWYKwHkbbW6zaUFBcMCldpQ2aSazNssT2qVKGmdfgYfRQnrO3B9ukAuFUC4fXtRVTMsZjoMcwOcoAkfG48IK5GDbFb1AvtM6xT5rHuXJiwm0cNyO4pZNsaF2JQFxaCOQWW2SZQojmS7PA;4:6GXBDiNtBAAskm7lKcG9xFScAmUTD1fIizjSUMIYc6gZoDx34ctdDH9NbGRv0UiE1kgpI1L4c9FeHaW8wlwgl75hdDhm91HMr2DVrMrEAyBsFQinYXeKGYp5O2ULq6AnQ1ifLKzSjqa/FBJ65V7mZty8rMs6NHELJgn2jYWRDmBLpAmd1081BijG1+uI46wGuVdgZbshJyDzzX2RPIOBd7I73ETBgf/4HhUda7j9EwJlV3oxUCQVhNX3fp1HlG8OAm3/9MolC3UbPn9zLIecNJpy+FmYKPStr5qFg6BxTvGlcBosKCg3VTDrBRZkLigk X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231078)(2400081)(944501161)(10201501046)(3002001)(6055026)(6041288)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:CY4PR12MB1205;BCL:0;PCL:0;RULEID:;SRVR:CY4PR12MB1205; X-Forefront-PRVS: 05641FD966 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(7916004)(39860400002)(366004)(376002)(39380400002)(396003)(346002)(189003)(199004)(33716001)(230700001)(90366009)(68736007)(478600001)(6486002)(72206003)(2361001)(106356001)(2351001)(2906002)(305945005)(26005)(7736002)(186003)(103116003)(86362001)(77096007)(9686003)(16526019)(6916009)(66066001)(50466002)(2950100002)(59450400001)(76176011)(23676004)(52116002)(6666003)(5660300001)(33896004)(47776003)(8936002)(81166006)(2486003)(6116002)(4326008)(97736004)(3846002)(105586002)(16576012)(386003)(53936002)(83506002)(316002)(8676002)(58126008)(25786009)(81156014);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR12MB1205;H:[127.0.1.1];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMjA1OzIzOlQ3NGZvam1EWllCMmdOMDZoWHhHRHFob2xR?= =?utf-8?B?Yk9xbDFhQVdyb09GdTZDM1lqMGgyMzJnSjBVcmtHbFBCUUdTdDUvTEhQa1Y4?= =?utf-8?B?dWVRZjA1Ri9pbXFqMDVRWkw1K2JYTHBZdDFUY1dvMXVSa1hiWm51d2JvVWpJ?= =?utf-8?B?R3JzYlpFNmw3bU13UVBWdDBNVDJjZTl5bFdFRFIvM1k2RVErTFJmb3orNFNk?= =?utf-8?B?KzVQY0RTWHZNVGtYcm1YM2FtSmJRd0ZLbVZnek9HeU1BY01sblhXUFB3cGNC?= =?utf-8?B?KzFlRGkxY20wTWRnQzg5Mm1qWS9sbzlOME83a3pIaSthUHVUN1k2LzZUYXNL?= =?utf-8?B?bGFDbHkwY0pqc0gyOUx3Tkt4YXhLbzZLL3RFK0hqS21YT25VcEF6M01DMFdj?= =?utf-8?B?T1VueUxOY3N3dFBEMHl1M1hORENnNzJrVW9xTm42dVNoQURiMUdBRXhLVkVX?= =?utf-8?B?VzlJeElKYVltZW0xVjB4K1ltL2ZDRzJFbStXV2pwaFlTaXhQcEdlangwMksx?= =?utf-8?B?L2RlbCttRXR2SVFjMEtmOGFrOG9aYXBaVDMxVkVwWGhLR3lYWHZ1RDhtQnYy?= =?utf-8?B?MFBsRklJMHdIemtiOFNKU296UkFjTmRyUnlvTFN0QjA3UjZNb0xrVWtLRVFS?= =?utf-8?B?RnZ2VmZTdnlCQWFzc2FKeFZ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vuXI47FkYNjQgqIhOWaCbQoTWfvURl+dTP9m4M1YhzQ/a0BMtzZNkMEgdYThnxLNuNJJ+NAo6evqtrNEyORNIwlzUJDApAMpYtlodfs1SsQho8wEWFJUH1jlddy0vPTW7Lr2NPurKdtN7uyZuCI5L8Yo6LmehKdpBT SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1205;20:LsEQyW/aMbzaIYF5obGEW968BSWaNgwFHS4Z0sf0KLI5gPVIng9wDQW56Z3CmOoSNuC6Z1LQUPZRwaRun/Iw4RE8iND6DLFDsUCPB5IYu4LWXOUpY8XeyNRIUpbtkb81DujHcGD+Rq3TPDPd7iCw2aXCtDlvL0FX2+mwllT9wD7DOWadrBRdjWjP8llBu4VMfw1u+pPWz9M+wbGpH8T3YWAZwx9ZX+U5lW50IUSN8hiJ80xODzcL3Zy8JVXNMFwR X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2018 23:52:29.8245 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c879e83c-6d10-4db1-322c-08d56517dcbf X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1205 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enable more descriptive debugfs output via a 'verbose' variable. Signed-off-by: Gary R Hook --- drivers/iommu/amd_iommu_debugfs.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/amd_iommu_debugfs.c b/drivers/iommu/amd_iommu_debugfs.c index 18f70934961d..c449f3a7452c 100644 --- a/drivers/iommu/amd_iommu_debugfs.c +++ b/drivers/iommu/amd_iommu_debugfs.c @@ -27,6 +27,8 @@ static DEFINE_RWLOCK(iommu_debugfs_lock); #define MAX_NAME_LEN 20 +static unsigned int amd_iommu_verbose; + static unsigned int amd_iommu_count_valid_dtes(int start, int end) { unsigned int n = 0; @@ -61,7 +63,10 @@ static ssize_t amd_iommu_debugfs_dtecount_read(struct file *filp, return -ENOMEM; n = amd_iommu_count_valid_dtes(0, 0xFFFF); - oboff += OSCNPRINTF("%d\n", n); + if (amd_iommu_verbose) + oboff += OSCNPRINTF("# DTEs: %d\n", n); + else + oboff += OSCNPRINTF("%d\n", n); ret = simple_read_from_buffer(ubuf, count, offp, obuf, oboff); kfree(obuf); @@ -79,6 +84,7 @@ static const struct file_operations amd_iommu_debugfs_dtecount_ops = { void amd_iommu_debugfs_setup(struct amd_iommu *iommu) { char name[MAX_NAME_LEN + 1]; + struct dentry *d_verbose; struct dentry *d_dte; unsigned long flags; @@ -97,6 +103,12 @@ void amd_iommu_debugfs_setup(struct amd_iommu *iommu) if (!iommu->debugfs_instance) goto err; + d_verbose = debugfs_create_u32("verbose", 0600, + iommu->debugfs_instance, + &amd_iommu_verbose); + if (!d_verbose) + goto err; + d_dte = debugfs_create_file("count", 0400, iommu->debugfs_instance, iommu, &amd_iommu_debugfs_dtecount_ops);