]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommu/amd: Apply workaround for ATS write permission check
authorJay Cornwall <jay@jcornwall.me>
Wed, 10 Feb 2016 21:48:01 +0000 (15:48 -0600)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:45:31 +0000 (15:45 -0700)
commit5a81364a2789ac1d0c059fbdbaf47580356d02d9
tree5e2ea2c57aaf70a2ad1ab2538e86bbb53674fb8c
parentdb37129231bf199ef87effcdd44924180a3eaf79
iommu/amd: Apply workaround for ATS write permission check

Orabug: 23330974

[ Upstream commit 358875fd52ab8f00f66328cbf1a1d2486f265829 ]

The AMD Family 15h Models 30h-3Fh (Kaveri) BIOS and Kernel Developer's
Guide omitted part of the BIOS IOMMU L2 register setup specification.
Without this setup the IOMMU L2 does not fully respect write permissions
when handling an ATS translation request.

The IOMMU L2 will set PTE dirty bit when handling an ATS translation with
write permission request, even when PTE RW bit is clear. This may occur by
direct translation (which would cause a PPR) or by prefetch request from
the ATC.

This is observed in practice when the IOMMU L2 modifies a PTE which maps a
pagecache page. The ext4 filesystem driver BUGs when asked to writeback
these (non-modified) pages.

Enable ATS write permission check in the Kaveri IOMMU L2 if BIOS has not.

Signed-off-by: Jay Cornwall <jay@jcornwall.me>
Cc: <stable@vger.kernel.org> # v3.19+
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit 15115bf3b764c4f2b36ea202f45181fd18d4a574)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/iommu/amd_iommu_init.c