From patchwork Wed Oct 11 08:39:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liu, Jingqi" X-Patchwork-Id: 151212 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp389268vqb; Wed, 11 Oct 2023 01:45:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHslrB/WTCAND4yz3gyV17tU32zxmMFQBUDuTUlAsiWggkV+ZTKybaEr7pcc4KaAMHC9ECg X-Received: by 2002:a05:6830:6c14:b0:6c6:473c:9ca0 with SMTP id ds20-20020a0568306c1400b006c6473c9ca0mr21111769otb.3.1697013951322; Wed, 11 Oct 2023 01:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697013951; cv=none; d=google.com; s=arc-20160816; b=J8AGTofPQ/h0Jtr7fUdx/EAxdD9e71v6OceqKncrV8IR1sNx9uZJz2+MVzXcuHBvte SMmtUMItzSYF4WxwlDGdFpFM38IGPEr0DNumHy8Qd0a1O19e6kpxVGBIxSWM6BEJYMMJ Pchc5RmPg416DuMWUidYoSxpelhVIXgKGbLqKImffpi/B6g1SYzZr8y0Ar9GjVpsa5K8 eLpkIMMD/2ZHoTYAA681zn2OqAUHsY03LNFf9d8As547yTY6HL835cSEz0vFYqcAEzxC rSFD9BEuzG6Ft/KVS8cI80kO0/t7EcCzWgyM/NSICHOp/b8g46Vurp4WLYCIr4bLzoOD 1rIQ== 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=ph/zG4YMOu55Ql52XuNa0mX2god/6U9yAdLjMXHBlck=; b=tAGy9mchTKKYuXpffBrerIk/0LDi6JRieNl4a5T+a8RqEY7tX22Wm0EDvoNvPu4Evu 9dnkdoiv1GktiI7UykMHODgDkOE73zrzFimMQoOyM75Qe7d7VVcvAt/mbB6kVCFVAqqJ knBLCiOEsvFpshVGpCThN0OUOX+ZkwCrbcraW7yx29nCdhSIgbz0oMd0UwF4PsgeFKhb WkK/lS0BGxTlEemH8fpfUjdXnfAqPxrwOAaq2iazQBND8FvW0B22mwkabZLsfi2arphH 9dIoy1M0vCYp5fxK6KB9iMsw9KtnP90LVfuN25rCFBt5X8usLnLZpDbKxvdgm6RPO1mz yY1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=W0TwkHjG; 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 ay32-20020a056a00302000b0068ff3a3c9d0si11903018pfb.91.2023.10.11.01.45.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 01:45:51 -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=W0TwkHjG; 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 3349580A97A0; Wed, 11 Oct 2023 01:45:29 -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 S1345642AbjJKIo6 (ORCPT + 19 others); Wed, 11 Oct 2023 04:44:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345529AbjJKIow (ORCPT ); Wed, 11 Oct 2023 04:44:52 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9133D94 for ; Wed, 11 Oct 2023 01:44:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697013887; x=1728549887; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lpncFO9EBL1O72rF23q9xrrFLTa4Sw3ZpdC9K4pRN7g=; b=W0TwkHjGAGq5U1GmxATVtn0Eqo7A9AILwxYR+X9nZRTMGKXkfP8P++gv GRpHE6lxKa8KLZc7WWKWVAOapqlCj4rmw5DKp+l5/4kz//X/2O2bU7i4l 5VW1GlK/miin5kKWqrXhS4RXT8C8QanotEpP0D2v4LigUBap07h+vRi9G ps8H8MLy/ohCg9Fo+PF07jgdG+7R2v5EWqCGa8GhiBCv86Im84zOYPiz8 fBpxc8Tl5AHj50rRhF8EhVtg1/qy1nZ3dJfKIeevNFHjHtZw4TWwGME1A aTioDO1WXsEGEnuaUrrUjSdSPJIdRtos/6PWIK9eSwYI5mqiZWODhxqwl Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="383474569" X-IronPort-AV: E=Sophos;i="6.03,214,1694761200"; d="scan'208";a="383474569" 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> MIME-Version: 1.0 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email 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, 11 Oct 2023 01:45:29 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779448100676490640 X-GMAIL-MSGID: 1779448100676490640 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,