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]
Date:   Wed, 10 Jan 2018 15:40:48 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Sohil Mehta <sohil.mehta@...el.com>,
        Joerg Roedel <joro@...tes.org>,
        Alex Williamson <alex.williamson@...hat.com>
Cc:     Ashok Raj <ashok.raj@...el.com>,
        David Woodhouse <dwmw2@...radead.org>,
        iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
        Jacob Pan <jacob.jun.pan@...ux.intel.com>,
        Gayatri Kammela <gayatri.kammela@...el.com>,
        Ravi V Shankar <ravi.v.shankar@...el.com>,
        Lu Baolu <baolu.lu@...ux.intel.com>,
        Fenghua Yu <fenghua.yu@...el.com>
Subject: Re: [PATCH v6 4/5] iommu/vt-d: Add debugfs support to show Pasid
 table contents

On Tue, 2018-01-09 at 19:48 -0800, Sohil Mehta wrote:

> Debugfs extension to dump the internals such as pasid table entries
> for
> each IOMMU to the userspace.
> 
> Example of such dump in Kabylake:
> 
> root@...-KBLH-01:~# cat
> /sys/kernel/debug/intel_iommu/dmar_translation_struct
> 
> IOMMU dmar0: Extended Root Table Addr:402b9e800
> Extended Root table entries:
> Bus 0 L: 402150001 H: 0
> Lower Context table entries for Bus: 0
> [entry] DID :B :D .F    Low             High
> [80]    0000:00:0a.00   40214fa05       102
> Higher Context table entries for Bus: 0
> [80]    0000:00:0a.00   40260000c       0
> Pasid Table Addr : ffff8e2d42600000
> Pasid table entries for domain 0:
> [Entry]         Contents
> [0]             12c409801
> 

> +#ifdef CONFIG_INTEL_IOMMU_SVM
> +static void pasid_tbl_entry_show(struct seq_file *m, struct
> intel_iommu *iommu)
> +{
> +	int pasid_size = 0, i;
> +

> +	if (ecap_pasid(iommu->ecap)) {

A nit:
if you use negative condition you can reduce indentation level below.

if (!...)
  return;

pasid_size = ...;
...

> +		pasid_size = intel_iommu_get_pts(iommu);
> +

> +	}
> +}
> +#else /* CONFIG_INTEL_IOMMU_SVM */

> +static void pasid_tbl_entry_show(struct seq_file *m, struct
> intel_iommu *iommu)
> +{
> +}

I think is not a big deal if you put all in one line like
static ... {}

> +#endif /* CONFIG_INTEL_IOMMU_SVM */

-- 
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Intel Finland Oy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ