Skip to content

Commit bad9838

Browse files
committed
x86_64: save memory access in context switch
1 parent 1e6361c commit bad9838

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/platform/x86_64/sched/switch.asm

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ platformLoadContext:
4747

4848
; save performance by only invalidating TLB if the context actually changed
4949
mov rax, cr3
50-
cmp rax, [rdi+512] ; pml4
50+
mov rbx, [rdi+512] ; pml4
51+
cmp rax, rbx
5152
jz .continue
5253

53-
mov rax, [rdi+512]
54-
mov cr3, rax
54+
mov cr3, rbx
5555

5656
.continue:
5757
mov rax, [rdi+672] ; stack segment

0 commit comments

Comments
 (0)