1
0
Fork 0
alistair23-linux/arch/arm64
Will Deacon ceb218359d arm64: mm: fix pmd_write CoW brokenness
Commit 9c7e535fcc ("arm64: mm: Route pmd thp functions through pte
equivalents") changed the pmd manipulator and accessor functions to
convert the target pmd to a pte, process it with the pte functions, then
convert it back. Along the way, we gained support for PTE_WRITE, however
this is completely ignored by set_pmd_at, and so we fail to set the
PMD_SECT_RDONLY for PMDs, resulting in all sorts of lovely failures (like
CoW not working).

Partially reverting the offending commit (by making use of
PMD_SECT_RDONLY explicitly for pmd_{write,wrprotect,mkwrite} functions)
leads to further issues because pmd_write can then return potentially
incorrect values for page table entries marked as RDONLY, leading to
BUG_ON(pmd_write(entry)) tripping under some THP workloads.

This patch fixes the issue by routing set_pmd_at through set_pte_at,
which correctly takes the PTE_WRITE flag into account. Given that
THP mappings are always anonymous, the additional cache-flushing code
in __sync_icache_dcache won't impose any significant overhead as the
flush will be skipped.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Steve Capper <steve.capper@arm.com>
Tested-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2014-05-29 11:31:14 +01:00
..
boot arm64: Mark the Applied Micro X-Gene SATA controller as DMA coherent 2014-05-03 22:20:35 +01:00
configs arm64: defconfig: Expand default enabled features 2014-02-07 17:17:28 +00:00
include arm64: mm: fix pmd_write CoW brokenness 2014-05-29 11:31:14 +01:00
kernel arm64: use cpu_online_mask when using forced irq_set_affinity 2014-05-12 16:25:07 +01:00
kvm Merge tag 'kvm-3.15-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2014-04-02 14:50:10 -07:00
lib arm64: atomics: fix use of acquire + release for full barrier semantics 2014-02-07 16:45:43 +00:00
mm arm64: fix pud_huge() for 2-level pagetables 2014-05-16 17:34:40 +01:00
xen xen/arm,arm64: enable SWIOTLB_XEN 2013-10-10 13:40:44 +00:00
Kconfig ARM64: Remove duplicated Kconfig entry for "kernel/power/Kconfig" 2014-04-22 18:06:13 +01:00
Kconfig.debug arm64: Add missing Kconfig for CONFIG_STRICT_DEVMEM 2014-04-07 17:33:13 +01:00
Makefile arm64: big-endian: add big-endian support to top-level arch Makefile 2013-10-25 15:59:31 +01:00