lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1523664612.2747.13.camel@intel.com>
Date:   Sat, 14 Apr 2018 00:08:55 +0000
From:   "Mehta, Sohil" <sohil.mehta@...el.com>
To:     "gary.hook@....com" <gary.hook@....com>,
        "iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 2/2] iommu/amd: Add basic debugfs infrastructure for
 AMD IOMMU

On Fri, 2018-04-06 at 08:17 -0500, Gary R Hook wrote:
> 
> +
> +void amd_iommu_debugfs_setup(struct amd_iommu *iommu)
> +{
> +	char name[MAX_NAME_LEN + 1];
> +	struct dentry *d_top;
> +
> +	if (!debugfs_initialized())

Probably not needed.

> +		return;
> +
> +	mutex_lock(&amd_iommu_debugfs_lock);
> +	if (!amd_iommu_debugfs) {
> +		d_top = iommu_debugfs_setup();
> +		if (d_top)
> +			amd_iommu_debugfs =
> debugfs_create_dir("amd", d_top);
> +	}
> +	mutex_unlock(&amd_iommu_debugfs_lock);


You can do the above only once if you iterate over the IOMMUs here
 instead of doing it in amd_iommu_init.

> +	if (amd_iommu_debugfs) {
> +		snprintf(name, MAX_NAME_LEN, "iommu%02d", iommu-
> >index);
> +		iommu->debugfs = debugfs_create_dir(name,
> +						    amd_iommu_debugf
> s);
> +		if (!iommu->debugfs) {
> +			debugfs_remove_recursive(amd_iommu_debugfs);
> +			amd_iommu_debugfs = NULL;
> +		}
> +	}
> +}

-Sohil

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ