mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:07:36 +00:00
Kernel/aarch64: Flush entire TLB cache when changing TTBR0_EL1
Setting the page table base register (ttbr0_el1) is not enough, and will not flush the TLB caches, in contrary with x86_64 where setting the CR3 register will actually flush the caches. This commit adds the necessary code to properly flush the TLB caches when context switching. This commit also changes Processor::flush_tlb_local to use the vmalle1 variant, as previously we would be flushing the tlb's of all the cores in the inner-shareable domain.
This commit is contained in:
parent
188a52db01
commit
6a8581855d
3 changed files with 16 additions and 2 deletions
|
@ -49,12 +49,14 @@ LockRefPtr<PageDirectory> PageDirectory::find_current()
|
|||
void activate_kernel_page_directory(PageDirectory const& page_directory)
|
||||
{
|
||||
Aarch64::Asm::set_ttbr0_el1(page_directory.ttbr0());
|
||||
Processor::flush_entire_tlb_local();
|
||||
}
|
||||
|
||||
void activate_page_directory(PageDirectory const& page_directory, Thread* current_thread)
|
||||
{
|
||||
current_thread->regs().ttbr0_el1 = page_directory.ttbr0();
|
||||
Aarch64::Asm::set_ttbr0_el1(page_directory.ttbr0());
|
||||
Processor::flush_entire_tlb_local();
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT NonnullLockRefPtr<PageDirectory> PageDirectory::must_create_kernel_page_directory()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue