From: Baolu Lu <baolu.lu@linux.intel.com>
To: Zhenzhong Duan <zhenzhong.duan@intel.com>,
iommu@lists.linux.dev, linux-kernel@vger.kernel.org
Cc: baolu.lu@linux.intel.com, dwmw2@infradead.org, joro@8bytes.org,
will@kernel.org, robin.murphy@arm.com, chao.p.peng@intel.com,
Kyung Min Park <kyung.min.park@intel.com>
Subject: Re: [PATCH 2/2] iommu/vt-d: Fix checks in pgtable_walk()
Date: Wed, 23 Oct 2024 12:49:44 +0800 [thread overview]
Message-ID: <813d32e8-e84c-4744-bc2c-b76adc10d00f@linux.intel.com> (raw)
In-Reply-To: <20241022095017.479081-3-zhenzhong.duan@intel.com>
On 2024/10/22 17:50, Zhenzhong Duan wrote:
> It's not accurate to dump super page as non-present page,
> meanwhile bit7 in first level page table entry is PAT bit,
Can you please explain how the 'bit7 in first level page table entry' is
relevant to the changes made in this patch?
Also, please make full use of the maximum length of the commit message
line.
> also pointer pte is never NULL in pgtable_walk() context.
>
> Fixes: 914ff7719e8a ("iommu/vt-d: Dump DMAR translation structure when DMA fault occurs")
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> ---
> drivers/iommu/intel/iommu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
> index 8288b0ee7a61..fec5cc1147f3 100644
> --- a/drivers/iommu/intel/iommu.c
> +++ b/drivers/iommu/intel/iommu.c
> @@ -707,14 +707,14 @@ static void pgtable_walk(struct intel_iommu *iommu, unsigned long pfn,
> while (1) {
> offset = pfn_level_offset(pfn, level);
> pte = &parent[offset];
> - if (!pte || (dma_pte_superpage(pte) || !dma_pte_present(pte))) {
> + if (!dma_pte_present(pte)) {
> pr_info("PTE not present at level %d\n", level);
> break;
> }
>
> pr_info("pte level: %d, pte value: 0x%016llx\n", level, pte->val);
>
> - if (level == 1)
> + if (level == 1 || dma_pte_superpage(pte))
> break;
>
> parent = phys_to_virt(dma_pte_addr(pte));
Thanks,
baolu
next prev parent reply other threads:[~2024-10-23 4:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-22 9:50 [PATCH 0/2] vtd: Minor cleanup Zhenzhong Duan
2024-10-22 9:50 ` [PATCH 1/2] iommu/vt-d: Fix checks in dmar_fault_dump_ptes() Zhenzhong Duan
2024-10-23 3:12 ` Baolu Lu
2024-10-23 5:09 ` Duan, Zhenzhong
2024-10-23 7:37 ` Baolu Lu
2024-10-22 9:50 ` [PATCH 2/2] iommu/vt-d: Fix checks in pgtable_walk() Zhenzhong Duan
2024-10-23 4:49 ` Baolu Lu [this message]
2024-10-23 5:16 ` Duan, Zhenzhong
2024-10-23 7:41 ` Baolu Lu
2024-10-23 7:48 ` Duan, Zhenzhong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=813d32e8-e84c-4744-bc2c-b76adc10d00f@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=chao.p.peng@intel.com \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=kyung.min.park@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
--cc=zhenzhong.duan@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox