Skip to content

enhance: add dcache invalid ops for aarch64#263

Open
liulog wants to merge 5 commits intosyswonder:devfrom
liulog:dev
Open

enhance: add dcache invalid ops for aarch64#263
liulog wants to merge 5 commits intosyswonder:devfrom
liulog:dev

Conversation

@liulog
Copy link
Contributor

@liulog liulog commented Mar 3, 2026

A flush operation for dcache and a TBLI operation for EL1 were added, and then Icache was cleaned up to ensure that there was no dirty data in the cache when the guest was first executed.

Related with syswonder/hvisor-tool#79 and #239

@liulog
Copy link
Contributor Author

liulog commented Mar 3, 2026

Test on RK3588 (switch rt-thread to 2,3,4 is okay) has been done.

Verification by others is required.

@ForeverYolo
Copy link
Contributor

A question: if Linux is booted, before executing the first line of Linux assembly, the Cache and MMU are in a disabled state, and the cleanup work is also done by Linux. What is the purpose of doing it this way? @liulog

@liulog
Copy link
Contributor Author

liulog commented Mar 9, 2026

A question: if Linux is booted, before executing the first line of Linux assembly, the Cache and MMU are in a disabled state, and the cleanup work is also done by Linux. What is the purpose of doing it this way? @liulog

The issue here concerns keeping the VM image in memory clean before it starts, allocating RAM, associated CPU cache, and TLB to the VM.

By default, the VM reads the image from memory early in the startup process. However, in special cases, the image may be in the root zone cpu's private cache. Additionally, if the cache and TLB are not clean, dirty data may accumulate in them during zone restarts, etc. When the VM has cache and MMU translation enabled, it may read previously uncleaned dirty data from the cache and TLB, causing errors.

This is just a precaution; it cannot be guaranteed that all operating systems will clear caches and TLB in the early stages of startup.

@liulog liulog closed this Mar 11, 2026
@liulog liulog changed the title enhance: add cache and tlb clear ops before vmlaunch enhance: add dcache invalid ops for aarch64 Mar 14, 2026
@liulog liulog reopened this Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants