Received: by 10.213.65.68 with SMTP id h4csp622510imn; Fri, 6 Apr 2018 06:19:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+NiZOmxgfUpyWSG2rzoveWSwtbsq5v43Vi3mDrmX6od7R0vC36CZLsnttN80roIPY6KHhs X-Received: by 10.99.124.79 with SMTP id l15mr17688982pgn.19.1523020771436; Fri, 06 Apr 2018 06:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523020771; cv=none; d=google.com; s=arc-20160816; b=kWP/JuC7m4S39Ec6TnG3Z4Gdl1a2c06INFELiDE0NuJt7L+T714MoN/fVAHvcaJErI p5g5+516IzyGPYrcQz02XMXmGP0Orkpn1cSj3kx/0drP1e+TNxWGT0bhKvP6NNpQOzk0 XpjKQAO3hizd85552Tk4W8nAg8zs4u96jiPDYLW8TnCngchXCW8iUXaCxwyOaNuBYPsx 0iRJq4VcjJxz6/EEcLmf0Ui3fkWbnFepsRb7ysWz+HDjJQ4Gb69UhXj+3L6W1jdpueNQ iL5KpQhH+DdlkZDpoCQVHKfc552toYgD2/PCiKCTQIvDAuhHm0ith6Xwy4FarGcJQGHK 8qlg== 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:message-id:date:cc:to:from:subject:dkim-signature :arc-authentication-results; bh=JtueuHJzeE1iMV9MR5UplxsMl4hGFc+yxWKcd7fxhL4=; b=i1vqdv4DdnWK+mIJa+IDOx7hbbYerP+lLcYyResD25FcuiyMjwWg4fpn5oJ+dg8L6X WZQkMN3bqQ2QR2ZYnClgoC5rQhn/Bi0cCRR0E/aIU6XaT5qqSIfuuRYsmED/U7SmFBVg 7Eeu3oyjY4ldyJYjFri5UdkLHXVjEKYN4IUbV1m2RidSzrHYzvo4nrcTMDa94cjIC0fA I/7f7cO8LGM62625PoL73l0CeobZ6Q9K6OT57bRV/Jc5PaxBKAkMtKXIUv/AbszIlRhl ILIfmgq+a6bYp5nHaiSYvoC9f17ogctmX0vVdtY4MQC09BXu7o+0sNiKQfdqb5bWIVal 1rgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=nbV5SGbR; 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 i12si7113199pgr.256.2018.04.06.06.19.17; Fri, 06 Apr 2018 06:19:31 -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=nbV5SGbR; 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 S1753106AbeDFNRo (ORCPT + 99 others); Fri, 6 Apr 2018 09:17:44 -0400 Received: from mail-dm3nam03on0083.outbound.protection.outlook.com ([104.47.41.83]:34992 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752988AbeDFNRm (ORCPT ); Fri, 6 Apr 2018 09:17:42 -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=JtueuHJzeE1iMV9MR5UplxsMl4hGFc+yxWKcd7fxhL4=; b=nbV5SGbRnKIJ+HfBEc3dPCrzZ0lDRLUCX66LeOyMY/s3NL06yEXqcp6cgC/neji8QzrmzEBtU6N2Eeu+CWUGfPp/gmVV7SPGrmfftBFn3CZJaaoQIH0kLDo2ztY78cZm5axjWigRdcZCpHF2owTo4oIVUzI9vAyHbFXpBr/ivGI= Received: from sosxen2.amd.com (165.204.78.1) by SN1PR12MB0701.namprd12.prod.outlook.com (2a01:111:e400:c42a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Fri, 6 Apr 2018 13:17:38 +0000 Subject: [PATCH v3 0/2] Base enablement of IOMMU debugfs support From: Gary R Hook To: iommu@lists.linux-foundation.org Cc: joro@8bytes.org, linux-kernel@vger.kernel.org Date: Fri, 06 Apr 2018 08:17:21 -0500 Message-ID: <152302042701.47565.17954813724758433858.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: BN6PR11CA0031.namprd11.prod.outlook.com (2603:10b6:404:4b::17) To SN1PR12MB0701.namprd12.prod.outlook.com (2a01:111:e400:c42a::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 28bfd7b3-02aa-4195-ee7b-08d59bc0c543 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:SN1PR12MB0701; X-Microsoft-Exchange-Diagnostics: 1;SN1PR12MB0701;3:F4R3FGjpki8eGTiOoLF1pj3RySFPznSbI0M7uMLrznfqZ9Vpo5CR1KZmTfIcEQT89jujG/ZYx6XWkjX5aZW/VqJMstAP5Lpm5KBgeHyxIiRAIUP0PFHRtToW+/UcrZ9XvRIGTJcM7W/pmxXGGXMHLRTvzDHcjZTkXQ0khSpDFjZiyy46krOxrG00b3f9+pEUa/ZwcQ+AbC7BSHPl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/2adcXGCpuPiSlU3JGId6jO+D6Cwi6vqpaSFckFN92YyZaLVqQxtv7zTPfKAxokzVIlgjSN+0J87KaVE3omsDHfEyW+X+AsvsjmX81qCV2XghcD+nBYVjTw++awJzUtHXGH8VuSqaV;4:HVkG2NB6Ep67nss4IlPY069KvGG+IR2iNdiMQ4BUSTIzBdiWFGqFjzRuXZ5BoVDqXmztFv3T5QwENvxFCyOEapYewX7/hHiGyyRRxCf3FedTacQrSkoSX6pMNhehVEmqtNOidtw92+skmxxPFRVjrQwyWc6LS7c0Db/L2DvwbPTkG6vvK5lhmwQf+hVz/4zLwzMpkBl4Azo7g2NUNr0RhS3T4xATCxT8Vy8+qFRE1a+iKXqgp8raXolkaHhHBp9yZ6I63Nnoq1y7jOmAiJ1XsQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041310)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:SN1PR12MB0701;BCL:0;PCL:0;RULEID:;SRVR:SN1PR12MB0701; X-Forefront-PRVS: 0634F37BFF X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(366004)(376002)(39380400002)(39860400002)(396003)(199004)(189003)(23676004)(58126008)(59450400001)(386003)(68736007)(2906002)(476003)(316002)(6916009)(72206003)(25786009)(230700001)(106356001)(66066001)(2351001)(97736004)(956004)(86362001)(6666003)(6116002)(2486003)(26005)(186003)(53416004)(7696005)(105586002)(50466002)(53936002)(2361001)(81166006)(55016002)(81156014)(3846002)(478600001)(8936002)(8676002)(47776003)(16526019)(103116003)(6346003)(7736002)(4326008)(486006)(305945005)(52116002)(5660300001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR12MB0701;H:sosxen2.amd.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:3; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Gary.Hook@amd.com; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjFQUjEyTUIwNzAxOzIzOkVZdXJhQzFqdldRUkVFODVvaW4raktVQVhT?= =?utf-8?B?VkRVZEg4OVFoWlRPWjA3RUZBUjZTK2dWdDZGa1czQ3dhNjZteG9URVE1dyth?= =?utf-8?B?VHdqaE9lbWpWT01VNVloYjJpL25jZlRrL0hGSHdvY201RnBTUVNkN0g5Tnpl?= =?utf-8?B?UzZzOXlmdkQyaGMyZ3ZKaWF4MURkTFBHMVR3RUFEM0t1V1ZZM2JCckh5aVNo?= =?utf-8?B?eDBRa1hlVTJDMGd0UzR2OHhKOHlXRndwSTh3MERDUDUwNldJL25EaURCRHkr?= =?utf-8?B?SGR2S1lZeG5pSDVoNVFyNXArTnpGSUhaTXFFaEMyNytqNW43NTgyZUF0VS9l?= =?utf-8?B?M29FaWd3Szk3MW5iQ0k5eDJhNEQvMXJoSW1hWFYvRjZyNkg2UFlRRUxwOE9S?= =?utf-8?B?blVSc2o4S2orT3MzTE13R3lnblJrV1NVSXIxLy90NWVqRytJbC9iOEpqZEhn?= =?utf-8?B?VnFndkFZTnhuTktjemtyK3B0dStLSDFYN3ZRQm5yQ2JGMEdaWG5YRkFSZUtt?= =?utf-8?B?UDB5WHVrdnZiM0Y1V1d4c05ZL0g4cTNGdzZkZlEvQkU1UXlYUFVLM2dBdE02?= =?utf-8?B?dms3UUtGYm5lNm4zMExGZ3M4NjA5MnNudlU2aG1DNUNzcWpiZ2ZqYWlxWHFJ?= =?utf-8?B?VjFXeXc3RkF1bWRVWXFaSk5nd3N2SzdxbzVDQlJ6cWY0dE5QRjJyb3FkVXlq?= =?utf-8?B?eW5KaXh0NWN2dEhET2dQdnJLeWdCNHhi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Z?= X-Microsoft-Antispam-Message-Info: V973zC2oYtY6mDcLCmTjz/tGCnVdnWLrB/dGSUa9LcM8BgcWXBKRsrNZh+dSDu35LedfMDvu8c1eiDXJoPzA+78BBUAsml/ILOCVGiMpRZPqr+bmP4kFyjXQd3bEqiZ+RFLgl5PUV2LJaXJGvoQp+LodCLV38w9uKsyhzseZi/IKXCU+PkTGPvE8/FoDsH4H X-Microsoft-Exchange-Diagnostics: 1;SN1PR12MB0701;6:rWyLdU0fQ0saLTsqJ3e8wzjRPrADG2ltu4CeMZYxVU7Jjbf53/fDkerGjAUrFichLdSdQ7rlIDwi/6MwDAGzldEpS9yCuMahhgFm0Y7amrxrOZMYlIsiaRyfg4Ga+U7+V0Zlzq+5cmzGhumGLIB6eoUzsJmvCc3BaVs9rYthchAm7IhPdyre4ogYvgGMs+QQgxnhT0DgPJ0HXjsfc5udefNgYRuL1/JMrlh1kHM5VvktzjyKgc5Fyx4rIny5tc+MMcxAqgdhDCs4jwTiLueEtGNsj55vzKtGUFu36b+FODP38RM29JEJ84D/+OvseDfysef0zfKqqp1QzBMvbqjFQHC42G3im/sahuw3pkGZgPL4e1wBsHV6NLbjqNW+4sDJD5p5U+lhsmFuT8/5yoVUsXdfhCn2rJZOHR7TLauPVaABv9NEillwAKOIiP1D3H47owtLVdc9MebHXsUbeA3xFA==;5:K+AWSljFuUqBh7ZzkS6zoobN02ovym0wfSPGYXV8bWU7fUwSkG7jJCwppCpwU9lImqkeI3msIC0YGncfSMGXjwfCfrEl4HaCwweAfU+jhAymnC0HYguZYxdfbY5xvfmnNeuXnFNKzJ2XDgqU7Dv25mqomZioA0N/2ufmqorZI8I=;24:1njdrer0KcDVeRMizQjY72LEF4mQGe7kIi8+6F7kz9iEgdNEziyDNWl1HmhWNmHk2WSRfb5Ire3/3Qr+W/v6nkPDAMKGug6qg5Z9ovSJfyE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN1PR12MB0701;7:BKI/ZDpoqsrTfsVYflw02tjST0OQV5fS8CD1vvHI08lDfgyLTHppUhGSjbmsbopuQKKDyBNVzjwQWQ+Uu1naa4rl7/eI7pQbbNpGz8mH3P2hvEqv4TQy+ws3GS0tC4iQiGCYqgpAuTrCwraMSME5mwR2PWTdqFXfC6J2+oAhfeHA55M5G5RovJM73+zgxIJ6jKFCt8RDb00JfZ4nyuBJAmtWYZ0NefJAzjxOQUucfSbfF0z9pKwmRnUiYTQyMnjN;20:YOQjnsp4zi+NWbl/wXC8Y0yVwck9yQyIi5VizzWtZhzb6xsvtXE0puLo+ZpEc9BUeptCXsfu0+dU95T+GtH8LJw0u1PS0kEQzCtjq1SdM6ohH4i/7nrO7C6SJtmGgpptPY2SKx8SKJEEV09ORNpkQ8jUeq//rwZfXXtG+yaeVu3F1rXDFiP4fvUZTgkK53t21jHWxeJEz+yPEnHB3gpFs2wipkPoi68mfGPBwZ9bmpgWkOMiTrVHq55Z3yFZr5ee X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2018 13:17:38.3695 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 28bfd7b3-02aa-4195-ee7b-08d59bc0c543 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0701 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These patches create a top-level function to create a debugfs directory for the IOMMU, under which drivers may create and populate-specific directories for their device internals. Patch 1: general IOMMU enablement Patch 2: basic AMD enablement to demonstrate linkage with patch 1 Introduce a new Kconfig parameter IOMMU_DEBUG to globally allow or disallow debugfs code to be built. Changes since v2: - Move a declaration to outside an ifdef - Remove a spurious blank line Changes since v1: - Remove debug cruft - Remove cruft produced by design change - Change the lock to a mutex - Coding style fixes - Add a comment to document the framework --- Gary R Hook (2): iommu - Enable debugfs exposure of the IOMMU iommu/amd: Add basic debugfs infrastructure for AMD IOMMU drivers/iommu/Kconfig | 11 +++++++ drivers/iommu/Makefile | 2 + drivers/iommu/amd_iommu_debugfs.c | 45 +++++++++++++++++++++++++++++ drivers/iommu/amd_iommu_init.c | 6 +++- drivers/iommu/amd_iommu_proto.h | 6 ++++ drivers/iommu/amd_iommu_types.h | 3 ++ drivers/iommu/iommu-debugfs.c | 58 +++++++++++++++++++++++++++++++++++++ include/linux/iommu.h | 4 +++ 8 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 drivers/iommu/amd_iommu_debugfs.c create mode 100644 drivers/iommu/iommu-debugfs.c -- Effective helpfulness requires thoroughness