Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp7745483ybh; Thu, 8 Aug 2019 22:40:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaBLwLqYYa4fAXsuEn/nEpccEwsLYL+Wl5b3Lr/QDlKo7kTUvoCzazVSuM9AwbziYpqGAC X-Received: by 2002:a17:90a:24e4:: with SMTP id i91mr8015228pje.9.1565329223359; Thu, 08 Aug 2019 22:40:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565329223; cv=none; d=google.com; s=arc-20160816; b=yAIVMLTSTujqf1/0SovBqCnkBagPbADRWhh9hBBs6TqdZ8Q1DFr142h1h1JxGqUhmG jwL7MQReipLCF8u/D1k7cU6sYDh8fSiKdkgwBbnFPjci+yz8JB9frbxWdyBjn4baq5OL yj6mZwdbG9t3cfp0M79Fc3Ip7x0DjQ+cQv7fy67ilG+RRNvSkopriJEw50WCFM2Yy38w CIewtfIJvotqGhJUZQNweCdvYSJzlYdcxipQbxLVX9eN2nJ/UiRE/WuEk2aXCnooMTq9 EFM4ctjaKBplAXySRUMbAGWuBfUkh1knZBEs33hAwAo4HBn9HEdEWOFYU0KhXEEYRHzG a8Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:cc; bh=iNVJQO195qYMH4QAUmg3LBpo2c3mbXgcoIwJ+AEgW44=; b=GUbf3kgok9QvT/i9vdnHh1wAoc9pharuYYCYNY0RySj/P3Ng3gBFEl+aZcB/ABYU8X qVR/qgNpA+cMGTk4NcsEomlrY3p/xBxMVmASe/mr0C19t7r3yZVBpxyJSiqFSU+knx+L 5REKZD1cHwGBA7ukkp/reS4DZewCwuo9JxCevJ4sdqB2eV4vjTXzRCKHk5j30yHU1AVu dTEA6kv+zvUffeV6aNd/kPihavwnfajYS8nw8aj8pzg+6v3ybEQQ9ccbNOzdgP2k+yyi CRkNIJXOs+UIpzTwdpcu0i/9Jc5Es78hM+VVWIvgSYdzUgHJoKahBhRDHTHXNX7XY2fZ T8lg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h16si3545944pjt.12.2019.08.08.22.40.06; Thu, 08 Aug 2019 22:40:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405507AbfHIFhx (ORCPT + 99 others); Fri, 9 Aug 2019 01:37:53 -0400 Received: from mga06.intel.com ([134.134.136.31]:34954 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725989AbfHIFhx (ORCPT ); Fri, 9 Aug 2019 01:37:53 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Aug 2019 22:37:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,364,1559545200"; d="scan'208";a="169215317" Received: from allen-box.sh.intel.com (HELO [10.239.159.136]) ([10.239.159.136]) by orsmga008.jf.intel.com with ESMTP; 08 Aug 2019 22:37:49 -0700 Cc: baolu.lu@linux.intel.com, ashok.raj@intel.com, jacob.jun.pan@intel.com, kevin.tian@intel.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Jacob Pan , Sai Praneeth Subject: Re: [PATCH 1/1] iommu/vt-d: Correctly check format of page table in debugfs To: Joerg Roedel , David Woodhouse References: <20190720020126.9974-1-baolu.lu@linux.intel.com> From: Lu Baolu Message-ID: Date: Fri, 9 Aug 2019 13:36:57 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190720020126.9974-1-baolu.lu@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Joerg, Just a friendly reminder. What do you think of this fix? Best regards, Lu Baolu On 7/20/19 10:01 AM, Lu Baolu wrote: > PASID support and enable bit in the context entry isn't the right > indicator for the type of tables (legacy or scalable mode). Check > the DMA_RTADDR_SMT bit in the root context pointer instead. > > Cc: Ashok Raj > Cc: Jacob Pan > Cc: Kevin Tian > Cc: Sai Praneeth > Fixes: dd5142ca5d24b ("iommu/vt-d: Add debugfs support to show scalable mode DMAR table internals") > Signed-off-by: Lu Baolu > --- > drivers/iommu/intel-iommu-debugfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iommu/intel-iommu-debugfs.c b/drivers/iommu/intel-iommu-debugfs.c > index 73a552914455..e31c3b416351 100644 > --- a/drivers/iommu/intel-iommu-debugfs.c > +++ b/drivers/iommu/intel-iommu-debugfs.c > @@ -235,7 +235,7 @@ static void ctx_tbl_walk(struct seq_file *m, struct intel_iommu *iommu, u16 bus) > tbl_wlk.ctx_entry = context; > m->private = &tbl_wlk; > > - if (pasid_supported(iommu) && is_pasid_enabled(context)) { > + if (dmar_readq(iommu->reg + DMAR_RTADDR_REG) & DMA_RTADDR_SMT) { > pasid_dir_ptr = context->lo & VTD_PAGE_MASK; > pasid_dir_size = get_pasid_dir_size(context); > pasid_dir_walk(m, pasid_dir_ptr, pasid_dir_size); >