Quick Links
XN bit support on ARMv7 Cortex A15
#1
Posted 09 January 2013 - 06:03 PM
I am new to arm community.
Please help me to verify XN bit support in Cortex A15 arm v7.
In linux kernel ref. (http://lxr.free-elec...-2level-hwdef.h)
PMD_SECT_XN defined as #define PMD_SECT_XN (_AT(pmdval_t, 1) << 4) /* v6 */
with this #define it seems that it is defined for ARM v6.
Is the same #define used for ARM v7 ?
Please let me know how to check XN bit support in kernel version 3.0 and above for cortex A15 arm v7.
Thanks & Regards,
Taani
#2
Posted 09 January 2013 - 07:17 PM
HTH,
Iso
#3
Posted 10 January 2013 - 10:38 AM
I followed below steps to test XN bit support.
1. I compiled attached test program i.e exectest with “-z execstack”option (gcc -z execstack -o exectest exectest.c -lpthread)
2. I removed XN bit related code in ./arch/arm/mm/mmu.c and burned kernel on target.
Filename : arch/arm/mm/mmu.cLine: 346
if(cpu_is_xsc3() || (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP))){
if (!cpu_is_xsc3()) {
#if 0
/* Mark device regions on ARMv6+ asexecute-never
* to prevent speculativeinstruction fetches. */
mem_types[MT_DEVICE].prot_sect |= PMD_SECT_XN;
mem_types[MT_DEVICE_NONSHARED].prot_sect |= PMD_SECT_XN;
mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_XN;
mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_XN;
#endif
}
if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) {
3. Executed test program on target.
4.I found some times successful execution with correct output and sometimes page fault.
As per my understanding this test program should always execute correctly and give correct output.
If I skip step 2 (means not commenting the XN bit related code) then also I have got the same behavior.
Please let me know how to verify XN bit support.
Thanks & Regards,
Attached File(s)
-
exectest.txt (2.86K)
Number of downloads: 1
This post has been edited by Taani: 10 January 2013 - 11:07 AM














