linux/arch/arm64
Christoffer Dall 3e35337a4b arm64: Don't report clear pmds and puds as huge
[ Upstream commit fd28f5d439 ]

The current pmd_huge() and pud_huge() functions simply check if the table
bit is not set and reports the entries as huge in that case.  This is
counter-intuitive as a clear pmd/pud cannot also be a huge pmd/pud, and
it is inconsistent with at least arm and x86.

To prevent others from making the same mistake as me in looking at code
that calls these functions and to fix an issue with KVM on arm64 that
causes memory corruption due to incorrect page reference counting
resulting from this mistake, let's change the behavior.

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Steve Capper <steve.capper@linaro.org>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Fixes: 084bd29810 ("ARM64: mm: HugeTLB support.")
Cc: <stable@vger.kernel.org> # 3.11+
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
History 2015-08-04 14:43:02 -04:00
..
boot dtb: xgene: fix: Backward compatibility with older firmware 2014-11-04 17:08:42 -05:00
configs arm64: defconfig: update defconfig for 3.18 2014-11-05 17:07:58 +00:00
crypto crypto: prefix module autoloading with "crypto-" 2015-01-29 17:40:46 -08:00
include arm64/kvm: Fix assembler compatibility of macros 2015-07-13 08:50:06 -04:00
kernel arm64: vdso: work-around broken ELF toolchains in Makefile 2015-07-03 23:02:34 -04:00
kvm arm64: KVM: Fix HCR setting for 32bit guests 2015-05-11 07:07:35 -04:00
lib arm64: __clear_user: handle exceptions on strb 2014-11-13 15:21:26 +00:00
mm arm64: Don't report clear pmds and puds as huge 2015-08-04 14:43:02 -04:00
net arm64: bpf: fix signedness bug in loading 64-bit immediate 2015-06-10 13:42:27 -04:00
xen arm: xen: implement multicall hypercall support. 2014-04-24 13:09:46 +01:00
Kconfig arm64: errata: add workaround for cortex-a53 erratum #845719 2015-04-27 17:13:46 -04:00
Kconfig.debug arm64: Add CONFIG_DEBUG_SET_MODULE_RONX support 2014-09-08 14:39:18 +01:00
Makefile Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2014-10-14 09:22:26 +02:00