arm64: mm: Introduce PTE_WRITE
authorSteve Capper <Steve.Capper@arm.com>
Wed, 15 Jan 2014 14:07:13 +0000 (14:07 +0000)
committerSteve Capper <steve.capper@linaro.org>
Wed, 5 Mar 2014 07:04:55 +0000 (15:04 +0800)
commit1c0f6f904655f94757977b647bb99aa15d716eee
tree6b3468e0304317dbbf175cfbc6307f7df6eadaab
parent26e700376b6028c66c2c3ea70b47f3325ec916e5
arm64: mm: Introduce PTE_WRITE

We have the following means for encoding writable or dirty ptes:

                                PTE_DIRTY       PTE_RDONLY
!pte_dirty && !pte_write        0               1
!pte_dirty && pte_write         0               1
pte_dirty && !pte_write         1               1
pte_dirty && pte_write          1               0

So we can't distinguish between writable clean ptes and read only
ptes. This can cause problems with ptes being incorrectly flagged as
read only when they are writable but not dirty.

This patch introduces a new software bit PTE_WRITE which allows us to
correctly identify writable ptes. PTE_RDONLY is now only clear for
valid ptes where a page is both writable and dirty.

Signed-off-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Conflicts:
arch/arm64/include/asm/pgtable.h
arch/arm64/include/asm/pgtable.h