Arm Community
Site
Search
User
Site
Search
User
Groups
Arm Research
DesignStart
Education Hub
Graphics and Gaming
High Performance Computing
Innovation
Multimedia
Open Source Software and Platforms
Physical
Processors
Security
System
Software Tools
TrustZone for Armv8-M
中文社区
Blog
Announcements
Artificial Intelligence
Automotive
Healthcare
HPC
Infrastructure
Innovation
Internet of Things
Machine Learning
Mobile
Smart Homes
Wearables
Forums
All developer forums
IP Product forums
Tool & Software forums
Pelion IoT Platform
Support
Open a support case
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Developer Community
Tools and Software
Software Tools
Jump...
Cancel
Software Tools
Arm Development Studio forum
XN bit support on ARMv7 Cortex A15
Tools, Software and IDEs blog
Forums
Videos & Files
Help
Jump...
Cancel
New
Replies
3 replies
Subscribers
127 subscribers
Views
1999 views
Users
0 members are here
Related
XN bit support on ARMv7 Cortex A15
Offline
taani E
over 7 years ago
Offline
taani E
over 7 years ago
Note: This was originally posted on 10th January 2013 at
http://forums.arm.com
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.c
Line: 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,
Cancel
Up
0
Down
Reply
Cancel
Offline
Peter Harris
over 7 years ago
Note: This was originally posted on 9th January 2013 at
http://forums.arm.com
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
Cancel
Up
0
Down
Reply
Cancel
Offline
Peter Harris
over 7 years ago
Note: This was originally posted on 11th June 2013 at
http://forums.arm.com
Realize this is an old post, but I hit it with a Google search, so I thought worth posting "probable cause".
I suspect your test case is incorrect. You mention you are pushing executable code onto the stack and sometimes getting a fault, and sometimes not.
ARMv7 does not include hardware memory coherency between I-cache and D-cache, so you are getting a cache coherency problem where you have written the code to the D cache, but the I cache is probably trying to execute the old data rather than your new code. What you are trying to do is invalid without manual cache operations to ensure I and D sides of the memory system see the same data values.
HTH,
Iso
Cancel
Up
0
Down
Reply
Cancel
More questions in this forum
By title
By date
By reply count
By view count
By most asked
By votes
By quality
Descending
Ascending
All recent questions
Unread questions
Questions you've participated in
Questions you've asked
Unanswered questions
Answered questions
Questions with suggested answers
Questions with no replies
Suggested Answer
Positioning a function in a Position Independent Executable for ARMV8
0
5720
views
3
replies
Latest
1 month ago
by
Stephen Theobald
Answered
Link a pure binary file to image with scatter file
0
5676
views
3
replies
Latest
1 month ago
by
Ronan Synnott
Answered
Failed to read contents of Internal RAM L1-I_DATA in ARM DS
0
Arm Development Studio
Cache
Debug and Trace Services Layer (DTSL)
9916
views
23
replies
Latest
1 month ago
by
Boon Khai
Suggested Answer
DS-5 connect fail when cortex-r5 is in lock-step mode
0
8271
views
10
replies
Latest
2 months ago
by
Stuart Hirons
Suggested Answer
On Cortex-M4F microcontrollers: is fixed point math faster or floating point?
0
7927
views
10
replies
Latest
2 months ago
by
Ronan Synnott
<
>
View all questions in Arm Development Studio forum