Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1160223imm; Tue, 5 Jun 2018 09:59:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJrg++BU3dDmdb1HbCojYHwofcgkjBYbNEfGeVid16ltLFayT5hUGp1K9+V1LpIT9u5DzPJ X-Received: by 2002:a63:7a4a:: with SMTP id j10-v6mr21873387pgn.421.1528217945405; Tue, 05 Jun 2018 09:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528217945; cv=none; d=google.com; s=arc-20160816; b=sz0+o/5/NTfO2j+AY/KqLGRIyXPmCiaolwNHGZZ8YInOJ864FoKP2dSyZip29XrpVv qqugyhxuAMarMJK7E+bjZRbk//pkVFdG5Y3/Psbec+BN1WMC6R6g7rRBXD0K2B7fi+WT MGzHBPa4hLadVf4cN6BdDQyGwXjZJmodltLwiZ+HRNYXgOjHJ1vCRFS59i4R4LDUVqnv 8sJm062lh/ajgF8mMF2d0Kkn8FeS934e2GAbeiQHtMuUB4S+hCdY9WNZxXiBqXPxqmvX q7pr8xcVX63rKT9wQESx50l0Wihm2oEOhBjsoPb3592D9bjgnADu87ADjNvePXvJ38o5 7q8A== 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:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=nOcAi0ODu1VO8eAwd32Y6WzpVip+ZECYvHAxectrK3E=; b=EziiP9gNj21BxNrsau2I6gQKZDUi2b1peSpwhR6S6Bc4dduBchuDPMZ9dmYk7mqU0z nU6YzvdtGmuNyAyjK7bT4G5Qvl7/RlWxIsribmiCeB39fuJsgyx73BnwomoyUgUao47z 7RnnbLeJHyrrdbLheN/qFhbCt/Wu3BRJP4lnq34lzb+99c0tkVNmrmmQwzPz0c/PJOPZ ghpPSLpfhjbG4Gg2zwTGgt7dldJfGpfpfKR6D5NzAQhT2qDjFwVY8C06yFbw3e65r2L6 xNCUfDcCyjaeR/VpcxJ59JqnGsWWALISK3XqrkV8PVjIohZhobRdx5etz7PDHAcx3kvB aWBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=gap7fUNl; 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 b4-v6si48486873pla.345.2018.06.05.09.58.50; Tue, 05 Jun 2018 09:59:05 -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=gap7fUNl; 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 S1751852AbeFEQ6V (ORCPT + 99 others); Tue, 5 Jun 2018 12:58:21 -0400 Received: from mail-bl2nam02on0073.outbound.protection.outlook.com ([104.47.38.73]:52544 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751786AbeFEQ6T (ORCPT ); Tue, 5 Jun 2018 12:58:19 -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:X-MS-Exchange-SenderADCheck; bh=nOcAi0ODu1VO8eAwd32Y6WzpVip+ZECYvHAxectrK3E=; b=gap7fUNlXgO8+eQDfge0j4Au2F1N8eh1nVIwGmzhg9dv+GE7FAxPheUCfeQuydmdRwcq7jjeTWwAPL1c1NlMc1ixrvx7C6GdN75lxWD0XnYpMD5x+MxkNf8EsAOg4hUakbc3438P/PyArsPKblialusHpbW6NG2x4VOxVUeznN0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Gary.Hook@amd.com; Received: from [10.236.109.62] (165.204.78.1) by CY4PR12MB1445.namprd12.prod.outlook.com (2603:10b6:910:f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.14; Tue, 5 Jun 2018 16:58:17 +0000 Subject: Re: [PATCH v8 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU To: Greg KH Cc: iommu@lists.linux-foundation.org, joro@8bytes.org, linux-kernel@vger.kernel.org References: <152761784341.2654.8609366076331539902.stgit@sosgrh1.amd.com> <152761820371.2654.4551405686504157036.stgit@sosgrh1.amd.com> <20180529183917.GA10618@kroah.com> From: Gary R Hook Message-ID: Date: Tue, 5 Jun 2018 11:58:13 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180529183917.GA10618@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: SN4PR0501CA0073.namprd05.prod.outlook.com (2603:10b6:803:22::11) To CY4PR12MB1445.namprd12.prod.outlook.com (2603:10b6:910:f::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:CY4PR12MB1445; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1445;3:oDVttFNTFlK5gTMTgK0aCm1CjkkShk/luVJU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L3W+JwJZlpYQZgrSduDFrvnqGam47WDn6rMVnJJdjBHQGlOsVwCBKNESszyJLt/2s5i0DwzfUifFi4zgvM5HaWQDpkttNQ73FCEmrxsELWsor9HPiVq39Ji7/wEmRbxnREy+1puSZExCbEn9aE6FhPPfgC6tyOJgSEigCQM9xiokYUvb3yJJPsQlpA9iWh+tV1fEccTL+HQPpFG9cR1L6ms0H96inE+3oAYOsw99XZHJrzKpIwlBPfmBYh6naQ1TqHsXyOxfXmShLBZdzVQ3yL0yzK/5G43KbtcHi0tz9WotVzR;4:aG0I/iXb3XzY0rcQJJiY3GylaCTUKEjFFIlEP47/eaV7qOxieBXbT6K7wdhFYhBYYcPNElJcPV5MvPU0o0QNWELy71XPv6wElgfoL75SKeYoDfQE+FQvh30s2vFpyBw8/peHNciIFVSYNWeuaxD5djvoldmW0+ft9J2TmPH0jRmtjkRQ0h6mQgOhhnW0BUjESEpda/VcsRq/ZlcTm2/nAJu7kKIGA5J9yEmzBtnukV0kZGwLGr6q4q41cIEiwWogw1CcoxbdCrXZi/t021UOOXeipFQHwx8jlskQkihQVQNBIEc3HuYkcEyt+Mt6V1Lc X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:CY4PR12MB1445;BCL:0;PCL:0;RULEID:;SRVR:CY4PR12MB1445; X-Forefront-PRVS: 0694C54398 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(39860400002)(366004)(376002)(39380400002)(396003)(346002)(199004)(189003)(229853002)(59450400001)(66066001)(65806001)(305945005)(65956001)(81156014)(81166006)(6666003)(6916009)(53546011)(65826007)(5660300001)(6486002)(72206003)(67846002)(68736007)(58126008)(186003)(316002)(486006)(105586002)(31686004)(16526019)(16576012)(6116002)(8936002)(7736002)(50466002)(6246003)(8676002)(77096007)(97736004)(26005)(53936002)(52116002)(36756003)(106356001)(4326008)(476003)(52146003)(25786009)(47776003)(2486003)(230700001)(2616005)(31696002)(478600001)(64126003)(386003)(86362001)(23676004)(956004)(3846002)(76176011)(11346002)(446003)(2906002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR12MB1445;H:[10.236.109.62];FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxNDQ1OzIzOmI2VmRvU2pEZ2hnckR2QmZWc1pIZnh3SWlP?= =?utf-8?B?blBnTjFSbmg2eHRDZVZtQmRKZ1R3UGpTRXJQWDRzUjF1cTJRdHJLL0VTUGxj?= =?utf-8?B?V0c4amptN0NVL3Jsci9DTmxmRXY1QjZodlBncHpJNTVac3pBOVlBQU9GbkdI?= =?utf-8?B?Zmx4a3JqZkNCM01VdUYrUkFISThobkdvWVNJTU11RFR5czhhQ0NWTjZSVkRS?= =?utf-8?B?ZlBReTJBWVA0U3dSS080eWt0dEd2bVk1SFFVZjBtRzBRaGV2aW1uMnpvVFow?= =?utf-8?B?UWIxZHFaUktYSW41M0w0ZEVVT2hiazRGRUN4RGlEV3J2cFZzL0E5ejdvQlg0?= =?utf-8?B?aTAxQjlsWXl3akczN1A2L2dNMFd3VkJ3LzZncGJuU2Q3Q01xT2lYSGc0enNV?= =?utf-8?B?WkhRS0lRZmlNZXFsck1EWkY1UTV2Rmh4ejNJWG9tK0grLzU4cHNVenpZS1Vk?= =?utf-8?B?TGpDUGYwaVN1MG92emJQbFhtWXRMRjgxN3RvYldjTWVXZE1wckVjSS9mQkJq?= =?utf-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A1hleAVjbrJE6I1NN7cFLYVF6ykZyL/U+ze3fZBChIjXbnk/ugBdUgruOntkBUXkoNA6W2ECE6bphIsFtAem7myy5af0EEFcIt99XppPQQlRwz1yDQfLNr64ZG5/d8IFBYjn7mQr9libDxBB2UtReieBMI8zaAeXAp2wLK+w50 X-MS-Office365-Filtering-Correlation-Id: 708bd338-6f04-4349-3760-08d5cb0588cd X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2018 16:58:17.0562 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 708bd338-6f04-4349-3760-08d5cb0588cd X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1445 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/29/2018 01:39 PM, Greg KH wrote: > On Tue, May 29, 2018 at 01:23:23PM -0500, Gary R Hook wrote: >> Implement a skeleton framework for debugfs support in the >> AMD IOMMU. Add a hidden boolean to Kconfig that is defined >> for the AMD IOMMU when general IOMMY DebugFS support is >> enabled. >> >> Signed-off-by: Gary R Hook >> --- >> drivers/iommu/Kconfig | 4 ++++ >> drivers/iommu/Makefile | 1 + >> drivers/iommu/amd_iommu_debugfs.c | 39 +++++++++++++++++++++++++++++++++++++ >> drivers/iommu/amd_iommu_init.c | 6 ++++-- >> drivers/iommu/amd_iommu_proto.h | 6 ++++++ >> drivers/iommu/amd_iommu_types.h | 5 +++++ >> 6 files changed, 59 insertions(+), 2 deletions(-) >> create mode 100644 drivers/iommu/amd_iommu_debugfs.c >> >> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig >> index f9af25ac409f..ec223f6f4ad4 100644 >> --- a/drivers/iommu/Kconfig >> +++ b/drivers/iommu/Kconfig >> @@ -137,6 +137,10 @@ config AMD_IOMMU >> your BIOS for an option to enable it or if you have an IVRS ACPI >> table. >> >> +config AMD_IOMMU_DEBUGFS >> + def_bool y > > Why default y? Can you not boot a box without this? If not, it should > not be Y. Again, apologies for not seeing this sooner. Yes, the system can boot without this. The idea of a hidden option was surfaced by Robin, and after my first approach was shot down, I tried this. Logic: If the over-arching IOMMU debugfs option is enabled, then AMD_IOMMU_DEBUGFS gets defined, and AMD IOMMU code gets included. This issue was discussed a few weeks ago. No single approach appears to satisfy everyone. I like this because it depends upon one switch: Do you want DebugFS support enabled in the IOMMU driver, period? Vendor-specific code can then choose to implement support or not, and a builder doesn't have to worry about enabling/disabling multiple Kconfig options. At least, that was my line of reasoning. I'm not married to any approach, and I don't find clever use of Kconfig options too terribly challenging. And I'm not defending, I'm just explaining. > >> + depends on AMD_IOMMU && IOMMU_DEBUGFS >> + >> config AMD_IOMMU_V2 >> tristate "AMD IOMMU Version 2 driver" >> depends on AMD_IOMMU >> diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile >> index 74cfbc392862..47fd6ea9de2d 100644 >> --- a/drivers/iommu/Makefile >> +++ b/drivers/iommu/Makefile >> @@ -11,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_DEBUGFS) += amd_iommu_debugfs.o >> 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_debugfs.c b/drivers/iommu/amd_iommu_debugfs.c >> new file mode 100644 >> index 000000000000..6dff98552969 >> --- /dev/null >> +++ b/drivers/iommu/amd_iommu_debugfs.c >> @@ -0,0 +1,39 @@ >> +// SPDX-License-Identifier: GPL-2.0 >> +/* >> + * AMD IOMMU driver >> + * >> + * Copyright (C) 2018 Advanced Micro Devices, Inc. >> + * >> + * Author: Gary R Hook >> + */ >> + >> +#include >> +#include >> +#include >> +#include "amd_iommu_proto.h" >> +#include "amd_iommu_types.h" >> + >> +static struct dentry *amd_iommu_debugfs; >> +static DEFINE_MUTEX(amd_iommu_debugfs_lock); >> + >> +#define MAX_NAME_LEN 20 >> + >> +void amd_iommu_debugfs_setup(struct amd_iommu *iommu) >> +{ >> + char name[MAX_NAME_LEN + 1]; >> + >> + mutex_lock(&amd_iommu_debugfs_lock); >> + if (!amd_iommu_debugfs) >> + amd_iommu_debugfs = iommu_debugfs_new_driver_dir("amd"); >> + mutex_unlock(&amd_iommu_debugfs_lock); >> + >> + if (amd_iommu_debugfs) { > > Do not test this. Okay, noted. I'll stop worrying about this. > >> + snprintf(name, MAX_NAME_LEN, "iommu%02d", iommu->index); >> + iommu->debugfs = debugfs_create_dir(name, >> + amd_iommu_debugfs); >> + if (!iommu->debugfs) { > > No, you don't care about the return value of any debugfs call. Just > save the directory and move on. If it's not correct, find, nothing is > wrong, just keep going. Roger. Thank you, Gary