Skip to content

Commit

Permalink
Add virtual memory synchronization after completing the page tables
Browse files Browse the repository at this point in the history
Signed-off-by: liangzhen <[email protected]>
Change-Id: Ida1490338d204541c5c7f143aec3b8d79d83d7f4
  • Loading branch information
lz-bro committed Feb 2, 2024
1 parent 67e7759 commit 9e18388
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions debug/programs/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ int main()
virtual = (uint32_t *) (
(reg_t) virtual | ~(((reg_t) 1 << vms->vaddr_bits) - 1));
add_entry(master_table, 0, (reg_t) virtual, (reg_t) physical);
__asm__ __volatile__ ("sfence.vma" ::: "memory"); // Virtual memory synchronization

unsigned long satp = set_field(0, SATP_MODE, vms->mode);
satp = set_field(satp, SATP_PPN, ((unsigned long) master_table) >> 12);
Expand Down

0 comments on commit 9e18388

Please sign in to comment.