From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 751EAC31E40 for ; Fri, 9 Aug 2019 05:37:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B9062173E for ; Fri, 9 Aug 2019 05:37:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405521AbfHIFhx (ORCPT ); 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); >