]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/arm-8494-1-mm-enable-pxn-when-running-non-lpae-kerne.patch
4.4-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.4 / arm-8494-1-mm-enable-pxn-when-running-non-lpae-kerne.patch
CommitLineData
9547e94c
SL
1From 2891fcf3b3b20211dabf0e9a95851d3c56618620 Mon Sep 17 00:00:00 2001
2From: Jungseung Lee <js07.lee@samsung.com>
3Date: Tue, 29 Dec 2015 05:47:00 +0100
4Subject: ARM: 8494/1: mm: Enable PXN when running non-LPAE kernel on LPAE
5 processor
6
7[ Upstream commit ad84f56bf6d620fe6ed4d57ce6ec9945684d7f35 ]
8
9The VMSA field of MMFR0 (bottom 4 bits) is incremented for each
10added feature. PXN is supported if the value is >= 4 and LPAE
11is supported if it is >= 5.
12
13In case a kernel with CONFIG_ARM_LPAE disabled is used on a
14processor that supports LPAE, we can still use PXN in short
15descriptors. So check for >= 4 not == 4.
16
17Signed-off-by: Jungseung Lee <js07.lee@samsung.com>
18Acked-by: Catalin Marinas <catalin.marinas@arm.com>
19Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
20Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
21Signed-off-by: Sasha Levin <sashal@kernel.org>
22---
23 arch/arm/mm/mmu.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
27index e47cffd25c6c..aead23f15213 100644
28--- a/arch/arm/mm/mmu.c
29+++ b/arch/arm/mm/mmu.c
30@@ -572,7 +572,7 @@ static void __init build_mem_type_table(void)
31 * in the Short-descriptor translation table format descriptors.
32 */
33 if (cpu_arch == CPU_ARCH_ARMv7 &&
34- (read_cpuid_ext(CPUID_EXT_MMFR0) & 0xF) == 4) {
35+ (read_cpuid_ext(CPUID_EXT_MMFR0) & 0xF) >= 4) {
36 user_pmd_table |= PMD_PXNTABLE;
37 }
38 #endif
39--
402.19.1
41