Infinite loop in the implementation for arm64 mmu discard_table #55437
Answered
by
npitre
Dat-NguyenDuy
asked this question in
Q&A
Replies: 4 comments 2 replies
-
Tagging arm64 arch maintainer @carlocaione |
Beta Was this translation helpful? Give feedback.
0 replies
-
@Dat-NguyenDuy what are you trying to do? That source code looks really weird. Why are you trying to map twice the same phys with hardcoded values? |
Beta Was this translation helpful? Give feedback.
1 reply
-
@npitre can you take a look at this? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Somebody must have been on drugs _twice_ for sure. Fixed in PR #55500.
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
carlocaione
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Currently, there is an infinite loop in the implementation for arm64 mmu discard_table: https://github.com/zephyrproject-rtos/zephyr/blob/main/arch/arm64/core/mmu.c#L440. Look like this is an intended behavior under normal circumstances
as mentioned in #46617.
I'm having a big trouble with this infinite loop. Indeed, i'm running Zephyr on cortex-A53 on a SoC that haven't been upstreamed,
there is one of my case reach to this (discard_table) function and never get out (because of the infinite loop) until an exception is raised.
The issue can be reproduced with
qemu_cortex_a53
board:Zephyr version: a2541d6 (https://github.com/zephyrproject-rtos/zephyr/commits/a2541d6c82437b02fb26db5e8dd1928e5fd0b1d5)
source code in main.c:
Below are two things that i'm concerning about:
If the infinite loop in discard_table isn't intended behavior, this function must be updated to break out the loop after the whole table (512 entries) is discarded. Mostly add the i < Ln_XLAT_NUM_ENTRIES will work
If the infinite loop in discard_table is an intended behavior and this function should not be reached under normal circumstances. I think there would be a bug somewhere in current implementation for arm64 mmu.
Please let me know if more information need to be provided, thank you!
Beta Was this translation helpful? Give feedback.
All reactions