All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: Tomasz Figa <tfiga@chromium.org>
Cc: iommu@lists.linux-foundation.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org,
	Joerg Roedel <joro@8bytes.org>,
	Daniel Kurtz <djkurtz@chromium.org>
Subject: Re: [PATCH] CHROMIUM: iommu: rockchip: Make sure that page table state is coherent
Date: Tue, 10 Feb 2015 23:21:55 +0100	[thread overview]
Message-ID: <1697393.usElVkPJfb@diego> (raw)
In-Reply-To: <1423480761-33453-1-git-send-email-tfiga@chromium.org>

Am Montag, 9. Februar 2015, 20:19:21 schrieb Tomasz Figa:
> Even though the code uses the dt_lock spin lock to serialize mapping
> operation from different threads, it does not protect from IOMMU
> accesses that might be already taking place and thus altering state
> of the IOTLB. This means that current mapping code which first zaps
> the page table and only then updates it with new mapping which is
> prone to mentioned race.
> 
> In addition, current code assumes that mappings are always > 4 MiB
> (which translates to 1024 PTEs) and so they would always occupy
> entire page tables. This is not true for mappings created by V4L2
> Videobuf2 DMA contig allocator.
> 
> This patch changes the mapping code to always zap the page table
> after it is updated, which avoids the aforementioned race and also
> zap the last page of the mapping to make sure that stale data is
> not cached from an already existing mapping.
> 
> Signed-off-by: Tomasz Figa <tfiga@chromium.org>
> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>

I don't know enough about iommu-magic yet to review this properly, but on my 
rk3288-firefly the whole display pipeline stays in working condition, down to 
x11 and es2gears, so

Tested-by: Heiko Stuebner <heiko@sntech.de>

WARNING: multiple messages have this Message-ID (diff)
From: heiko@sntech.de (Heiko Stübner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] CHROMIUM: iommu: rockchip: Make sure that page table state is coherent
Date: Tue, 10 Feb 2015 23:21:55 +0100	[thread overview]
Message-ID: <1697393.usElVkPJfb@diego> (raw)
In-Reply-To: <1423480761-33453-1-git-send-email-tfiga@chromium.org>

Am Montag, 9. Februar 2015, 20:19:21 schrieb Tomasz Figa:
> Even though the code uses the dt_lock spin lock to serialize mapping
> operation from different threads, it does not protect from IOMMU
> accesses that might be already taking place and thus altering state
> of the IOTLB. This means that current mapping code which first zaps
> the page table and only then updates it with new mapping which is
> prone to mentioned race.
> 
> In addition, current code assumes that mappings are always > 4 MiB
> (which translates to 1024 PTEs) and so they would always occupy
> entire page tables. This is not true for mappings created by V4L2
> Videobuf2 DMA contig allocator.
> 
> This patch changes the mapping code to always zap the page table
> after it is updated, which avoids the aforementioned race and also
> zap the last page of the mapping to make sure that stale data is
> not cached from an already existing mapping.
> 
> Signed-off-by: Tomasz Figa <tfiga@chromium.org>
> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>

I don't know enough about iommu-magic yet to review this properly, but on my 
rk3288-firefly the whole display pipeline stays in working condition, down to 
x11 and es2gears, so

Tested-by: Heiko Stuebner <heiko@sntech.de>

  parent reply	other threads:[~2015-02-10 22:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 11:19 [PATCH] CHROMIUM: iommu: rockchip: Make sure that page table state is coherent Tomasz Figa
2015-02-09 11:19 ` Tomasz Figa
2015-02-09 11:19 ` Tomasz Figa
     [not found] ` <1423480761-33453-1-git-send-email-tfiga-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2015-02-09 11:22   ` Tomasz Figa
2015-02-09 11:22     ` Tomasz Figa
2015-02-09 11:22     ` Tomasz Figa
2015-02-10 22:21 ` Heiko Stübner [this message]
2015-02-10 22:21   ` Heiko Stübner
2015-03-03 13:36 ` Joerg Roedel
2015-03-03 13:36   ` Joerg Roedel
     [not found]   ` <20150303133659.GD10502-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-03-23  8:38     ` Tomasz Figa
2015-03-23  8:38       ` Tomasz Figa
2015-03-23  8:38       ` Tomasz Figa
     [not found]       ` <CAAFQd5Abk6X7AVTFaNuUSiShn31pzwwTE3VjfLnE4kyziAjy2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-23 12:29         ` Joerg Roedel
2015-03-23 12:29           ` Joerg Roedel
2015-03-23 12:29           ` Joerg Roedel
2021-12-09 15:18       ` Dafna Hirschfeld
2021-12-09 15:18         ` Dafna Hirschfeld
2021-12-09 15:18         ` Dafna Hirschfeld
2021-12-09 15:18         ` Dafna Hirschfeld
2022-01-24  5:37         ` Tomasz Figa
2022-01-24  5:37           ` Tomasz Figa
2022-01-24  5:37           ` Tomasz Figa
2022-01-24  5:37           ` Tomasz Figa

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=1697393.usElVkPJfb@diego \
    --to=heiko@sntech.de \
    --cc=djkurtz@chromium.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=tfiga@chromium.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.