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: <20230625150442.42197-2-Jingqi.liu@intel.com>
Date:   Sun, 25 Jun 2023 23:04:38 +0800
From:   Jingqi Liu <Jingqi.liu@...el.com>
To:     iommu@...ts.linux.dev, Lu Baolu <baolu.lu@...ux.intel.com>,
        Tian Kevin <kevin.tian@...el.com>,
        Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
        Robin Murphy <robin.murphy@....com>
Cc:     linux-kernel@...r.kernel.org, Jingqi Liu <Jingqi.liu@...el.com>
Subject: [PATCH 1/5] iommu/vt-d: debugfs: Define domain_translation_struct file ops

Define domain_translation_struct file_operations instead of using
DEFINE_SHOW_ATTRIBUTE() in order to specify source identifier and pasid
to dump the specified page table.

Signed-off-by: Jingqi Liu <Jingqi.liu@...el.com>
---
 drivers/iommu/intel/debugfs.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/intel/debugfs.c b/drivers/iommu/intel/debugfs.c
index 1f925285104e..072cfef19175 100644
--- a/drivers/iommu/intel/debugfs.c
+++ b/drivers/iommu/intel/debugfs.c
@@ -391,7 +391,25 @@ static int domain_translation_struct_show(struct seq_file *m, void *unused)
 	return bus_for_each_dev(&pci_bus_type, NULL, m,
 				show_device_domain_translation);
 }
-DEFINE_SHOW_ATTRIBUTE(domain_translation_struct);
+
+static int domain_translation_struct_open(struct inode *inode,
+					  struct file *filp)
+{
+	/*
+	 * Allocate one 1Mbyte buffer to save sequential file output,
+	 * since the default size of input buffer is 1Mbyte when the
+	 * user reads.
+	 */
+	return single_open_size(filp, domain_translation_struct_show,
+				inode->i_private, SZ_1M);
+}
+
+static const struct file_operations domain_translation_struct_fops = {
+	.open		= domain_translation_struct_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};
 
 static void invalidation_queue_entry_show(struct seq_file *m,
 					  struct intel_iommu *iommu)
-- 
2.21.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ