arch/arm64/imx9: give the ELE a physical address and the cache a virtual one - #20196
Merged
Merged
Conversation
royzah
force-pushed
the
imx9-ele-va
branch
2 times, most recently
from
September 20, 2026 13:44
7da388a to
7d7827c
Compare
…ual one. The ELE addresses memory physically; cache maintenance takes a virtual address. Both buffer calls supply one and use it for both, in opposite directions: get_random() runs up_flush_dcache() on a physical address, get_key() hands the enclave a virtual one. Both fail silently, and both are correct only while the two are equal. Take the virtual address in both, maintain the cache on it, and translate for the message. get_random() also gains the alignment check get_key() already has. Signed-off-by: Royyan Zahir <royzah@gmail.com>
Contributor
Author
|
Run on hardware alongside #20191: i.MX93 Cortex-A55, PX4 kernel build, NuttX 12.11.0. Note this depends on #20192: |
royzah
marked this pull request as ready for review
September 23, 2026 12:31
Contributor
Author
|
@acassis @xiaoxiang781216 this one is out of draft too, it is the small ELE address fix that #20191 needs. Hardware log is in the comment above. No rush, just flagging it is ready. |
xiaoxiang781216
approved these changes
Sep 23, 2026
acassis
approved these changes
Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The ELE addresses memory physically. Cache maintenance takes a virtual address. Each buffer call supplies one and uses it for both, in opposite directions.
imx9_ele_get_random()imx9_ele_get_key()up_flush_dcache()andup_invalidate_dcache()document their arguments as virtual. Soimx9_ele_get_random()maintains whatever lines its physical values happen to name, and a caller reads back what its own line still holds rather than what the ELE wrote, with nothing reported.Correct only while the two addresses are equal. True of every config in tree today; not true of a kernel build with address environments.
How
Both take the virtual address, maintain the cache on it, and translate for the message.
imx9_ele_get_random()gains the cache line checkimx9_ele_get_key()already has, because a line shared with live data can be written back over the transfer.imx9_ele_get_random()changes prototype. Neither function has an in-tree caller.Depends on
#20192
Tested
Compiles for
imx93-evk:nsh.tools/nxstylereports only the two diagnostics already on master, neither in changed lines.