All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: David Dillow <dillow@google.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommu/vt-d: Don't free parent pagetable of the PTE we're adding
Date: Wed, 26 Jul 2017 11:13:31 +0200	[thread overview]
Message-ID: <20170726091331.GB15833@8bytes.org> (raw)
In-Reply-To: <20170629024223.14866-1-dillow@google.com>

On Wed, Jun 28, 2017 at 07:42:23PM -0700, David Dillow wrote:
> When adding a large scatterlist entry that covers more than the L3
> superpage size (1GB) but has an alignment such that we must use L2
> superpages (2MB) , we give dma_pte_free_level() a range that causes it
> to free the L3 pagetable we're about to populate. We fix this by telling
> dma_pte_free_pagetable() about the pagetable level we're about to populate
> to prevent freeing it.
> 
> For example, mapping a scatterlist with entry lengths 854MB and 1194MB
> at IOVA 0xffff80000000 would, when processing the 2MB-aligned second
> entry, cause pfn_to_dma_pte() to create a L3 directory to hold L2
> superpages for the mapping at IOVA 0xffffc0000000. We would previously
> call dma_pte_free_pagetable(domain, 0xffffc0000, 0xfffffffff), which
> would free the L3 directory pfn_to_dma_pte() just created for IO PFN
> 0xffffc0000. Telling dma_pte_free_pagetable() to retain the L3
> directories while using L2 superpages avoids the erroneous free.
> 
> Signed-off-by: David Dillow <dillow@google.com>
> ---
>  drivers/iommu/intel-iommu.c | 38 ++++++++++++++++++++++++++------------
>  1 file changed, 26 insertions(+), 12 deletions(-)

Applied, thanks.

WARNING: multiple messages have this Message-ID (diff)
From: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
To: David Dillow <dillow-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] iommu/vt-d: Don't free parent pagetable of the PTE we're adding
Date: Wed, 26 Jul 2017 11:13:31 +0200	[thread overview]
Message-ID: <20170726091331.GB15833@8bytes.org> (raw)
In-Reply-To: <20170629024223.14866-1-dillow-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>

On Wed, Jun 28, 2017 at 07:42:23PM -0700, David Dillow wrote:
> When adding a large scatterlist entry that covers more than the L3
> superpage size (1GB) but has an alignment such that we must use L2
> superpages (2MB) , we give dma_pte_free_level() a range that causes it
> to free the L3 pagetable we're about to populate. We fix this by telling
> dma_pte_free_pagetable() about the pagetable level we're about to populate
> to prevent freeing it.
> 
> For example, mapping a scatterlist with entry lengths 854MB and 1194MB
> at IOVA 0xffff80000000 would, when processing the 2MB-aligned second
> entry, cause pfn_to_dma_pte() to create a L3 directory to hold L2
> superpages for the mapping at IOVA 0xffffc0000000. We would previously
> call dma_pte_free_pagetable(domain, 0xffffc0000, 0xfffffffff), which
> would free the L3 directory pfn_to_dma_pte() just created for IO PFN
> 0xffffc0000. Telling dma_pte_free_pagetable() to retain the L3
> directories while using L2 superpages avoids the erroneous free.
> 
> Signed-off-by: David Dillow <dillow-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
> ---
>  drivers/iommu/intel-iommu.c | 38 ++++++++++++++++++++++++++------------
>  1 file changed, 26 insertions(+), 12 deletions(-)

Applied, thanks.

  reply	other threads:[~2017-07-26  9:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29  2:42 [PATCH] iommu/vt-d: Don't free parent pagetable of the PTE we're adding David Dillow
2017-06-29  2:42 ` David Dillow via iommu
2017-07-26  9:13 ` Joerg Roedel [this message]
2017-07-26  9:13   ` Joerg Roedel

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=20170726091331.GB15833@8bytes.org \
    --to=joro@8bytes.org \
    --cc=dillow@google.com \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.