Received: by 10.213.65.68 with SMTP id h4csp2204879imn; Thu, 29 Mar 2018 20:58:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx49FFLjpmusgQemXU2vLSs9UejOOFtumppHK3u7XRCoVDuVs1ba1l/f0wNrdBs4ohVeXvhxV X-Received: by 10.99.105.138 with SMTP id e132mr7283085pgc.407.1522382321781; Thu, 29 Mar 2018 20:58:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522382321; cv=none; d=google.com; s=arc-20160816; b=LxS2yC/WKsoLxNVGn049bCrtRROjXTh3qoQNRXq0R6gf+dGf2e152rduVtSEGrkp9e U/ImGYJEM/ysnCqnVY8UNtBfXHGWuhPH1wzwySHMfvqGzmv39oDn352oyPhiDRYLxqYM zL+s4HFW3XJ3g6fHGf7QTDucItGRNfeFwgWBQPhjc3c8FPDBTlKgPL2QTcOUIB8qmAGa 7qJSLd9zrsuX22AKMK5lOKmLoqvtqYExuyRrK7/i4W5htkJQ1BpItr6ReRf5PBTbwjL0 RdyOHfpqQJ90BwB83Owwfwht3HGShnW+PWknYximR/XWysjUm55YPa1UWGpmUeCr5+UR ST4w== 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:content-language :in-reply-to:mime-version:user-agent:date:message-id:autocrypt :openpgp:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=PQoC3DWfXvChoPFxgjQ5w1Gm25xCPopeguI3wlKf/iI=; b=SQm79ZuCx3BlvWZDRNgfhP7EnH0bbadhscpnMX5d35GP2m5VApf6j00nS/H5inpsuc OrtiQksSvNmCRLz7uZUhz7K98cmTSUM2atoe+WUxfUyHEX4vlsVRdQ3zSna6k5/b+SQd mgowhkhxDChTBWLw/R4ua/ta+yhe6HiU55yHTIWWCVe+X4jNxGIJUcler114H9zXjbQJ 3M3VuX6Lt7zrEWoruSz2T5GN+NG8T7ddfhgsVj4VckHC24nb8kVsGYvkEVqosaF3+Y2B 4g+/WLe0jd814Qey7tsmVv7rDC8JSIipO3zV8ZKc4N7jyVcYL/U1610gm/VbCFLuvC7t YI4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=yXi3HcVq; 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 h13si4968106pgs.579.2018.03.29.20.58.27; Thu, 29 Mar 2018 20:58:41 -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=yXi3HcVq; 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 S1752781AbeC3D5U (ORCPT + 99 others); Thu, 29 Mar 2018 23:57:20 -0400 Received: from mail-sn1nam01on0047.outbound.protection.outlook.com ([104.47.32.47]:28928 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751976AbeC3D5S (ORCPT ); Thu, 29 Mar 2018 23:57:18 -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=PQoC3DWfXvChoPFxgjQ5w1Gm25xCPopeguI3wlKf/iI=; b=yXi3HcVqriZxyEI3ffJWPYI3n/WcBuM8iFX09cRR1uqnz2MQik7MeOpNW2It3NmDg9i17d2A6ILfZClJbl0kBZrzqlDy7btJrjsMp6RY3pwdgjBxJsWxeSMf3NFUyu1iY87BqDJi9p1dY9rnSJc661c5P+RiuPahHqrf6rCYWq8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from [10.236.65.235] (165.204.78.1) by CY1PR12MB0166.namprd12.prod.outlook.com (2a01:111:e400:50f6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.609.10; Fri, 30 Mar 2018 03:57:15 +0000 Subject: Re: [PATCH 1/2] iommu - Enable debugfs exposure of the IOMMU To: Gary R Hook , iommu@lists.linux-foundation.org Cc: joro@8bytes.org, jacob.jun.pan@linux.intel.com, linux-kernel@vger.kernel.org References: <152236384612.3266.1451709369164076985.stgit@taos> <152236408441.3266.6015804200548808265.stgit@taos> From: Tom Lendacky Openpgp: preference=signencrypt Autocrypt: addr=thomas.lendacky@amd.com; keydata= xsFNBFaNZYkBEADxg5OW/ajpUG7zgnUQPsMqWPjeAxtu4YH3lCUjWWcbUgc2qDGAijsLTFv1 kEbaJdblwYs28z3chM7QkfCGMSM29JWR1fSwPH18WyAA84YtxfPD8bfb1Exwo0CRw1RLRScn 6aJhsZJFLKyVeaPO1eequEsFQurRhLyAfgaH9iazmOVZZmxsGiNRJkQv4YnM2rZYi+4vWnxN 1ebHf4S1puN0xzQsULhG3rUyV2uIsqBFtlxZ8/r9MwOJ2mvyTXHzHdJBViOalZAUo7VFt3Fb aNkR5OR65eTL0ViQiRgFfPDBgkFCSlaxZvc7qSOcrhol160bK87qn0SbYLfplwiXZY/b/+ez 0zBtIt+uhZJ38HnOLWdda/8kuLX3qhGL5aNz1AeqcE5TW4D8v9ndYeAXFhQI7kbOhr0ruUpA udREH98EmVJsADuq0RBcIEkojnme4wVDoFt1EG93YOnqMuif76YGEl3iv9tYcESEeLNruDN6 LDbE8blkR3151tdg8IkgREJ+dK+q0p9UsGfdd+H7p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IuleGlvvKdQdFnE4AlwGcKid5GUD+vNNj/pbZyUpe4r zBFsc21/8jXSlR6zJS4mgkNDIIBGiPny3tvKINMZ8VK00mR6INpd+NErd2LxwZ/DQ5ejVyVL 080CbiD55mxxhqkbd5fHSfdhvvXIIYN+nM/RFLwaQGW9g62iFWlqeNRXezkERDV5ahFqZMP4 YDdodn0nRVZYu2kaXfOclKPcH58HlrRb8pKTE3t/TNKGY3SmKoznH0QtM27TWeZ9R9RgTYiV zSNqP+QUNp6BotWI Message-ID: Date: Thu, 29 Mar 2018 22:57:11 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <152236408441.3266.6015804200548808265.stgit@taos> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: BN6PR11CA0033.namprd11.prod.outlook.com (2603:10b6:404:4b::19) To CY1PR12MB0166.namprd12.prod.outlook.com (2a01:111:e400:50f6::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ea787696-8bca-4f58-545c-08d595f253fa X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:CY1PR12MB0166; X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0166;3:EBER7uADaQGSLu4BdC/mNE9TdTeR2/2YgjCzXXHXSaKd+qWSOqMoiU5vnviOVP/2sdptG4X7ujpS2IhKAuDSqztfq7ZuhGHT7mRuLKnr3aCmRa2Q7r8KXouBKHI1LiQix+tUfHWpdCHHOexCxJITEzNRku9yiEywoYtERjnJBp06CYjXSl+r0xz+ONgsq8abrbwpdmjgMSOs5EGxGffXkCwZuLumPXmZcNiJhKW3QvIlMyEvU/pLXiH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SFcB8n5UTqRayEnOpZ7e9jXZv0/RSedJ2K0k+sJbSEvJSIEgPLsmM51nmB+TKxucdGXSkjwSym4ORHZjQLlRLo;4:bJ8TsVv1AfI2qAGnqaCXqf34DaGXpDLg0uD61q/2Ut4ACgE25P2wiNNOIgJRlRkVHQ2etk+g4OYfb45f0QLeagO5KTbPf6giD1zDsUcdtnb1udCbtAXbD08VewdkDwIWVOVyXZV79PJhUPeuYleqTYj37ZtejNCOng3UCBc9iI8WKJFr8r8d4gSRe/OQiWx6VEf29w5Vga/IpUDe5CuPylsaiFpZkaeojowkoljR3UZppO5VLCtdRBm+9ZirLWyHyfyZ7C0xUar6bhVy+ujM/BN/33SfLAJW2kK7tHXRrouOogU/vl+F0XA5vGab74YF 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)(5005006)(8121501046)(3231221)(944501327)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(6072148)(201708071742011);SRVR:CY1PR12MB0166;BCL:0;PCL:0;RULEID:;SRVR:CY1PR12MB0166; X-Forefront-PRVS: 06274D1C43 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(39860400002)(346002)(376002)(39380400002)(366004)(396003)(189003)(199004)(316002)(6486002)(86362001)(186003)(26005)(16526019)(97736004)(77096007)(6116002)(7736002)(305945005)(3846002)(476003)(52116002)(2616005)(386003)(59450400001)(229853002)(76176011)(31696002)(52146003)(956004)(2486003)(478600001)(486005)(50466002)(53546011)(58126008)(106356001)(23676004)(230700001)(11346002)(446003)(64126003)(16576012)(486005)(6666003)(65806001)(8676002)(8936002)(72206003)(47776003)(68736007)(66066001)(81166006)(81156014)(105586002)(65956001)(2906002)(5660300001)(65826007)(53936002)(36756003)(3260700006)(25786009)(4326008)(31686004)(6246003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR12MB0166;H:[10.236.65.235];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?MTtDWTFQUjEyTUIwMTY2OzIzOkZMMGRUYmx0a3djblZOSmoxS0R2Y2ZGaVdh?= =?utf-8?B?SEFnT1NkNnpnMEIrTlhhOUs0M0hQUkNCdUE0d1locUQ5QmpxY2Z2MnRSS3dK?= =?utf-8?B?RjN3cHFiNmIxRnRValZMRkhxSUN2UFlGK3JMNkwrTnBjUUovUjAwR2duem85?= =?utf-8?B?SDd4bk1xL0RUMXg3MmNocWJOUHp3VGYxeE1UL1o0aEpadU1hNzdseXFGWW9W?= =?utf-8?B?MlZTUW83c0VzYndZSjRPNmc3aWMvRlFYcUZzcmdNTys4UnpYTW8xLzNYR1VL?= =?utf-8?B?SzZtUy9zQXJxaDFPUTQyemlscHRMTGc3dVpsOFFPeXZaWUQxaDFWSm84Z3R6?= =?utf-8?B?bjRQQ2ZzR0ZHWEpkUGRCUjJ2NGJqUXQ0MUduU3VrVWp1NkVGa3gvSHd3MWtn?= =?utf-8?B?NVVNV0ZHWDBQRmR2ektZTXIydnVLaFVWeVMxWWVZNmt3SlBEM2lvOTNpSUxV?= =?utf-8?B?ZnlJUDFydzVGK25CMG9MRWRvaUptaFRKcXVIaTlqcG8zNXhtUVNFUEs0clBI?= =?utf-8?B?T2w0M244c2YzWVIzZENjbXViS2hPWlFUdStWcjRIbnFhZGJneEZDQkYrZngv?= =?utf-8?B?UkE0c2g1TVRLaDZKREFCVHJYcUdiL2Vob2R1eG9xYkhXSHNqNWJmK3ZYay9y?= =?utf-8?B?K2NlQU5VMHpUeCtURTMzcmVsWFNxVGxIRkxOdm9vT3ZEaG02ZkVpSHg5QkFn?= =?utf-8?B?UmFzamxGY1JnL3I0UDBKazV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xm8iO5TWOAK4Ae6kjD/A7TgNOILafuSo5ur6s3zr1zKIo3CSQwRYrQR6R9fT+nAATIljybRjswtni8dTih+MUB9abbKdpR2Jykw==;5:DRcaMKeM04kFNUjkdD33If8YvdqpWGWynRnK1B61WYOBJansJnNtIGv/LqvUqShtP6L5jxCRknAhUj2F3TCkEIBlWW9Lsv8o8nQ7sjbo3STfgV7r7fts9WXE8R99NXDVLHQFKNsoiQapG7KHhGiU7RsuiNU2LEemE1w8h8YD+N4=;24:dI3E6tzqYUQJOxVnlcrz2A273pKtpGVYzqbw//fGUHJtUy3asO8IyYb9pO5g1oFdim+DYjvlBgq5otEH3prss+rcp5KFp/JRIfNsZXJ9Gns= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0166;7:elwM2wusrte1mvSkP2sipCxS9bYbh9LF18uSSLmQBlFPylg0T7lEGcte5x/1MlWINowVXmNqpUejaaIKwu4nqxE20GwEx2rx1RuSp5g8v5VvROIHWMsaHBzZmaso54D/BTZQcOWt10ZpzCWvhew/A3L6NjfQx6MmUCyVzhNffGbx9cbNgYJ41eyC/UfXSzUJHZBJWtRNHk56fE4Mzb7s2X91+shDi6as3+UWbysfzd9Xyc/FCW2dzCIWT8p3AyQp;20:9O6D+bi1nQUAgrMCM/AiFSnf1q4nALP+XZSnJ3+wqcA14jCNmJoGherrznVMGxCdjdRJdirIQmCwjm1oYRoVvr9nRzsijaG6a1ibptD1BMoxKByNjESQmlIerPS5/KD+93Wco8b+xvBJXd3IhwNzOCOlzExlkT7LZK6KGQvcPQYjA2ESDAY+X6ORiOYgBVGGVqO+h/0xu6SUIXyxQwa2163e+xAl0HigDY3RZ8UBUPA3Ol0qPfeKrr53juyIyDNS X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2018 03:57:15.9613 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea787696-8bca-4f58-545c-08d595f253fa X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0166 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/29/2018 5:54 PM, Gary R Hook wrote: > Provide base enablement for using debugfs to expose internal data of > an IOMMU driver. When enabled, create the /sys/kernel/debug/iommu So this can't actually create anything yet since nothing invokes the function. Maybe describe how it should be used by other drivers (and probably include that description as a commment for the function) to create the directory. > directory. Emit a strong warning at boot time to indicate that this > feature is enabled. > > Signed-off-by: Gary R Hook > --- > drivers/iommu/Kconfig | 11 +++++++++++ > drivers/iommu/Makefile | 2 ++ > drivers/iommu/amd_iommu_init.c | 2 ++ > drivers/iommu/iommu-debugfs.c | 32 ++++++++++++++++++++++++++++++++ > include/linux/iommu.h | 4 ++++ > 5 files changed, 51 insertions(+) > create mode 100644 drivers/iommu/iommu-debugfs.c > > diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig > index f3a21343e636..c1e39dabfec2 100644 > --- a/drivers/iommu/Kconfig > +++ b/drivers/iommu/Kconfig > @@ -60,6 +60,17 @@ config IOMMU_IO_PGTABLE_ARMV7S_SELFTEST > > endmenu > > +config IOMMU_DEBUG > + bool "Enable IOMMU internals in DebugFS" > + depends on DEBUG_FS > + default n > + help > + Allows exposure of IOMMU device internals. This option enables > + the use of debugfs by IOMMU drivers as required. Devices can, > + at initialization time, cause the IOMMU code to create a top-level > + debug/iommu directory, and then populate a subdirectory with > + entries as required. > + > config IOMMU_IOVA > tristate > > diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile > index 1fb695854809..5e5c3339681d 100644 > --- a/drivers/iommu/Makefile > +++ b/drivers/iommu/Makefile > @@ -2,6 +2,7 @@ > obj-$(CONFIG_IOMMU_API) += iommu.o > obj-$(CONFIG_IOMMU_API) += iommu-traces.o > obj-$(CONFIG_IOMMU_API) += iommu-sysfs.o > +obj-$(CONFIG_IOMMU_DEBUG) += iommu-debugfs.o > obj-$(CONFIG_IOMMU_DMA) += dma-iommu.o > obj-$(CONFIG_IOMMU_IO_PGTABLE) += io-pgtable.o > obj-$(CONFIG_IOMMU_IO_PGTABLE_ARMV7S) += io-pgtable-arm-v7s.o > @@ -10,6 +11,7 @@ obj-$(CONFIG_IOMMU_IOVA) += iova.o > obj-$(CONFIG_OF_IOMMU) += of_iommu.o > obj-$(CONFIG_MSM_IOMMU) += msm_iommu.o > obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o amd_iommu_init.o > +obj-$(CONFIG_AMD_IOMMU_DEBUG) += amd_iommu_debugfs.o Where is this CONFIG defined? > obj-$(CONFIG_AMD_IOMMU_V2) += amd_iommu_v2.o > obj-$(CONFIG_ARM_SMMU) += arm-smmu.o > obj-$(CONFIG_ARM_SMMU_V3) += arm-smmu-v3.o > diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c > index 6fe2d0346073..99d48c42a12f 100644 > --- a/drivers/iommu/amd_iommu_init.c > +++ b/drivers/iommu/amd_iommu_init.c > @@ -2783,6 +2783,8 @@ int __init amd_iommu_detect(void) > iommu_detected = 1; > x86_init.iommu.iommu_init = amd_iommu_init; > > +dump_stack(); > + This definitely shouldn't be here. > return 1; > } > > diff --git a/drivers/iommu/iommu-debugfs.c b/drivers/iommu/iommu-debugfs.c > new file mode 100644 > index 000000000000..94c9acc63b65 > --- /dev/null > +++ b/drivers/iommu/iommu-debugfs.c > @@ -0,0 +1,32 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * AMD IOMMU driver This isn't the AMD IOMMU driver. > + * > + * Copyright (C) 2018 Advanced Micro Devices, Inc. > + * > + * Author: Gary R Hook > + */ > + > +#include > +#include > +#include > + > +static struct dentry *iommu_debugfs_dir; > + > +#define MAX_NAME_LEN 20 This isn't used anywhere. > + > +/* Return a zero on failure; 1 on successful setup */ Return NULL on failure, pointer to IOMMU debugfs dentry on success. > +struct dentry *iommu_debugfs_setup(void) > +{ > + if (!debugfs_initialized()) > + return NULL; > + > + if (!iommu_debugfs_dir) > + iommu_debugfs_dir = debugfs_create_dir("iommu", NULL); > + > + if (iommu_debugfs_dir) > + pr_warn("WARNING: IOMMU DEBUGFS SUPPORT HAS BEEN ENABLED IN THIS KERNEL\n"); > + > + return iommu_debugfs_dir; > +} > +EXPORT_SYMBOL_GPL(iommu_debugfs_setup); > diff --git a/include/linux/iommu.h b/include/linux/iommu.h > index 41b8c5757859..cb2957dac43b 100644 > --- a/include/linux/iommu.h > +++ b/include/linux/iommu.h > @@ -696,6 +696,10 @@ const struct iommu_ops *iommu_ops_from_fwnode(struct fwnode_handle *fwnode) > return NULL; > } > > +#ifdef CONFIG_IOMMU_DEBUG Should be a space between the #ifdef and the CONFIG_..., not a tab. Thanks, Tom > +struct dentry *iommu_debugfs_setup(void); > +#endif > + > #endif /* CONFIG_IOMMU_API */ > > #endif /* __LINUX_IOMMU_H */ >