From patchwork Fri Sep 22 15:16:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liu, Jingqi" X-Patchwork-Id: 143897 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp163414vqu; Sat, 23 Sep 2023 06:03:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHhSWenVirzwNeDo3WfQOYtXEfOnuxp/L4azMI7LKPJju5eQAT7195iVVNUdsP6p3VGywN X-Received: by 2002:a17:90b:4a88:b0:274:9be9:7ee3 with SMTP id lp8-20020a17090b4a8800b002749be97ee3mr3362017pjb.8.1695474200572; Sat, 23 Sep 2023 06:03:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695474200; cv=none; d=google.com; s=arc-20160816; b=VnGy6w6Ra2yEVBanoQFG2/2waIBSJEnBhga9Y9wq2AQc/+JlIREkavEAT/Yi3t2mKD E+04oDJxDlKyYHjq8WSPy1iZ8Cmp6kqewjw8mgDDMOjD/n54ba9a3wg2BXJBBkKrm+dr smxWKTJmPpjaSzxUGZfroR0DvEcvLYuWnNtjYUteReZl4gKR43oaoxEyRJc9MJZvXvMH B+ZEJMVD6MiEj+xLZw6cpn0aUFokemzkyJlFe0wuDWzJA4HfUjrL6U+Nupci7MRIxjVx u53d9WKg1Xd3LCf5UhImfyA2kfNsSvqoB0MDnMtzDzh4yJCWMUHxrGV+Lu75Sz0uxpMY mjew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=imG8JPpgV8r0JPJlJ6B1TjhmgorlrMS8NxH9eZf6xs8=; fh=XFDRxS7z/mPiLWcvDFNXxtez86tw5VSUEAZ1VPulNcQ=; b=AnW1plmmr3Ty/44OJV+va/wQi282vu3gyuFPIHYdJg7e8uKl/DDfjlvn7qZfW8q3bW r8VGK9oq1P1qA09CoTYPWlLqO2xWEnDhbSs0aXoS0H4f2joKXobcPiAtDFCc23D3z9Rq bnaWFBSQt0k+AKA46EHUwh0TOqRdKCu2d2M7x49LYknAAT0kGeovGXY+S0liDDST0ftc uQNJzcRtJViqjxu0/95+D3quC/x+7742CkD1Zr/XnaSWjeW29d6Gy5S/o2G43jG8ioV6 THJlZfbGpbTMmQwR7aCFjd81jZ2ZQokDRay+NBQyxVIPF8jbMauoiINdkovAyJ43jfnR kFSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BfOOt781; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id qe8-20020a17090b4f8800b002680f00f8f3si6529920pjb.17.2023.09.23.06.03.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 06:03:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BfOOt781; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id BD274838B3FA; Fri, 22 Sep 2023 08:19:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232764AbjIVPTp (ORCPT + 29 others); Fri, 22 Sep 2023 11:19:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232655AbjIVPTi (ORCPT ); Fri, 22 Sep 2023 11:19:38 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E63FC100 for ; Fri, 22 Sep 2023 08:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695395972; x=1726931972; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lpncFO9EBL1O72rF23q9xrrFLTa4Sw3ZpdC9K4pRN7g=; b=BfOOt7818pmRpZ+9PZfwavJ1pO3jz+yViwdl+DQYR2HEHRs+KU+i5gK2 sC/Avd7rIDDvtLFi6RDcRC73yJh7+xkbgl6IC2U+aOGBFbfenLSKLk91m kbwKRG5Q+OAs/8cFNlsXc7IpyU3LeQnxY5jJXnVgZWUsxP7TC4qbABLF0 gMBXGZNY1HTCa9PRNb4wdB8xgUOm81V9zsBTsMTdKCS/WY/W4dV4P1+aw 2wFp8aFPNprk6NxPswbiAhi4o+T/1/auId1JIc345VPC6OWgwZ7h8ynCg q+tsjPyD2HJtAyzozBg7ZoH7FNvzFb2YE89R5MFGRkyRBJT4sgw94lFF4 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10841"; a="360235278" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="360235278" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2023 08:19:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10841"; a="741133159" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="741133159" Received: from cascade.sh.intel.com ([10.239.48.35]) by orsmga007.jf.intel.com with ESMTP; 22 Sep 2023 08:19:30 -0700 From: Jingqi Liu To: iommu@lists.linux.dev, Lu Baolu , Tian Kevin , Joerg Roedel , Will Deacon , Robin Murphy Cc: linux-kernel@vger.kernel.org, Jingqi Liu Subject: [PATCH v2 1/3] iommu/vt-d: debugfs: Dump entry pointing to huge page Date: Fri, 22 Sep 2023 23:16:34 +0800 Message-Id: <20230922151636.77139-2-Jingqi.liu@intel.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20230922151636.77139-1-Jingqi.liu@intel.com> References: <20230922151636.77139-1-Jingqi.liu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 22 Sep 2023 08:19:44 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777833554999473214 X-GMAIL-MSGID: 1777833554999473214 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,