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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Aug 2014 01:38:25 +0000 (09:38 +0800)
commite4f2eef20cc69dfcb98636db108786e1fc26f3b9
tree50057bf6bf0d6756e1ca5330e62aafbe0015fa73
parenteb8ab8736fb6f66081841e407a37f6c1222f4d81
sparc64: Add basic validations to {pud,pmd}_bad().

[ Upstream commit 26cf432551d749e7d581db33529507a711c6eaab ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/sparc/include/asm/pgtable_64.h