Received: by 10.213.65.68 with SMTP id h4csp1297564imn; Wed, 14 Mar 2018 16:06:20 -0700 (PDT) X-Google-Smtp-Source: AG47ELubgFgMsfz54yKfSHkiHGwTkHoeYzboW7cyYIPw+ZAVxsFdTCNe+Ttd3RovTMOGgcf9RaBx X-Received: by 2002:a17:902:2f81:: with SMTP id t1-v6mr5682896plb.290.1521068780444; Wed, 14 Mar 2018 16:06:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521068780; cv=none; d=google.com; s=arc-20160816; b=vU2kY+nfr5S5claigJvmg7CyRQ6Nabp/6zfKL7XQOEPAEuBV3w4jWh9zg0wSewmFYA WzGzobRTs2Vo8Klq/FJ2upiehSwFUxsc9LPZ7035552V2+Pwn3prV1Hu2SB3xeW2mUQW vMEj1EGbM78KSNluBDKSMErbia5VFjnG5EBMDnxD1aD68ys0o1PXuZU69gh2plLhu1Wa YI34I10d+4owozxQHjwVCPh/YsfhvZSPuwlnNVTbHJiKvp6ZKlhMczWlO6ctHI/eeYxA 2X2ovR1z/NlRDD8UrnW2N3ulU/nMfNo/a1HtdXdsGdDgGxndbhQg+YQYlX9jJiL3o3Nt ewsw== 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=8aoklAu3sT128Bw2J0YPVShCKTz2rkfbAE8meudnLbw=; b=Feh+3ku7/rfqfRv/B4yQhSycWXTwDg8D5UiPtc3/wDuIpS4YZHzeDAe5zfYdCX5wge 5gYeebdnGw5yvx2bzMex3a0i4J0JXv5vD50uM0FzQHc78iN7ApHRAxnuK9RVbSF6tO1W H8CIUp5whPfosZqEJp47UXNGAzM/X8Tx9F72DheYNs6OkL0zlkGtxZeDEa09eUX7h1ZI MKmA2N7VIt+XA3rKj86NRk36YwYzv1MvTE9AqQhY3dNUWRjVAt6hq+eOIrlbHUXNaSj3 xVY1oYUCOvqPeLq99PNP+IWN7UeCwOWn7GjwvbeKD+9VxKq04VYQm6F75kxzN/lAhWGR f0dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=g6yOkin5; 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 102-v6si2739425plf.132.2018.03.14.16.06.05; Wed, 14 Mar 2018 16:06:20 -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=g6yOkin5; 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 S1751470AbeCNXEz (ORCPT + 99 others); Wed, 14 Mar 2018 19:04:55 -0400 Received: from mail-by2nam03on0040.outbound.protection.outlook.com ([104.47.42.40]:42400 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750779AbeCNXEx (ORCPT ); Wed, 14 Mar 2018 19:04:53 -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=8aoklAu3sT128Bw2J0YPVShCKTz2rkfbAE8meudnLbw=; b=g6yOkin5gRUFCCZdZ6mZhVq1cBGjtdCbhEW1XiwbZkNu7BqDw2fX9s6JuOS+I4AX/iK8XUEQ8QecjmtMP25MEDO2nbxFZkRdvxgKlJB2uSaawFpLnNgo3feiQ/OB67cxtrCKkB6M+9R+KeV6nWwesvZGsUUSESFdFrHTLM1LsyU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Gary.Hook@amd.com; Received: from sosxen2.amd.com (165.204.78.1) by BLUPR12MB0692.namprd12.prod.outlook.com (2a01:111:e400:5951::14) 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:04:49 +0000 Subject: [PATCH v3 0/5] Add debugfs info for the AMD IOMMU 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:04:44 -0500 Message-ID: <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: DM5PR21CA0030.namprd21.prod.outlook.com (2603:10b6:3:ed::16) To BLUPR12MB0692.namprd12.prod.outlook.com (2a01:111:e400:5951::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0b4db2eb-4ec5-44aa-a3bd-08d589fffcfa X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:BLUPR12MB0692; X-Microsoft-Exchange-Diagnostics: 1;BLUPR12MB0692;3:oKuuWE8fooy4sEoOnZKTNm4DU4snhfioH7jF0fSReGnIuhJvM7L8bVx/fLyxe5+3R/kLthINKzWrDjJKTCKq/JYfruSyQfHMdMgijrl+RqumHD6VNIBjr9O54x2NEWYpuJeI1dyWXRDBJck77E3/7vuq588w3WrWgO0IgCJKluPGSG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c6WPyco7FrX5qUGjL60eNDKR7sPGMv0qVZw/QTqVDvTVY0rJQ0305yy9QDDeeUeuDb9I75qwUYxtaMooPg8OFh8LGjF6mK6bZHf/dJnVf1FvRB6l2ayKIlFu/rd2C2nYqeXWOwhR/svJd7m5vC8EyE/zH0NgtdXFHXSUDi+jgnh7;4:wzJuiPir1SzCSXuGy/1g0BG3lbFVpR8n7LWMRm2bhoWvdFhdiRIMw7CP0ww76NmDpfFVnG4nGnPp78hGL6Jo97tHy9Lp/WiqsEf/FVHvJZfwycOSbyGfAXMUT6NF+DbNrZsk8MqGH4y5SFPid5gmd/0cZSMNH5JHyIDDj+OvVf0Ur09KQgGbS2vuBv/ecJM3xQuT2ixhvJTArs0BDNBMpHNTj/+9M92xpnRR0nF+rSgdF4MCD1AYUIhEaTjNoTgXVL+rZEw8O8/A9ZaUUcEpCXjM9RFmRoz8lwwth+PhQX3PPuFlCR93Q725cKCtNVPZ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(209352067349851); 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:BLUPR12MB0692;BCL:0;PCL:0;RULEID:;SRVR:BLUPR12MB0692; X-Forefront-PRVS: 0611A21987 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(366004)(39860400002)(396003)(39380400002)(376002)(346002)(199004)(189003)(4326008)(97736004)(81166006)(53936002)(58126008)(8676002)(59450400001)(103116003)(81156014)(53416004)(8936002)(50466002)(2361001)(7696005)(52116002)(105586002)(25786009)(6916009)(23676004)(186003)(2486003)(68736007)(2351001)(55016002)(72206003)(47776003)(305945005)(5660300001)(106356001)(7736002)(6666003)(2906002)(16526019)(66066001)(230700001)(386003)(316002)(6116002)(26005)(3846002)(478600001)(86362001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR12MB0692;H:sosxen2.amd.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTFVQUjEyTUIwNjkyOzIzOlhPNDdhejZnb0x0LzJLYWlqdVlZeXhtM09Y?= =?utf-8?B?RGc4ZWY1dWJ6alJ6ckRuVUlvMGMwMmZOWTNmdk5HUUlRVG9PVTR1YXhMRFdN?= =?utf-8?B?MTJKMUF2azhoKzk5VDhNS0tKZXQrb2Q1c3NKelNJMFpUaFZRSmZzaFBxQmwz?= =?utf-8?B?L0RLRlNWVnBZRnJJSk5DZjNWVzM3d251dmlRdzVIQnJyVXFXZGhjTHlmeEpq?= =?utf-8?B?RzNIRDAvcjUvcFZ1ckduUW1RdFB4Yy9JbTRVVzlsQU5uSFNPK3dTcnl5ZnI5?= =?utf-8?B?RWREZmRYT25CbkVYRHBUakYyU0hWdk9VVnhIS2k1NkhGRVBmOGcrc1dMWlo1?= =?utf-8?B?Y2NEODgrbWpmSUFTeGVKZW5KSmtoNGdJRGtUamFoTzNhSUQvQ2tDTmt1bEZZ?= =?utf-8?B?RHNYNDlnQTRKRGlsR3BPTXFuUktkQ0RPVUF4NE1RZ1RVMUZ6QWMxWTg0dVJV?= =?utf-8?B?R3lQdzVya3cyQnYybXR4WS9YK1RzWnBuWFlMZ3FzRi9pa3RITlF3ODllSXQ5?= =?utf-8?B?MWVEVWVrK3JPWjJYOWk0a2JOVWJYTTlXRU9Ndm8zZGFOdzVkbnZIVUdJblJZ?= =?utf-8?B?bWhTc0l4Ymd6Z2t0emIvRkZzZFR4RFc4S0p5SDRoUXRKejFpMFF6OU5KY3BG?= =?utf-8?B?VFBmSllvZ1R1V1lRYjVwK2hCaEt4cWNuaWtiOWF5cDBpbEVuSkorK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6+liV+t7XcoJdg7hO5a9MKPwvg+HV7oU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BLUPR12MB0692;20:S/dFkgjEOYFNKtNoC2s67e+Nj8Hsb3DC0Z37WchcrHJBJgZlPpcuy5qOoFW2UR11hy+QoYFxd2q8+ObW8JPgcc9A4La3v3I7fUWaBq1bXixrLNW2//AyEnG/qrSHIqVatLimV66iRYmiPGT2CnD619oWyBw6qcw3sxwnEU726BwKDzMNcQUjniVwM4ow99MfyWZsTuAUx21CTWcpUL4i5QYLfN7zfkfnkKOM8GLLONTwoR33UBHgoKLrcB5cPm44 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2018 23:04:49.2680 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b4db2eb-4ec5-44aa-a3bd-08d589fffcfa X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0692 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following series creates a debugfs directory for AMD IOMMUs, constructs a framework for additional entries, an online README, and a method for dumping device table entries. Data is reported in a default concise mode, but a verbose mode is enabled via a filesystem entry. This is the first of three patch series that will expose a number of IOMMU registers. Changes since v2: - Change lock type to a mutex - Convert a #define to an inline - Alphabetize #include files - Remove unnecessary checks for pointers - Use kstrtoint() instead of sscanf() - Added comments - Minor style fixes Changes since v1: - Correctly use CONFIG_AMD_IOMMU_DEBUG in Makefile and header file --- Gary R Hook (5): iommu/amd - Add debugfs support iommu/amd - Add a 'verbose' switch for IOMMU debugfs iommu/amd - Add a README variable for the IOMMU debugfs iommu/amd - Expose the active IOMMU device table entries iommu/amd - Add a debugfs entry to specify a IOMMU device table entry drivers/iommu/Kconfig | 7 + drivers/iommu/Makefile | 1 drivers/iommu/amd_iommu_debugfs.c | 316 +++++++++++++++++++++++++++++++++++++ drivers/iommu/amd_iommu_init.c | 6 - drivers/iommu/amd_iommu_proto.h | 7 + drivers/iommu/amd_iommu_types.h | 3 6 files changed, 338 insertions(+), 2 deletions(-) create mode 100644 drivers/iommu/amd_iommu_debugfs.c --