Skip to content

Commit

Permalink
Merge pull request #532 from lz-bro/mb_translate
Browse files Browse the repository at this point in the history
Add virtual memory synchronization after completing the page tables
  • Loading branch information
aswaterman authored Feb 29, 2024
2 parents 9c3d66b + 9e18388 commit 634f172
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 634f172

Please sign in to comment.