Received: by 10.213.65.68 with SMTP id h4csp1297730imn; Wed, 14 Mar 2018 16:06:50 -0700 (PDT) X-Google-Smtp-Source: AG47ELsk3WYZkKitqsUxXXDjmaHgqesnEHF7vVGWm9xYNNSs8+/tA+uC2R+OMtMvJpyDjWLmykxc X-Received: by 10.101.70.132 with SMTP id h4mr1304995pgr.155.1521068810354; Wed, 14 Mar 2018 16:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521068810; cv=none; d=google.com; s=arc-20160816; b=0fezfKaeAuTSShd2ShqmoAoYBT7/35Da0IgU8oiCXV15wREpJBXFLNoWwcz0RC89qi fR8BRTAs28D8fNufZh47oeIzIP0if1XYd6qPQIKXkmRFr63MteuJEzyc+XQL7wScnF/i KkSNllCJFEB/TrP5C/wbO0/92h5GAYJXQvMpv5KKVkH5/vTa3Xeq+3ODbRjI2NhtRver 8Z2hmlIlcaPesqo1ueTffR63JpjG+YfyYua2BuSeFOJh/TuGys9wuMSGHiN9mZppcucn eLtCkPneLFKkjw65k9+XWHt31jbx2WzSXMddQ6OkaCRjZjtziR6c4rsQ8a1MdPfY+r3n nlwQ== 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=uX+USovG2sDwjNdBnr3tToPPe5ZzEUcqH947SrtVoD0=; b=znARDRXitXAMZ56CpJ/MWLFl3d0WtdGLLVcgL1/XOixbcim9W3k3wPtwdUAP3+9DEL KTHdCa1Fr3T26LyLw32b3kDa4b3Gfwj3BezEUiRiCRAcF0HnbX1MpzGrm5api6ru4iuh R4ekdB+ynROkJYDnsZVbPE+/MPis4ODja++P2Aiwd4TWUnqk1fJupGuPUUbvMXNsgXfc y25iZtCwAxoaZ22LGrWfhQpIOq1yYeXWq3YUdR9wNwbUk9IxFVnyiF4Df5zfDuWUm1Sr oRhKHESYQ9vGP0LkIheknwkNij7xXY/koQXuWiV+BYOn3M7R7q32LNlLFHcXKE4Anfmm A7ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=5gxCXDHE; 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 73si2800447pfr.363.2018.03.14.16.06.36; Wed, 14 Mar 2018 16:06:50 -0700 (PDT) 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=5gxCXDHE; 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 S1751970AbeCNXF0 (ORCPT + 99 others); Wed, 14 Mar 2018 19:05:26 -0400 Received: from mail-dm3nam03on0057.outbound.protection.outlook.com ([104.47.41.57]:11291 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751413AbeCNXFX (ORCPT ); Wed, 14 Mar 2018 19:05:23 -0400 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=uX+USovG2sDwjNdBnr3tToPPe5ZzEUcqH947SrtVoD0=; b=5gxCXDHE1Y2i7kBikkq1Hq2PbrCuODGqsupK2pz2kueU7bG7YLMbFDBSzRNGeYcrdHJFvcf/GqRLtOhFcMgEjtc2m8Yo4Xndy3bhYOImIiSqGHA0ZksdhtujClPeVHtW9zbE2o/fXiNy/LWBygHs5CHpDpQv8FABjMMRwjhb7YU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Gary.Hook@amd.com; Received: from sosxen2.amd.com (165.204.78.1) by BLUPR12MB0690.namprd12.prod.outlook.com (2a01:111:e400:5951::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.14; Wed, 14 Mar 2018 23:05:19 +0000 Subject: [PATCH v3 3/5] iommu/amd - Add a README variable for the IOMMU debugfs From: Gary R Hook To: iommu@lists.linux-foundation.org Cc: joro@8bytes.org, linux-kernel@vger.kernel.org Date: Wed, 14 Mar 2018 18:05:15 -0500 Message-ID: <152106871561.67212.3504698988832928735.stgit@sosxen2.amd.com> In-Reply-To: <152106836233.67212.15861879210675477690.stgit@sosxen2.amd.com> References: <152106836233.67212.15861879210675477690.stgit@sosxen2.amd.com> 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: BN6PR1001CA0034.namprd10.prod.outlook.com (2603:10b6:405:28::47) To BLUPR12MB0690.namprd12.prod.outlook.com (2a01:111:e400:5951::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f5640674-f92f-471b-eb94-08d58a000f08 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:BLUPR12MB0690; X-Microsoft-Exchange-Diagnostics: 1;BLUPR12MB0690;3:Fa1GArmA8UxAw3nSdmFh2rAzflT5mr5NpHZvOgnAJx3dv3OLuOra1fvMUT/V8yeFMod3nmBXU+DvFvbqHPFgL+IjdB07cDiS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Jk6ZgLHrlGyR00YyH4f9KYXLo9LFlXR+mR2dKpytfRCfbEHi1RrdPBJ8A2J5QNR2l+J7j8dhUlFVxE1YMxdQopnyvWUOw5iHMNm0OhluKx6c3oqs+xoZpflffBt1+q2Ke3o6y+K3FGioTGd0PSUc6AIsNCSrPoXyESZllUo1kt3bLs80C8CoN1ehADtfVMeIzPDzaRRv7Vk3xMw/LZH0twz4WPpD5TNiXjmBPbaHj+3gwpiMn/LPi1vxpx2Hn49bIgiZpgKFozEQON24U1l8;4:154T6OjuWh5La1S0rPV3s9Cx7goCe6IZm7lTdIEy9E1bOXujuIAgKXMgvX6G2mRjOpK0a7yyWfufI/K26PCfVykbjn7MjZkZCeKvVfOpCI/nuZLOKWzOibFH6encU3vtXpcX9L9JgJKQliRkFqOW7g6Jll2eFlLD9Ka5Uv4LrqPl1p684jIhwTAM6tcTb5iK8x9Pn93XLEPvQ487r0LeQgAp45M3S0iasNb5HxfsXk1obrK65rKLSsfuPfcCxNFCy/pK1LdvbIO+x87tftpt2MoQ3lZd5kpeFOYPzdsz1S3xl9d/goseOtrj7+qwLOJ4 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501244)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011);SRVR:BLUPR12MB0690;BCL:0;PCL:0;RULEID:;SRVR:BLUPR12MB0690; X-Forefront-PRVS: 0611A21987 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(376002)(39860400002)(396003)(39380400002)(366004)(189003)(199004)(2486003)(7696005)(6116002)(66066001)(6916009)(6666003)(2950100002)(5660300001)(53936002)(2906002)(52116002)(186003)(26005)(23676004)(50466002)(25786009)(4326008)(103116003)(386003)(16526019)(86362001)(316002)(8676002)(68736007)(106356001)(97736004)(305945005)(47776003)(8936002)(3846002)(478600001)(105586002)(72206003)(2361001)(230700001)(7736002)(2351001)(81156014)(55016002)(58126008)(81166006)(53416004)(76176011);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR12MB0690;H:sosxen2.amd.com;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?MTtCTFVQUjEyTUIwNjkwOzIzOklqTVhPcWpMT2dWMmZKaFJDVHhQM0l6aUMz?= =?utf-8?B?eW5sSmpDeWVIZ2FrbStRSStHWU1wZE9wU3VHM2NjTU5lNThTeGZTdDYvWVpS?= =?utf-8?B?anp1bW9EWFlYSGpyanY5WnhrWXZ1dGJFUFdGSFI4c3ZudmN4NDRkSmlQTlo0?= =?utf-8?B?N0VnRThUWkNDSndNa3FJR2dYUk5NaTJkYzBDZDZTczEvQWpFd1BJU0EyVyt6?= =?utf-8?B?cEZHQW5zckEvS1NkVnBnb1BkL05CaDZRMEJyWWViZmMrc0N2TXdPdVZ0S3lt?= =?utf-8?B?UHdrTnJTZWxjL0VjcldYeXlKR3UwT0lCcHNHcG5TcmE5Q2VNMzFNTkJTL3pY?= =?utf-8?B?QTFaRnl1Y0t1M3NHYy92QldLb0UvOXZORmxQd2xVSzA5MlhJbzNjQk5vVnVV?= =?utf-8?B?YnJ1QTZpUXAvOTZUVHJUNG1ZK1dmL2NobVNKd1FERVdNTDl3dnQ3UmxTMWcy?= =?utf-8?B?U2dWcEs2SnBaQ21LVVVQMEZsV25hSzlMZ1NIcVpRWUpTZjg2ZUpzYnAzUFRQ?= =?utf-8?B?Y29QVW9TRGxjNGlsVWl1Tit3T1BFcUNrL1pzR2VCZ2NwYi8wTHd1KzlCU0xz?= =?utf-8?B?SWFqY3lGajRWYzZJMnAzcTk0YW1yVnVXanZjZE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r7KxQXkWJKnjwHyofSLU1RFy778BZYZ5DbGK6hwYLDg+KI6hYFiZ2sFNMlOXk1vhW5qXK8jgCIM/7mqVzqF29qGSe4IQbLTkh4MKZSqW419Xl5UYqAD0FPr6Qq5w1y0CnjUR/HMBips9F04cVX1k4iqszJjxoIBgsX70Un8xX+dS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BLUPR12MB0690;20:HHO094HGV20R52/U/rfLpQPzoZQz+/nvEiU3ArKw5+Ze+l1vSF4L0EW580CBRJ73GNhJxMHi+z1wP1UXWxD5+ipR0vbM5+K+ZnhxMyLgX2wygVkZWwFZxi3kVS2/518w7yNVlNpFhmAr5yVcWJZdKQxnmIaCDPvL7gmJXXTiBe3mE0l7Zm4ieeGNiu3tgebFwVccfKDkYBjGnsQHj48SONDNdcuwexsAG1LRRn+DSfG8BDAUXK3KZOSzfTh16flE X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2018 23:05:19.6231 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f5640674-f92f-471b-eb94-08d58a000f08 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0690 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Provide help text via a filesystem entry Signed-off-by: Gary R Hook --- drivers/iommu/amd_iommu_debugfs.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/iommu/amd_iommu_debugfs.c b/drivers/iommu/amd_iommu_debugfs.c index 170863e5e86b..d95428b1ef90 100644 --- a/drivers/iommu/amd_iommu_debugfs.c +++ b/drivers/iommu/amd_iommu_debugfs.c @@ -92,6 +92,31 @@ static const struct file_operations amd_iommu_debugfs_dtecount_ops = { .write = NULL, }; +static char readmetext[] = +"count Count of active devices\n" +"verbose Provide additional descriptive text\n" +"\n"; + +static ssize_t amd_iommu_debugfs_readme_read(struct file *filp, + char __user *ubuf, + size_t count, loff_t *offp) +{ + ssize_t ret; + + ret = simple_read_from_buffer(ubuf, count, offp, + readmetext, strlen(readmetext)); + + return ret; +} + + +static const struct file_operations amd_iommu_debugfs_readme_ops = { + .owner = THIS_MODULE, + .open = simple_open, + .read = amd_iommu_debugfs_readme_read, + .write = NULL, +}; + void amd_iommu_debugfs_setup(struct amd_iommu *iommu) { char name[MAX_NAME_LEN + 1]; @@ -125,6 +150,12 @@ void amd_iommu_debugfs_setup(struct amd_iommu *iommu) if (!d_dte) goto err; + d_dte = debugfs_create_file("README", 0400, + iommu->debugfs_instance, iommu, + &amd_iommu_debugfs_readme_ops); + if (!d_dte) + goto err; + return; err: