From patchwork Wed Sep 27 15:15: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: 145444 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp2729512vqu; Wed, 27 Sep 2023 09:02:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGnEKdN+jpftl+SfrY2Aw6giUZx8As7AKpgA39p29zqWchiDkoXxQ3gghYrIeQk2XSwdqcS X-Received: by 2002:a05:6a00:9a3:b0:68e:3eab:9e1b with SMTP id u35-20020a056a0009a300b0068e3eab9e1bmr2810728pfg.22.1695830531386; Wed, 27 Sep 2023 09:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695830531; cv=none; d=google.com; s=arc-20160816; b=Cump51qp1LScJ/EI0tQZiHR2vh0AzToDrwnc//kFhpDD7IwC7nLfrEKgF3zHRMNcjv wSrRazjQzGLVMgb0T97a/W9c0gsxoLkmxk0BInHi7fTt904rerw2/ERVAFRZjKN6Eut3 rmajg4O3SmI94yNaXt/e9RGSeKJkEPeCARv8p3Ozk8kiXiuy7UkWpAu3m03UqPLMVsZh 78mTm0k3Z9E7xXiyri9q1CVxyAI+24EKy+kYqsN0Am6z2vVyHM+JeHawiCKG2fBO7gy0 wi5aZRcaG2YfYuF7SD0LOmfHNYJ8aEeQOoHsWLJbw3pH7tIYx5dJZ9uVlbl9LfsaUlVh hxUA== 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=GkxTsnpxVzkx8lJoWidR1mPdCp2UbKml4QLaHtBVlCl6xtjh5XbgIgEaslFrelBsbW 1VFwYKy5eCfdbpz6fyeFohW/3V6VmWjp5QnRYN3c4+lYjKAZ9vYvCArCbBhZOWETjQCM /4Ck7a+dxXx1EJE0ob9QzIZ/bnuq6DVOqw4WG1X6zSVCI05bsVCuWiSIUH/2cxBW+3gW 3RW5KBtyQ2wukOoahxa51vkM9CySsiJtU/uuhFsMWKCzOfPu3Ccv0VyH3PSzceQG3KJy xE1ta5peuG7zLohWYGeXz91LtXFEEhqj8oq4sw+UWbcbiIM6IYCTccYjkk9dOuZoOryJ 38pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=N6YDpCLB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id z17-20020aa78891000000b0068fb5cec8cfsi16964034pfe.267.2023.09.27.09.02.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 09:02:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=N6YDpCLB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 2FBFF8057E23; Wed, 27 Sep 2023 08:19:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232350AbjI0PTP (ORCPT + 19 others); Wed, 27 Sep 2023 11:19:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232022AbjI0PTO (ORCPT ); Wed, 27 Sep 2023 11:19:14 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E69A136 for ; Wed, 27 Sep 2023 08:19:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695827953; x=1727363953; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lpncFO9EBL1O72rF23q9xrrFLTa4Sw3ZpdC9K4pRN7g=; b=N6YDpCLB72dXEHUnTYck8Jy11GsmWtuNCt4V4TRVjU9EjouAdeuGkGIb RTApJS9jookRSpVZkOcb7Q4dgTs7wPiM/GQnOqWx27XZ5ZIT2KlwL5+3B LJnGT8Ews88QLcQePHSmfrsHx/Yc9P24g8foAeiBO/ZjaK53cHvHZcGQU sAKsrbwDgK2fNuoMtuZOj6xChhaOCuuDxTmHT/RsknLwfmRyk0sNA11WC /8SSDDvTATu1VhS1aM7HRseko1mbZ3rC3jsthTR7VLCLE+I552oA5qzr2 ec8h8STe0uhRFRiDm06MHHXctiXi57lNPUHePMRZSN2CpC56sfJC6Bvxw w==; X-IronPort-AV: E=McAfee;i="6600,9927,10846"; a="362098905" X-IronPort-AV: E=Sophos;i="6.03,181,1694761200"; d="scan'208";a="362098905" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2023 08:19:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10846"; a="819461120" X-IronPort-AV: E=Sophos;i="6.03,181,1694761200"; d="scan'208";a="819461120" Received: from cascade.sh.intel.com ([10.239.48.35]) by fmsmga004.fm.intel.com with ESMTP; 27 Sep 2023 08:19:11 -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: [PATH v3 1/3] iommu/vt-d: debugfs: Dump entry pointing to huge page Date: Wed, 27 Sep 2023 23:15:34 +0800 Message-Id: <20230927151536.67319-2-Jingqi.liu@intel.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20230927151536.67319-1-Jingqi.liu@intel.com> References: <20230927151536.67319-1-Jingqi.liu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 (howler.vger.email [0.0.0.0]); Wed, 27 Sep 2023 08:19:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778207195173270021 X-GMAIL-MSGID: 1778207195173270021 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,