Skip to content

[libcpu/aarch64] fix cache invalidate operation #7363

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

Merged
merged 3 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/mm/mm_page.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ static void _install_page(rt_page_t mpr_head, rt_region_t region, void *insert_h
shadow.start = region.start & ~shadow_mask;
shadow.end = FLOOR(region.end, shadow_mask + 1);

if (shadow.end > UINT32_MAX)
if (shadow.end + PV_OFFSET > UINT32_MAX)
_high_page_configured = 1;

rt_page_t shad_head = addr_to_page(mpr_head, (void *)shadow.start);
Expand Down
8 changes: 6 additions & 2 deletions libcpu/aarch64/common/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ void rt_hw_cpu_dcache_invalidate(void *start_addr, unsigned long size);

static inline void rt_hw_icache_invalidate_all(void)
{
/* wait for any modification complete */
/* wait for previous modification to complete */
__asm__ volatile ("dsb ishst");
__asm__ volatile ("ic iallu");

__asm__ volatile ("ic ialluis");
/* wait for ic to retire */
__asm__ volatile ("dsb nsh");
/* flush instruction pipeline */
__asm__ volatile ("isb");
}

Expand Down