Skip to content

Conversation

@kokas-a
Copy link

@kokas-a kokas-a commented Jun 22, 2022

In case if Zephyr is configured with CONFIG_XIP=n it linked into SRAM. So RAM region should have EXECUTE permission.

Fixes: #38880

abrodkin
abrodkin previously approved these changes Jun 22, 2022
@ruuddw
Copy link
Member

ruuddw commented Jun 22, 2022

From security point of view, I don't like enabling execute permissions for the full SRAM. How is this done for other QEMU targets? Can we have two SRAM regions, one for code and one for data?

@github-actions
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@kokas-a
Copy link
Author

kokas-a commented Sep 16, 2022

Hi colleagues,

I made changes in the follow way (divide SRAM into two parts) because of issue with linker script.
In non-XIP mode sections of "ramable_region" follows right after "romable_region" with no interval which is required to make correct alignment of "ramable_region".
On my assumption two solutions may looks more preferable:

  • Add ".fill" section with appropriate size at the end of "romable_region". This will set "romable_region" border to correct alignment.
  • Add "AT(address)" modifier to each section in "ramable_region".

Both of that solutions requires deep modification of the linker script which I tried to avoid.

Regards, Nikolay

@kokas-a kokas-a force-pushed the arc_qemu_xip_fix branch 3 times, most recently from 617542b to c823e52 Compare October 3, 2022 06:55
@evgeniy-paltsev evgeniy-paltsev marked this pull request as draft October 4, 2022 13:00
@kokas-a kokas-a force-pushed the arc_qemu_xip_fix branch 3 times, most recently from 7cd34cd to f2a8d09 Compare October 19, 2022 14:15
@kokas-a kokas-a marked this pull request as ready for review October 19, 2022 17:48
@kokas-a kokas-a marked this pull request as draft October 19, 2022 17:54
@kokas-a kokas-a marked this pull request as ready for review October 20, 2022 09:11
Copy link
Contributor

@evgeniy-paltsev evgeniy-paltsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kokas-a,

LGTM, few minor polishing requested.

I've tested this on qemu_arc_hs with XIP=n - all tests passing.

abrodkin
abrodkin previously approved these changes Oct 20, 2022
ruuddw
ruuddw previously approved these changes Oct 21, 2022
Add some changes to ARC linker script. They make correct alignment
for ROMable region. Now regions borders are aligned with respect
to MPU settings.

Signed-off-by: Nikolay Agishev <[email protected]>
@carlescufi carlescufi merged commit 0422a04 into zephyrproject-rtos:main Oct 21, 2022
@kokas-a kokas-a deleted the arc_qemu_xip_fix branch October 24, 2022 11:44
@abrodkin abrodkin added this to the v3.3.0 milestone Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ARC ARC Architecture platform: Synopsys Synopsys

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ARC: ARCv2: qemu_arc_em / qemu_arc_hs don't work with XIP disabled

6 participants