sparc64: Add basic validations to {pud,pmd}_bad().
authorDavid S. Miller <davem@davemloft.net>
Tue, 29 Apr 2014 20:03:27 +0000 (13:03 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 4 May 2014 05:56:14 +0000 (22:56 -0700)
commit26cf432551d749e7d581db33529507a711c6eaab
tree2a877a04947ec6ef487a7fe5c60f1c432a67bf94
parent0eef331a3d0ee970dcbebd1bd5fcb57ca33ece01
sparc64: Add basic validations to {pud,pmd}_bad().

Instead of returning false we should at least check the most basic
things, otherwise page table corruptions will be very difficult to
debug.

PMD and PTE tables are of size PAGE_SIZE, so none of the sub-PAGE_SIZE
bits should be set.

We also complement this with a check that the physical address the
pud/pmd points to is valid memory.

PowerPC was used as a guide while implementating this.

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/include/asm/pgtable_64.h