From patchwork Sun Jun 25 15:04:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liu, Jingqi" X-Patchwork-Id: 112612 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp6975312vqr; Sun, 25 Jun 2023 08:39:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ79324rybKgbZHjVaBetcvwZUTnQj/6etczy9H62Tkf5rsGUuLY+taOfMN4lXmXq8xX4hUe X-Received: by 2002:a17:907:971a:b0:988:c97b:8961 with SMTP id jg26-20020a170907971a00b00988c97b8961mr18800402ejc.21.1687707590954; Sun, 25 Jun 2023 08:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687707590; cv=none; d=google.com; s=arc-20160816; b=chJGUdjpf2iiFlcJlBJ6Ugq0J1WTHEQNKxz9rfyyumg5sDFhWJMgTbcB1O9VQ9QRby vkxEbM8hYxiYQ0iMPi/ylS+m/9YWslO4n3DFMz1cHNY933rgqQaid/Wca4Ajlxfs3y7X /ycsf1BxPXEsP95E5+pirIfy/P82vLU1Uyp6y75u7sc6nhAbm8reoGXOssSXErNNzAZ2 BsTHZ+fAuw5wEMn+pOyoyq0kXGf9NpKiJGXquet8phJLLDL2Ezk0WI9huYflmE4jtMcN SLwXUOMcF8Lsn9Zw+CPjhDfQ7QwepEf6XdZJ4dh4MCgA+vRYx/GkvoAGu399Jy4Ucm56 PLtA== 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=oqU4mjGDsG7X0Y8np4exQFTUONjEqCZwrz1vQcFJl34=; fh=XFDRxS7z/mPiLWcvDFNXxtez86tw5VSUEAZ1VPulNcQ=; b=zQ+0kfzM86yjBfmw7Wv+BYDRsnHv4QIcpLNDadCA6iyC010RfHA6c60t/yyoBGoI7q bUTmxmIL80tjCxPDzkLGWVFOQPcuHiEZ7WfFzxwiV481kO/WADhJ/lr8jQE+ST5qzNjj LxBGQ9y+7JuQKmhXzWZ6hAXQP3SPcii+s1xflwTxUXFYklEyJgpxXK9veC4KcLQK8T58 U77+o/9OhXYuiWwPOjb+z1icP25z25lY0s+vI57e+v7c3r3jRULMS4ohjxNQq7nEh7R0 jYk6IewedOqV0NU3Vuog7iAjqtpOn6ZNXIo84kpwcvDOPhD9npjDhSQTtcq3ysGvtP5U l1KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=S9m44QiB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t11-20020a17090616cb00b00988ca1b3f55si1874524ejd.810.2023.06.25.08.39.27; Sun, 25 Jun 2023 08:39:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=S9m44QiB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230397AbjFYPSd (ORCPT + 99 others); Sun, 25 Jun 2023 11:18:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230307AbjFYPSN (ORCPT ); Sun, 25 Jun 2023 11:18:13 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 042B51B8 for ; Sun, 25 Jun 2023 08:18: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=1687706293; x=1719242293; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NbhV1jUvIvoPeaMjWeaCFCY5V1AWw9RzK0uK6KP563I=; b=S9m44QiBfsasQInK9mKlcQwBofYKrUAYfbXkz07OzxCorx9lKSSc36qR OCdf0guBmUHdEujJDs9GZyhWIcKj2WF469mlEo/nBIfVzOOoW5E3KbJrT dzWpgpEsFU4JAP+NbRS57jQIhda/0mOUweMh4RspgYtODIjpCK4NDbjZ9 hDY8dZaL7u3JQIFBLlbhUtnSTxLiLFjhTeEqZm4HRO9mmw+0303zYFZFb LCt9S94vunDc6mV/gDUMS6jzMFauxT+8xuRBv2lPWgu2kWVC0qHUoTj8X qVtUQcuqvWtQMENbIQMY5AYYUCFzCcqzblxUbLuBW1IJgIPNw2mIjrCKL A==; X-IronPort-AV: E=McAfee;i="6600,9927,10752"; a="391255102" X-IronPort-AV: E=Sophos;i="6.01,157,1684825200"; d="scan'208";a="391255102" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2023 08:18:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10752"; a="840004542" X-IronPort-AV: E=Sophos;i="6.01,157,1684825200"; d="scan'208";a="840004542" Received: from cascade.sh.intel.com ([10.239.48.162]) by orsmga004.jf.intel.com with ESMTP; 25 Jun 2023 08:18:10 -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 5/5] iommu/vt-d: debugfs: Dump entry pointing to huge page Date: Sun, 25 Jun 2023 23:04:42 +0800 Message-Id: <20230625150442.42197-6-Jingqi.liu@intel.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20230625150442.42197-1-Jingqi.liu@intel.com> References: <20230625150442.42197-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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769689674699035068?= X-GMAIL-MSGID: =?utf-8?q?1769689674699035068?= 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 e4d3b7836076..f5e26cc21905 100644 --- a/drivers/iommu/intel/debugfs.c +++ b/drivers/iommu/intel/debugfs.c @@ -326,9 +326,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,