linux/arch/arm64
Mark Rutland a1c76574f3 arm64: mm: use *_sect to check for section maps
The {pgd,pud,pmd}_bad family of macros have slightly fuzzy
cross-architecture semantics, and seem to imply a populated entry that
is not a next-level table, rather than a particular type of entry (e.g.
a section map).

In arm64 code, for those cases where we care about whether an entry is a
section mapping, we can instead use the {pud,pmd}_sect macros to
explicitly check for this case. This helps to document precisely what we
care about, making the code easier to read, and allows for future
relaxation of the *_bad macros to check for other "bad" entries.

To that end this patch updates the table dumping and initial table setup
to check for section mappings with {pud,pmd}_sect, and adds/restores
BUG_ON(*_bad((*p)) checks after we've handled the *_sect and *_none
cases so as to catch remaining "bad" cases.

In the fault handling code, show_pte is left with *_bad checks as it
only cares about whether it can walk the next level table, and this path
is used for both kernel and userspace fault handling. The former case
will be followed by a die() where we'll report the address that
triggered the fault, which can be useful context for debugging.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Steve Capper <steve.capper@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Laura Abbott <lauraa@codeaurora.org>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2015-01-28 14:27:43 +00:00
..
boot ARM64: SoC changes for 3.19 2014-12-09 17:17:47 -08:00
configs arm64: Enable CPU_IDLE in defconfig 2015-01-27 18:26:38 +00:00
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2014-12-13 13:33:26 -08:00
include arm64:mm: free the useless initial page table 2015-01-28 12:07:28 +00:00
kernel arm64: kernel: remove ARM64_CPU_SUSPEND config option 2015-01-27 11:35:33 +00:00
kvm arm64: kvm: decode ESR_ELx.EC when reporting exceptions 2015-01-15 12:24:52 +00:00
lib arm64: __clear_user: handle exceptions on strb 2014-11-13 15:21:26 +00:00
mm arm64: mm: use *_sect to check for section maps 2015-01-28 14:27:43 +00:00
net arm64: bpf: lift restriction on last instruction 2014-12-03 18:04:09 +00:00
xen arm: xen: implement multicall hypercall support. 2014-04-24 13:09:46 +01:00
Kconfig arm64: kernel: remove ARM64_CPU_SUSPEND config option 2015-01-27 11:35:33 +00:00
Kconfig.debug arm64: add better page protections to arm64 2015-01-22 14:54:29 +00:00
Makefile arm64: kill off the libgcc dependency 2015-01-15 15:52:21 +00:00