From patchwork Fri Oct 13 13:58:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liu, Jingqi" X-Patchwork-Id: 152589 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1916019vqb; Fri, 13 Oct 2023 07:04:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/Xt7hpjvcM2dIOON+rqTNUpVsB++WiNIVqfR+mr6wzSK4QgYnqb6qyC2M/HK3/DwnX0QJ X-Received: by 2002:a17:902:e5d2:b0:1c4:1cd3:8062 with SMTP id u18-20020a170902e5d200b001c41cd38062mr30229493plf.2.1697205894484; Fri, 13 Oct 2023 07:04:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697205894; cv=none; d=google.com; s=arc-20160816; b=VOUXHsad2VpdS9vSAZuK1CcgQesvzuaczJylHAgFjNhtMPxxez0MZ3igtw2zikLOkg nEy53lA/hUs6xK/vrIQrnYSTorRNac70j0NN4vi4cR27Y+LTSejilUsakOvWX0piUK8F nCyJ9+yOSfcgiaV2JvIjRdVGHoRyEDZfj1ewjqwDRrgmc4dsrw7ZkAOP/mX0mYKOwhQS ErrqbqWYRkChYE2kHRfytzyarsflHaHiGN7GzAiUzDJC/gvhwCuoqIBw8etud7g/ht+J QQTKNVrhKV16iq2d/ZD/V/le4OrT5nefzH/UzzliaX937lw+n1GnYGPnewuX/rvKm0h8 MnVA== 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=KmbftSba9OwPVRBgxYKa4qlTkN20LpWbmzQUUAJBmiw=; fh=XFDRxS7z/mPiLWcvDFNXxtez86tw5VSUEAZ1VPulNcQ=; b=FXMzbXINoHqXo6bHBXFaDQ98qi9okxU2vfko2YILNhRccYctWGNoU6bGFrqTdwHmwT E8J7tJsUB6MGu0PdLmzlhp1pmaGJnKruAr0eLY6DJNE/lei5m3rYEUMtH6coAdEgVikX H3oYB0XLM3dqwRSXEKiSYWMXusbmHNbaQKdAQKUrssD2IV/03nYNsuaSzdqiyCrorxlC FEgdbGXDP29grRHllB4JQf1weDxpOQduBMRVG5mOrR+swVu35V5Lg356L99ntBjqFJzu 5tAOP0IB3CR9isMnY8JrqPAmZpsQQR3+/O5X+utrEQCYBfHCDyuehon7sHuwXpaCTHrG dd6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PGZG0xFP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id k4-20020a170902d58400b001c60de17b50si4560266plh.182.2023.10.13.07.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 07:04:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PGZG0xFP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 1F64B81C0C08; Fri, 13 Oct 2023 07:04:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232047AbjJMOEL (ORCPT + 19 others); Fri, 13 Oct 2023 10:04:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232029AbjJMOEF (ORCPT ); Fri, 13 Oct 2023 10:04:05 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42B83BF for ; Fri, 13 Oct 2023 07:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697205843; x=1728741843; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1MbYs6JgegSN2mIA//yZ0XYbUKs0DkULemhAxSRyXp4=; b=PGZG0xFPHZNm7YQsSKfFdHgvgwOWEEerZTRO/aN6rS/wZICsbolq4Tz5 Y5I4d21lM4A450zkvQ8T3Zgk5BeZ8Bf16GroWTMJM6nJuauHhC3PgfJYN Qbb0T4Po87n8RNrOiTlE3L1JdWKCcrSIc60doWSeDY71GI7K2JKVbZGjB TNfeJ+dfV4UWiSu7rVWDkrC1532ttntxiiS6huaYQgG8R3w+h/U408sP3 cDfPS50F2beHAB4q0Zr1pnDp4zfRyEFEFaXmXq0jus93jjCwjnHk7Ag39 5quZbJzX2CR+PalWGT68wB2foTCPbAcjcUUidor1HfQaILKBqm5y7Tx2t g==; X-IronPort-AV: E=McAfee;i="6600,9927,10862"; a="384049322" X-IronPort-AV: E=Sophos;i="6.03,222,1694761200"; d="scan'208";a="384049322" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2023 07:04:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10862"; a="1086156354" X-IronPort-AV: E=Sophos;i="6.03,222,1694761200"; d="scan'208";a="1086156354" Received: from cascade.sh.intel.com ([10.239.48.35]) by fmsmga005.fm.intel.com with ESMTP; 13 Oct 2023 07:03:59 -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 v5 1/3] iommu/vt-d: debugfs: Dump entry pointing to huge page Date: Fri, 13 Oct 2023 21:58:09 +0800 Message-Id: <20231013135811.73953-2-Jingqi.liu@intel.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20231013135811.73953-1-Jingqi.liu@intel.com> References: <20231013135811.73953-1-Jingqi.liu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Fri, 13 Oct 2023 07:04:44 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779649367710505766 X-GMAIL-MSGID: 1779649367710505766 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 1f925285104e..497c1561d3d2 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,