[feat] Add hypervisor support for aarch64#10
Conversation
|
It is a duplicate of #7 which was nearly approved the review, but for some reason it got closed. |
Yes, that person is busy now, so I take over this part of the work. |
equation314
left a comment
There was a problem hiding this comment.
Please refer to the review comments of #7.
…shifting right 12 bits, and the unnecessary Inner Shareable suffix is deleted.
Modification has been completed,and I wonder if it is necessary to remove the inner shared suffix in the assembly code section on line 146 |
src/aarch64/asm.rs
Outdated
| asm!("tlbi vaae1is, {}; dsb sy; isb", in(reg) vaddr.as_usize()) | ||
| #[cfg(not(feature = "arm-el2"))] | ||
| { | ||
| asm!("tlbi vaae1is, {}; dsb sy; isb", in(reg) vaddr.vaddr >> 12) |
There was a problem hiding this comment.
The operand should be bits 12..55 of virtual address, see the official doccument and arceos-org/page_table_multiarch#21.
The inner share suffix means broadcast to all cores in the same shared domain. When we flush the TlB by address, it is often the case that one core modifies the page table mapping, which needs to take effect on other cores as well, so there is an When we flush all tlb entries, it is often during the initialization phase, when all cores will execute this operation to flush their own local TLBs, so there is no need for the Linux also use use |
270e1e1 to
1b0f2d7
Compare
Thank you very much. I ignored the processing of high bits before. I also learned the specific mechanism of refreshing specific addresses and refreshing the entire page table in multi-core situations. Here I want to confirm whether my understanding is correct: when we modify the mapping of a specific address, this operation will affect the TLB of all cores in the shared domain, but when the full TLB is refreshed, each core executes it independently, so there is no need to broadcast this instruction to other cores in the inner shared domain, right? |
Yep |
src/aarch64/asm.rs
Outdated
| /// If `vaddr` is [`None`], flushes the entire TLB. Otherwise, flushes the TLB | ||
| /// entry that maps the given virtual address. | ||
| /// | ||
| /// Moreover, The reason for shifting vaddr right by 12 bits here is to clear |
There was a problem hiding this comment.
Remove meaningless comments
There was a problem hiding this comment.
Thanks, useless comments have been removed
Co-authored-by: 朝倉水希 <asakuramizu111@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
update aarch64 hv part