ARM64: mm: Move PTE_PROT_NONE bit.
authorSteve Capper <steve.capper@linaro.org>
Tue, 28 May 2013 12:35:51 +0000 (13:35 +0100)
committerMark Brown <broonie@linaro.org>
Fri, 9 May 2014 11:02:47 +0000 (12:02 +0100)
commit7308560ac76c63d199d51490680b70451b471d62
treee9e3c18f676e602ae59d594b67948d93f508f135
parent5ea0c51491e4fef3dceef3fe0d3bac9318752c13
ARM64: mm: Move PTE_PROT_NONE bit.

Under ARM64, PTEs can be broadly categorised as follows:
   - Present and valid: Bit #0 is set. The PTE is valid and memory
     access to the region may fault.

   - Present and invalid: Bit #0 is clear and bit #1 is set.
     Represents present memory with PROT_NONE protection. The PTE
     is an invalid entry, and the user fault handler will raise a
     SIGSEGV.

   - Not present (file or swap): Bits #0 and #1 are clear.
     Memory represented has been paged out. The PTE is an invalid
     entry, and the fault handler will try and re-populate the
     memory where necessary.

Huge PTEs are block descriptors that have bit #1 clear. If we wish
to represent PROT_NONE huge PTEs we then run into a problem as
there is no way to distinguish between regular and huge PTEs if we
set bit #1.

To resolve this ambiguity this patch moves PTE_PROT_NONE from
bit #1 to bit #2 and moves PTE_FILE from bit #2 to bit #3. The
number of swap/file bits is reduced by 1 as a consequence, leaving
60 bits for file and swap entries.

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