Repository navigation
Conversation
The calculation of 'remaining_ram' ended up overflowing if the configuration did not allow for enough space for vpage region. Catch this case and disable vpage safely. Also add a separate check to ensure vpage is not allocated beyond physical memory. This is a temporary limitation as Zephyr TLB driver only maps the cached alias when a page is mapped at runtime, and this leads to faults when vpage is used via a coherent alias (leading to e.g. "EXCCAUSE 29 (store prohibited)"). Co-developed-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
kv2019i
requested review from
abonislawski,
dbaluta,
iuliana-prodan and
lyakh
as code owners
October 20, 2026 11:11
Collaborator
Author
|
FYI @lgirdwood @harajend This PR is a subset/alternative to #11303 . Tested on target hardware and passes the test. Additionally, with #11322 vpage can be enabled again on this target. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The fallback can discard an in-L2 library reservation and register overlapping vpage memory.
1 open issue
What changed in this PR
Adds configuration checks to Zephyr’s vpage allocator to prevent size underflow and keep mappings within physical L2 memory.
Changes:
- Reject allocation and free operations when no vpage region exists.
- Validate available space before registering the region.
| File | Description |
|---|---|
| zephyr/lib/vpage.c | Adds region-availability guards and initialization bounds checks. |
Review effort: Balanced
| * physical L2 size for now until support is added to | ||
| * Zephyr mm_drv_intel_adsp_mtl_tlb.c and friends | ||
| */ | ||
| end = l2_end; |
kv2019i
commented
Oct 20, 2026
| /* | ||
| * TODO: on demand mapping currently only supports | ||
| * cached mappings, so we need to limit vpages to | ||
| * physical L2 size for now until support is added to |
Collaborator
Author
There was a problem hiding this comment.
Related Zephyr PR to address this limitation zephyrproject-rtos/zephyr#122801
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.

The calculation of 'remaining_ram' ended up overflowing if the configuration did not allow for enough space for vpage region. Catch this case and disable vpage safely.
Also add a separate check to ensure vpage is not allocated beyond physical memory. This is a temporary limitation as Zephyr TLB driver only maps the cached alias when a page is mapped at runtime, and this leads to faults when vpage is used via a coherent alias (leading to e.g. "EXCCAUSE 29 (store prohibited)").
Co-developed-by: Liam Girdwood liam.r.girdwood@linux.intel.com