-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arm64 alignment issue #167
Comments
cc @carlocaione |
@ehudmarvell which branch are you using? how are you testing this? what are you compiling? how? I guess we need some more info about this. |
Hi, I download the SDK from "https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.11.0-alpha-7" zephyr-toolchain-arm64-0.11.0-alpha-7-setup.run On zepher, I am rebase to this commit:( + our changes to ARM64 support which still not publish) I testing that on our cortex A55 chip, I am compiling with: I success to run without newlib, but with newlib I have this problem. Thanks, |
@ehudmarvell are you aware that there is an ongoing effort to upstream ARM64 support at zephyrproject-rtos/zephyr#20263? Which code/test are you compiling? Just to have a way to reproduce your issue. Is this reproducible when rebasing on the current master? |
@carlocaione I am familiar with zephyrproject-rtos/zephyr#20263, Is this reproducible when rebasing on the current master? We Didn't try, currently it demand us a lot of effort. So I am consult you maybe you have an idea. |
@ehudmarvell For now, ensure that As for triage, I will investigate what other releases are doing tomorrow and make changes if necessary. |
on top of what @stephanosio suggested try also to set |
zephyr-sdk-0.11.0-alpha-7
zephyr-sdk-0.11.0-alpha-8
|
I noticed that |
@ehudmarvell Are you able to confirm if this issue can be fixed by setting The only condition for |
Hi, |
@ehudmarvell AFAICT, based on the pseudocodes, you should not be getting alignment faults with SCTLR.A and SCTLR.SA set to 0, unless the memory region you are trying to access is defined as something other than "normal." From ARM docs:
Maybe MMU is enabled in your arch port and the page tables are configured incorrectly (e.g. 'strongly ordered' attribute is set). |
@stephanosio the mmu is disabled, I will investigate why we are getting this exception |
@stephanosio currently it seem that I have architecture limitation on alignment. Thank you very much |
Apparently, with the MMU disabled, all data accesses are treated as if they were to a Device-nGnRnE memory type (strongly ordered-equivalent), meaning an unaligned access will result in an alignment fault[1].
It seems we did not catch this in zephyrproject-rtos/zephyr#20263 because QEMU does not emulate the alignment fault[2]:
This means that we need to do either of the following:
The second approach may not be feasible and/or desirable for the following reasons:
[1] https://armv8-ref.codingbelief.com/en/chapter_d4/d42_8_the_effects_of_disabling_a_stage_of_address_translation.html#all-other-accesses |
@ stephanosio Thank you for you answer Compiling it with -mno-unaligned-access won't solve the newlib problem, because this code already compiled( I already using -mno-unaligned-access). |
@ehudmarvell The Have a look at the following; Broadcom has already implemented MMU support on top of the @carlocaione's AArch64 port: |
@stephanosio, |
That is, of course, unless your entire RAM is "strongly ordered," but I see that to be very unlikely. |
@stephanosio I updating that the problem solved after using broadcom MMU code. |
Hi,
I am using 0.11.0-alpha-7 version (not the last one due to fp enablement)
Compiling to ARM64 cortex-a55 core.
And I got an alignment issue :
on the last line
sturh w0, [sp, #153]
I am getting alignment exception due to 153 offsetCan you suggest why?
Thanks,
Ehud
The text was updated successfully, but these errors were encountered: