Skip to content

Commit

Permalink
comment the sfences
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Morris committed Aug 24, 2022
1 parent 581bc4c commit ed101be
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion kernel/trampoline.S
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,18 @@ uservec:
# load the address of usertrap(), from p->trapframe->kernel_trap
ld t0, 16(a0)

# load the kernel page table, from p->trapframe->kernel_satp

# fetch the kernel page table address, from p->trapframe->kernel_satp.
ld t1, 0(a0)

# wait for any previous memory operations to complete, so that
# they use the user page table.
sfence.vma zero, zero

# install the kernel page table.
csrw satp, t1

# flush now-stale user entries from the TLB.
sfence.vma zero, zero

# jump to usertrap(), which does not return
Expand Down

0 comments on commit ed101be

Please sign in to comment.