Login

Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.

ARM Community: XN bit support on ARMv7 Cortex A15 - ARM Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

XN bit support on ARMv7 Cortex A15 Rate Topic: -----

#1 User is offline   Taani 

  • Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 09-January 13

Posted 09 January 2013 - 06:03 PM

Hello All,

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

#2 User is offline   isogen74 

  • Super Contributor
  • PipPipPipPip
  • Group: Members
  • Posts: 1098
  • Joined: 20-March 07

Posted 09 January 2013 - 07:17 PM

I think the v6 and v7 page tables are (mostly) the same unless you are using the large physical address space, so yes the v6 XN should work fine for Cortex-A15.

HTH,
Iso
When optimizing software, consider that the quickest code to run is the bit you removed from the call path.
0

#3 User is offline   Taani 

  • Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 09-January 13

Posted 10 January 2013 - 10:38 AM

To verify the XN bit support on Cortex A15. I executed the attached c test code.

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)


This post has been edited by Taani: 10 January 2013 - 11:07 AM

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic