-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
[RFC] Cache API rework #50988
[RFC] Cache API rework #50988
Conversation
ff39b71
to
30a9b78
Compare
30a9b78
to
b8f7001
Compare
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
749b841
to
9faa76b
Compare
6adefaa
to
3be93d6
Compare
9f9c826
to
2c1226f
Compare
Why DNM? |
At least zephyrproject-rtos/libmetal#17 needs to go in first. |
The cache operations must be quick, optimized and possibly inlined. The current API is clunky, functions are not inlined and passing parameters around that are basically always known at compile time. In this patch we rework the cache functions to allow us to get rid of useless parameters and make inlining easier. In particular this changeset is doing three things: 1. `CONFIG_HAS_ARCH_CACHE` is now `CONFIG_ARCH_CACHE` and `CONFIG_HAS_EXTERNAL_CACHE` is now `CONFIG_EXTERNAL_CACHE` 2. The cache API has been reworked. 3. Comments are added. Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This is useful to prove that the implementation of the API is done correctly. Signed-off-by: Carlo Caione <ccaione@baylibre.com>
And use the new API. Signed-off-by: Carlo Caione <ccaione@baylibre.com>
And use the new API. Signed-off-by: Carlo Caione <ccaione@baylibre.com>
And use the new API. Signed-off-by: Carlo Caione <ccaione@baylibre.com>
To be compliant to the new cache API. Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Fix the usage to be compliant to the new cache API. Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Make libmetal using the new zephyr cache APIs. Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Bump the openamp version to v2022.10.0 Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2c1226f
to
b0c4537
Compare
Just curious: Why was the openamp version updated as part of this PR (from 1258d35)? |
It was requested by the OpenAMP maintainer. See #50988 (review) |
@@ -804,7 +804,7 @@ static void enable_mmu_el1(struct arm_mmu_ptables *ptables, unsigned int flags) | |||
isb(); | |||
|
|||
/* Invalidate all data caches before enable them */ | |||
sys_cache_data_all(K_CACHE_INVD); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to note that we are affected by this change while working on internal firmware upgrade from v2.x, hopefully we are the only out-of-tree user..
This is the outcome of the discussion in #50747 and #50136.
The cache API is now composed by:
cache_{data,instr}_enable()
cache_{data,instr}_disable()
cache_{data,instr}_line_size_get()
cache_{data,instr}_flush_all()
cache_{data,instr}_flush_range(addr, size)
cache_{data,instr}_invd_all()
cache_{data,instr}_invd_range(addr, size)
cache_{data,instr}_flush_and_invd_all(addr, size)
cache_{data,instr}_flush_and_invd_range(addr, size)
And functions can now be inlined (see ARM64 implementation).
This is still an RFC.
IMPORTANT
Before this PR is considered to me merge-able we need to address two issues: