Received: by 10.192.165.148 with SMTP id m20csp3478929imm; Mon, 7 May 2018 13:02:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoKEONHnmiDCnHi+B5rBeC3q2QGM/kzCZwbh4AzasCJulczqiM9Xub6Mkix74exazl4pK2+ X-Received: by 2002:a6b:440c:: with SMTP id r12-v6mr41250480ioa.126.1525723356464; Mon, 07 May 2018 13:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525723356; cv=none; d=google.com; s=arc-20160816; b=rypRk+5ALS4xucB+UwrPbE18tPG+/zjG99/DeAgfrX8IGLmr+91qViDA6gwsNVQoXb ml0xqTh5zRCQIAVR5qA/u4VHDXj1WqPymnr9Y2yvQd3UmUe8fEQlRzZu5U3Rl8KIghTg BBSS6VS47ObjF2SDmyU4UAxwGtFfvsrJ8zdv0F+bm9JTF02WIUwrlXF4CANYR2rwd9AZ QLttXMB8J6aPIDpnI9o9ss1Y6SYhSAJRG2zamiGXzPDGm58bePkDlMAOopYeFzVQBOcM 9C/8AVc4bCO7P3DlhB6DTmMiieYuS7cPlmLrzed5FKpGEQALFHTiLYZ/TVy0rsx0MFjK NhKQ== 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=uhRr/4YDJTTvLWHmDyRlgiox+aCRyIMkK3Mje9SC2g4=; b=Jnu5Cs0jxwzNesYlrjkYp05P7Nd8bcyvtoSfx2cm8UP/7xjbpdmerdxK045spXYdiz YdBbt9hORxne0+l+9vQ3N6uTEo96M8RuHEuauAxD37xdik4yfi8/AnZgld0Rk6bt7C49 es/jtzHg1guhu39NZvRfrYcyaNiyMkTVl95eE/kpNNnhqVAdNY2w6lvrQBsgxgUQESim G+FgoIp5fl8StFb4Wrfhkz9mfsczQTzTClWllyiPcpufHsMKy8/S+7VvWOSsRTbQd/bo mUog++sFM4iULDPECc+9r7CB9k7tY4joTQZAWyi1yc3vpD91ZhdTK5JhcfJx+ZzXCccr hzkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=4+MbvNiW; 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 j3-v6si5381828itc.9.2018.05.07.13.02.21; Mon, 07 May 2018 13:02:36 -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=4+MbvNiW; 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 S1752763AbeEGUCC (ORCPT + 99 others); Mon, 7 May 2018 16:02:02 -0400 Received: from mail-sn1nam01on0089.outbound.protection.outlook.com ([104.47.32.89]:54912 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752386AbeEGUCA (ORCPT ); Mon, 7 May 2018 16:02:00 -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=uhRr/4YDJTTvLWHmDyRlgiox+aCRyIMkK3Mje9SC2g4=; b=4+MbvNiWlfcF2H+NR3NZJkleo5ptGCpKRq9++zk8pNTM1vmLSAnpOLCohwWatS5T+XBuplAybuGUKEz0Up6E2em7AIC+4+INUO7PUb6xObp/8tsuBrkoYB/AjQil1bZ8Kj2O/diy/YvK5gEZC4J43KY28u9eavuMN5jNl8en9OE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Gary.Hook@amd.com; Received: from sosxen2.amd.com (165.204.78.1) by CY4PR12MB1446.namprd12.prod.outlook.com (2603:10b6:910:f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.18; Mon, 7 May 2018 20:01:57 +0000 Subject: [PATCH v5 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: Mon, 07 May 2018 15:01:52 -0500 Message-ID: <152572281179.3235.11484188869064303333.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: BN6PR03CA0003.namprd03.prod.outlook.com (2603:10b6:404:23::13) To CY4PR12MB1446.namprd12.prod.outlook.com (2603:10b6:910:f::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:CY4PR12MB1446; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1446;3:I0Rcb0l3Jx66cgn8okq/VOgQzvYo4Rk0v/NGpOESQyJ9dJkvLhudFRW33OgqPBI3a9yHzM9L74KFpMXjem5gm+cKVB81bceYtKftr6tKhbOxJ6W5bKySNNZncYP3k6UW3sCJBRT1C5cK5xoTsTdXJioGIwSLP7AVztJKhfdJq0jK6MVT0a7eSpqI4ZQbwIEUN62sED3oqfrtvFyfc1QA825DxfhYxON1YwrTNCpnV/q9zF8uqPuTjcBD55ndh/bn;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WHHYGEaN7Hf4cLplcGHMBhLbCUPH89BY2jAbCVFe8wzPT8UZk+v1ldUSzNOGrd+G097XXJTXvyEnk/J2KMUxV;4:+3wprzWVFk44SBlKUWwVmPkkkYKc5pk/NDHaT02LhHGvYJPp7rMMsBRBKOab9fG7av+U9AGLynGj7Q5i2UZJUKiIZ6N1bFokBG0jVb60NdwiPmBm9u4YCgrAi3w0UO6mKBxqKQgdQpO96BwxApfged/i5d0qVCKnGF+xNTQy67aVmm9wOtFsAp+W3i0gx16BMZ0ElfCpaxQ9ukEYV9D1d67GAxTk1UDykRTG56MsltF80HE5RnHxh2ZGEQ/EYsZcc8O8IkTZV5FSLYcGAX5LBw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231254)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011);SRVR:CY4PR12MB1446;BCL:0;PCL:0;RULEID:;SRVR:CY4PR12MB1446; X-Forefront-PRVS: 066517B35B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(396003)(376002)(39380400002)(39860400002)(366004)(189003)(199004)(25786009)(7696005)(386003)(2906002)(97736004)(6116002)(3846002)(2351001)(8676002)(2361001)(86362001)(59450400001)(68736007)(81166006)(50466002)(476003)(81156014)(4326008)(956004)(5660300001)(486006)(230700001)(6666003)(6916009)(478600001)(72206003)(55016002)(53416004)(53936002)(26005)(105586002)(106356001)(7736002)(103116003)(8936002)(305945005)(2486003)(23676004)(316002)(186003)(16526019)(58126008)(66066001)(47776003)(52116002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR12MB1446;H:sosxen2.amd.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxNDQ2OzIzOkdRWTgrWmo0WG5TaENJRjB5SjVUTStmcFRH?= =?utf-8?B?ZldxTFh0OWRqM3dWNlpBTWVZYlJSQ2lnbm9IamVnb3JNNURpU01pOXFtaFkx?= =?utf-8?B?VjVvSldnaFdOeWdNRHFKOWtYdHhWNXE3UXVtVThNVWdhYUFTUFlaVEdURFBz?= =?utf-8?B?SmcvVHVLTmRBcjhySENLLzFGbUN0RTRyRDB2SUdEQkRtbWhaRWpkcU9GR0Ux?= =?utf-8?B?K3ZSL2J4YWtNNFJ5ZThVd1FrbFlkK1JGV2o1WjB1a05zYy9mTVQ1T0EzN1hM?= =?utf-8?B?OWN5L05jaytxbTgwOE5SVTdxYVBaOHlUMG4vazIwWVVnbTNXZWdQNXdkZXZP?= =?utf-8?B?L3NnWk82OTMyZUVoMVZFR0Q4QWlsL1NkRUlMSWlHaEc1ZWw4dHZSS2QwK0xx?= =?utf-8?B?MTlNOTJ1UUQ0V3h5cTRXeE5yM292cGMzR0dxV3lZMFBodHdjUXBlalJaMGpC?= =?utf-8?B?azk3SmtONzhwdEMrZWF6TzMxdjBlYXVMZHlVU3dJZXUvRUVaWXUzbFdGUC9z?= =?utf-8?B?ai9Ibm5MRTAxRnB0TWppOUY4MzJKTlB4ek50cVAweWRGNzZ3UFYxMDV1MWVx?= =?utf-8?B?MUVTbEo4bXBJQm0ycnVGKys1SnY5TUZ3bDZGUXBPekVUSW8yZk1wdENHL3VW?= =?utf-8?B?MU85aEN5VjVLQjJvWCt0cnc1Nm9yU3BCRjdaU21rOGd6T2ZtbkpoamZBTitz?= =?utf-8?B?QUx6YmxRTGRQOFl3azFmaGdlYTlnVE1UeDNnOWNYU2RVUC9zaWtUYmEveGhP?= =?utf-8?B?WTk4bGFId1g2Q05lVkNRTFV0d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4o3Et1TtOrRi64x7ZC+ZjuXNj3U2Rn0+/uIn84F6LppmoDEgg/i0lGOFxnm4eT0azVNLhqB0uTTDSEZoTglX1QFUMIxi9T4lp366xeEbbXbpILO+v X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1446;6:trsUJm7Mdw6DqIriiOd95o7gn9guIB4sGNxXlWom35AlCzq9C4RCsJw0z6oGVEIQ4z29dngwVcZlSxDam8BbuGu/kVr3XyKur4EpRQmGZIxCL0xjENZh5+LlD4nX4Kpy0/WjVXn9IkhpUvJk0g2iCOJc2LR4JsCim/DC93k75kk5O8npHAdVb+fw75DsP4/WUAslN2ruS9px/Age7lnuTzxIJdqJpUSvt6bO8nE0R3r3eL0WkJykkzEc+EayN9Ye//Hps6m5Oc5W7Zf/Fa5RQReXU8D9RPzbfBg1OudlAScI2cJPNN0kx8JsiDWx1VtRRJibORG5dUXtI4dc6KNseTm+JgnUzz2u/6xoqh6OeNuIqKhXMSCirOTcSlsthbctCxdm56gH764aLsqFKNQSs4E2FIvTNus98C0Q1QtYvGLNXYQcgIWdKnBXTEbGGjrSBD95+eG/dM9F1UFR4ZBm5A==;5:8fJCt+7ndxV4NvDmiln8L1MoNg0HmWULNFNR2nETb+VpPXKa0piNK7qf+9fm+x5q40Mwc0AHb19U2ySYjfj7eunE7fL4q/69wERiWzSU/DyEE0zS5p66XNjJ6tFpAfUedoHqNG4MxFNYRGR8DW14MdcJwSqh6HVFZXzNPIrybVI=;24:tapCQgcmiNK0l4PbRO5Os38cCf3p0oKT6F9DPH6ricYG2oLJOX0tg8riiD40eEli4SC9CXsXvnMnRxXzvnqTPdcBkP9ERYRnohVtMb/sae0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1446;7:aqHaKF9ACiT71jGa417c5ZX+FPRPA2BHDlkbXA3co0Yx0pdVs96/WYmosbDL5Pe2pYZnO/Mm2x5n+ilUDw+oGlP7ZoxQMARDUYErjwsTNQVO2S23PZaCqh6/tKLxaK/uViB+zs8oHC3ZIEgszpJlV0IvBq5bCZs1ZujywjXa6/SF5Zmw1EQgM+ePxTIUx4gf3DggnyInX1dlPrYNuJM4Z3v5fDScWiom4BhSx6YMNWzKsIMyKDslZZShOBuX6gaq;20:s0C4JU50JaJTkYfztjo5nS/CH2NzmHdC+WSKzd6LXpz6g6J20KokaCwjtE/1Fs4bbiryQOnVzZlICvkobFCO1JdbWM+QEoAA9DbNlc3C8WVkKIEobwbUD+dX2ClwhALztqXT5jq1aUjoI8irzoh4xrDIfrHGiRTGvMEoaPs1isxXAA8Bb4BKP+oLWnEAqNewOzkb8lv3LiPCD7VxXgr2omhjdW9Uj0LnxYBiTaF3qRUZFATkLxwTVcYPheplhstK X-MS-Office365-Filtering-Correlation-Id: 117d4470-3f68-43dd-627e-08d5b45563dd X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2018 20:01:57.7215 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 117d4470-3f68-43dd-627e-08d5b45563dd X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1446 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, called at IOMMU initialization, to create a debugfs directory for the IOMMU. Under this directory 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_DEBUGFS to globally allow/disallow debugfs code to be built. The Makefile structure is intended to allow the use of a single switch for turning on DebugFS. Changes since v4: - Guard vendor-specific debugfs files in the Makefile - Call top-level routine from iommu_init() - Add function for instantiating a driver-specific directory - Change AMD driver code to use this new format Changes since v3: - Remove superfluous calls to debugfs_initialized() - Emit a warning exactly one time - Change the Kconfig name to IOMMU_DEBUGFS - Change the way debugfs modules are made 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 IOMMU driver internals iommu/amd: Add basic debugfs infrastructure for AMD IOMMU drivers/iommu/Kconfig | 11 ++++++ drivers/iommu/Makefile | 6 +++ drivers/iommu/amd_iommu_debugfs.c | 41 ++++++++++++++++++++++++ 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 | 64 +++++++++++++++++++++++++++++++++++++ drivers/iommu/iommu.c | 2 + include/linux/iommu.h | 8 +++++ 9 files changed, 145 insertions(+), 2 deletions(-) create mode 100644 drivers/iommu/amd_iommu_debugfs.c create mode 100644 drivers/iommu/iommu-debugfs.c --