Skip to contentSkip to conversation

ARM: mm: Enable PXN when running non-LPAE kernel on LPAE processor

PATCH New Ben Hutchings 3 participants 4 messages Dec 24, 2014 – May 11, 2015 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: mm: Enable PXN when running non-LPAE kernel on LPAE processor

The VMSA field of MMFR0 (bottom 4 bits) is incremented for each added feature. PXN is supported if the value is >= 4 and LPAE is supported if it is >= 5.

In case a kernel with CONFIG_ARM_LPAE disabled is used on a processor that supports LPAE, we can still use PXN in short descriptors. So check for >= 4 not == 4.

Cc Jungseung Lee <[email protected]>
Cc Catalin Marinas <[email protected]>

---
This worked for me in QEMU's vexpress-a15 emulation, but I don't have real hardware available to test with right now.

Ben.

 arch/arm/mm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mm/mmu.c +1 -1
index cda7c40..0872dc0 100644
@@ -530,7 +530,7 @@ static void __init build_mem_type_table(void)
 	 * in the Short-descriptor translation table format descriptors.
 	 */
 	if (cpu_arch == CPU_ARCH_ARMv7 &&
-		(read_cpuid_ext(CPUID_EXT_MMFR0) & 0xF) == 4) {
+		(read_cpuid_ext(CPUID_EXT_MMFR0) & 0xF) >= 4) {
 		user_pmd_table |= PMD_PXNTABLE;
 	}
 #endif
Signature · 9 lines
Ben Hutchings
If more than one person is responsible for a bug, no one is at fault.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 811 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141224/1cd76870/attachment-0001.sig>
#1 lore raw

PATCH 1/1 ARM: mm: Enable PXN when running non-LPAE kernel on LPAE processor

Quoted 11 lines · Ben Hutchings

The VMSA field of MMFR0 (bottom 4 bits) is incremented for each added feature. PXN is supported if the value is >= 4 and LPAE is supported if it is >= 5.

In case a kernel with CONFIG_ARM_LPAE disabled is used on a processor that supports LPAE, we can still use PXN in short descriptors. So check for >= 4 not == 4.

Cc Jungseung Lee <[email protected]>
Cc Catalin Marinas <[email protected]>
#2 lore raw

PATCH 1/1 ARM: mm: Enable PXN when running non-LPAE kernel on LPAE processor

Hi, Ben.

2014-12-25 2:20 GMT+09:00 Catalin Marinas <[email protected]>:

Quoted 9 lines · Ben Hutchings
Quoted 8 lines

The VMSA field of MMFR0 (bottom 4 bits) is incremented for each added feature. PXN is supported if the value is >= 4 and LPAE is supported if it is >= 5.

In case a kernel with CONFIG_ARM_LPAE disabled is used on a processor that supports LPAE, we can still use PXN in short descriptors. So check for >= 4 not == 4.

Quoted 5 lines
Quoted 3 lines
Cc Jungseung Lee <[email protected]>
Cc Catalin Marinas <[email protected]>

Is this patch handled? or you can send it to Russell's patch system:
http://www.arm.linux.org.uk/developer/patches/

#3 lore raw

PATCH 1/1 ARM: mm: Enable PXN when running non-LPAE kernel on LPAE processor

Quoted 12 lines · Jungseung Lee

Hi, Ben.

2014-12-25 2:20 GMT+09:00 Catalin Marinas <[email protected]>:

Quoted 9 lines · Ben Hutchings
Quoted 8 lines

The VMSA field of MMFR0 (bottom 4 bits) is incremented for each added feature. PXN is supported if the value is >= 4 and LPAE is supported if it is >= 5.

In case a kernel with CONFIG_ARM_LPAE disabled is used on a processor that supports LPAE, we can still use PXN in short descriptors. So check for >= 4 not == 4.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Cc Jungseung Lee <[email protected]>
Cc Catalin Marinas <[email protected]>

Is this patch handled?

If it's not in mainline already, than it probably isn't handled.

Quoted 2 lines

or you can send it to Russell's patch system:
http://www.arm.linux.org.uk/developer/patches/

Check mainline first, otherwise please submit it.

Signature · 1 line
Catalin