arch64/mmu: invalidate all icaches in InactivePageTable::with()

master
equation314 6 years ago
parent 0eb33b661f
commit d6a54496f0

@ -105,6 +105,18 @@ pub fn tlb_invalidate(vaddr: VirtAddr) {
}
}
/// Invalidate all instruction caches in Inner Shareable domain to Point of Unification.
#[inline(always)]
pub fn flush_icache_all() {
unsafe {
asm!(
"ic ialluis
dsb ish
isb"
);
}
}
/// Address Translate.
#[inline(always)]
pub fn address_translate(vaddr: usize) -> usize {

@ -5,7 +5,7 @@ use memory::{active_table, alloc_frame, alloc_stack, dealloc_frame};
use ucore_memory::memory_set::*;
use ucore_memory::PAGE_SIZE;
use ucore_memory::paging::*;
use aarch64::asm::{tlb_invalidate, tlb_invalidate_all, ttbr_el1_read, ttbr_el1_write};
use aarch64::asm::{tlb_invalidate, tlb_invalidate_all, flush_icache_all, ttbr_el1_read, ttbr_el1_write};
use aarch64::{PhysAddr, VirtAddr};
use aarch64::paging::{Mapper, PageTable as Aarch64PageTable, PageTableEntry, PageTableFlags as EF, RecursivePageTable};
use aarch64::paging::{FrameAllocator, FrameDeallocator, Page, PhysFrame as Frame, Size4KiB, Size2MiB, Size1GiB};
@ -246,6 +246,7 @@ impl InactivePageTable for InactivePageTable0 {
if old_frame != new_frame {
ttbr_el1_write(1, old_frame);
tlb_invalidate_all();
flush_icache_all();
}
}

Loading…
Cancel
Save