Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2699319BB9 for ; Wed, 11 Oct 2023 08:44:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="lzr/j0Zg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697013888; x=1728549888; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lpncFO9EBL1O72rF23q9xrrFLTa4Sw3ZpdC9K4pRN7g=; b=lzr/j0Zgrvx++8OAo6ghDBmuoAxHLUemZss3s+xCr2pN6ImaPAU5JvoB k6eEY6LdXPJTL2bB5h/btt7ypJ+iAAtybDzfftltl7idl3zMvEtVKDygt A67APgjKPiAomfjnyd/Lb4Z0UJk7hafnP6fMvyh3MXyjCb27N+EVkw6G0 qcMKaXeJJBde7fB1FCgkrZeH1kttM4skj7OCFt9Dvw0nsYtG/17DNc2Up mPk72lEvgTHn7o3pePLSOg+1+a3q4zA5sSQ5kEhdZy8HWCJxEtRbV2dC6 Zpi+kXtWA82wa6cp2R9gxzvrK3sho314lBGs/RqAlpK0pQJr6laYcG1UJ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="383474573" X-IronPort-AV: E=Sophos;i="6.03,214,1694761200"; d="scan'208";a="383474573" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 01:44:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="877587371" X-IronPort-AV: E=Sophos;i="6.03,214,1694761200"; d="scan'208";a="877587371" Received: from cascade.sh.intel.com ([10.239.48.35]) by orsmga004.jf.intel.com with ESMTP; 11 Oct 2023 01:44:44 -0700 From: Jingqi Liu To: iommu@lists.linux.dev, Lu Baolu , Tian Kevin , David Woodhouse , Joerg Roedel , Will Deacon , Robin Murphy Cc: linux-kernel@vger.kernel.org, Jingqi Liu Subject: [PATH v4 1/3] iommu/vt-d: debugfs: Dump entry pointing to huge page Date: Wed, 11 Oct 2023 16:39:13 +0800 Message-Id: <20231011083915.36706-2-Jingqi.liu@intel.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20231011083915.36706-1-Jingqi.liu@intel.com> References: <20231011083915.36706-1-Jingqi.liu@intel.com> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit For the page table entry pointing to a huge page, the data below the level of the huge page is meaningless and does not need to be dumped. Signed-off-by: Jingqi Liu --- drivers/iommu/intel/debugfs.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/intel/debugfs.c b/drivers/iommu/intel/debugfs.c index 0255c4a23269..e2a3c37943a0 100644 --- a/drivers/iommu/intel/debugfs.c +++ b/drivers/iommu/intel/debugfs.c @@ -311,9 +311,14 @@ static inline unsigned long level_to_directory_size(int level) static inline void dump_page_info(struct seq_file *m, unsigned long iova, u64 *path) { - seq_printf(m, "0x%013lx |\t0x%016llx\t0x%016llx\t0x%016llx\t0x%016llx\t0x%016llx\n", - iova >> VTD_PAGE_SHIFT, path[5], path[4], - path[3], path[2], path[1]); + seq_printf(m, "0x%013lx |\t0x%016llx\t0x%016llx\t0x%016llx", + iova >> VTD_PAGE_SHIFT, path[5], path[4], path[3]); + if (path[2]) { + seq_printf(m, "\t0x%016llx", path[2]); + if (path[1]) + seq_printf(m, "\t0x%016llx", path[1]); + } + seq_putc(m, '\n'); } static void pgtable_walk_level(struct seq_file *m, struct dma_pte *pde, -- 2.21.3