Received: by 10.192.165.148 with SMTP id m20csp1868100imm; Thu, 3 May 2018 06:45:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoh6XKYFjLkVKfAxAvDawz14in4Qw6MS8xAbvNPjWFDEU45YtP3CuYpmu6q50pZr2gc6LNv X-Received: by 2002:a63:85c1:: with SMTP id u184-v6mr19644707pgd.442.1525355143311; Thu, 03 May 2018 06:45:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525355143; cv=none; d=google.com; s=arc-20160816; b=t8cX5PWTYtbCHRaTnqD+2xgmyybTLg6ANDAKhyVnBiePRsALDu09jvsSKgy3Tp1IDQ RLSJpkdazhZ7EhoXyZdklozgjF+U6n46K0nU2azNXqn2EKtP/A8CD9rcNBeMkmfgNHVu hovSuvXBv/PTk6TQim0J35MOQGdiImEB5fO01xAPVVD4V8xObeyE5Yd+JATSodq0ewcz j122P2Si6IUx+H3huCDd4tHYTb4JJ1HdfQb+RwO7KfRFYBE8PCEvcS8KtOhzuS1vE1c2 LQ4xpaNTCmDHsXBZSwskYCsNiCjeHnu3N96WpLLdXJpNCE7f7mDd/HXNORY4Hx/GfT9X 2+cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=tr3ZtmPNqbuqQQVa9IfMa2gzETljsnrJgjGQQU5cwms=; b=KprSKTXsBibyo3tcZdLveT96tEoilkNiishSu/VulLzqRt49XlNYIMEAxkixIZIm9g Jgt2GY1CETpIEEoi1eIScqg7RDVP1xzFq76uqUNajudYsWnIG7LEQAELgTP9TwWYgqS5 2YIg2CTLTSBAC4DWQMH7Cxu4/+SsLdROhG8aubKJ+gnYdQMfkgI1CynVLHQdt5EGc6u9 JO8XfWoOLDrxxwQ+gxV4G0qNJx8A15dmznsTNF+OS/aPkN+aKMpVyAaEUvFG9PHm+azN FOm5boPR2GlRY2fy1VtRa1kFevUo8JxR6zVihlmTacqOOd5N/6YPuSd1Qrht71KZRac4 cKPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=SUMsshjG; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9-v6si13828397plj.573.2018.05.03.06.45.29; Thu, 03 May 2018 06:45:43 -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=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=SUMsshjG; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751443AbeECNoF (ORCPT + 99 others); Thu, 3 May 2018 09:44:05 -0400 Received: from 8bytes.org ([81.169.241.247]:55076 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750944AbeECNoE (ORCPT ); Thu, 3 May 2018 09:44:04 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id 52EFF188; Thu, 3 May 2018 15:44:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1525355043; bh=h7sSEtbFNrKX4OyN5NQntVjUmF7axxaX1qU+3kroKt0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SUMsshjGo5OQdOxCoKSYE52nqFzZOV05pAPmm0mJhl8Xf3hG8PJAfx/B28ziE91qt 13fHVHYQNB7OmgOg+k2VSf8AG5TOLFMUAZfo3EsiC7jhetAIN8p+0waPfmPhFJgLT7 pcpD+yra03HOGM8DSwMJoXrYe0zra5ClTgamSxVMyaSZI0TBE1ZSlMbY7zzrfAuyKm /44w2LLjWWvk9D3C0vYeIYWfwTNUVQkiHE8GaUBNF0NlLGMJzxeo+PA0tmKfiRrSRj PhtGvoDqC9a04oNf79sxqOBP7MIyPjC62ANff0smRXeH4WcdtvbtGT8D/Y91ZoVnZK yXWB6jDQvZQ9w== Date: Thu, 3 May 2018 15:44:02 +0200 From: Joerg Roedel To: Gary R Hook Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/2] iommu - Enable debugfs exposure of the IOMMU Message-ID: <20180503134402.uqn2y6pso5so2pl7@8bytes.org> References: <152511783026.8963.5818249217042882958.stgit@taos> <152511832970.8963.10801049423048266747.stgit@taos> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <152511832970.8963.10801049423048266747.stgit@taos> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 30, 2018 at 02:58:49PM -0500, Gary R Hook wrote: > Provide base enablement for using debugfs to expose internal data of > an IOMMU driver. When called, create the /sys/kernel/debug/iommu > directory. Emit a strong warning at boot time to indicate that this > feature is enabled. > > This patch adds a top-level function that will create the (above) > directory, under which a driver may create a hw-specific directory for > its use. The function > > iommu_debugfs_setup() That function should be called in iommu core-code, in case we want to export some generic information from there. Each driver then calls a separate function like dentry = iommu_debugfs_driver_dir("amd_iommu"); to create a driver-specific directory. > +config IOMMU_DEBUGFS > + bool "Enable IOMMU internals in DebugFS" s/Enable/Export/ > + * static struct dentry *my_debugfs; > + * > + * struct dentry *d_top; Missing newline > + * if (!my_debugfs) { > + * d_top = iommu_debugfs_setup(); > + * if (d_top) > + * my_debugfs = debugfs_create_dir("vendor", d_top); > + * } > + * > + * Since the IOMMU driver can not be removed from the running system, there > + * is no need for an "off" function. > + */ > +struct dentry *iommu_debugfs_setup(void) > +{ > + 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"); This warning needs to be a lot bigger. See the trace_printk() warning for an example of what I have in mind.