Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964965AbeAJNno (ORCPT + 1 other); Wed, 10 Jan 2018 08:43:44 -0500 Received: from mga07.intel.com ([134.134.136.100]:18097 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964907AbeAJNnn (ORCPT ); Wed, 10 Jan 2018 08:43:43 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,340,1511856000"; d="scan'208";a="9007331" Message-ID: <1515591648.7000.867.camel@linux.intel.com> Subject: Re: [PATCH v6 4/5] iommu/vt-d: Add debugfs support to show Pasid table contents From: Andy Shevchenko To: Sohil Mehta , Joerg Roedel , Alex Williamson Cc: Ashok Raj , David Woodhouse , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Jacob Pan , Gayatri Kammela , Ravi V Shankar , Lu Baolu , Fenghua Yu Date: Wed, 10 Jan 2018 15:40:48 +0200 In-Reply-To: <1515556102-34150-5-git-send-email-sohil.mehta@intel.com> References: <1515556102-34150-1-git-send-email-sohil.mehta@intel.com> <1515556102-34150-5-git-send-email-sohil.mehta@intel.com> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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@OTC-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 Intel Finland Oy