summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormjg <mjg@FreeBSD.org>2016-12-31 13:23:28 +0000
committermjg <mjg@FreeBSD.org>2016-12-31 13:23:28 +0000
commitf3626becbf8107ecc4188b9c807fa02b06527c46 (patch)
treee86ac079438060bda57423b36c2d2caa4c113256
parent861927d8f804e958ca0225577e0a647f2e675550 (diff)
downloadFreeBSD-src-f3626becbf8107ecc4188b9c807fa02b06527c46.zip
FreeBSD-src-f3626becbf8107ecc4188b9c807fa02b06527c46.tar.gz
MFC r303583:
amd64: implement pagezero using rep stos The current implementation uses non-temporal writes. This turns out to be detrimental to performance if the page is used shortly after, which is the typical case with page faults. Switch to rep stos.
-rw-r--r--sys/amd64/amd64/support.S13
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S
index bc23e90..c8b6253 100644
--- a/sys/amd64/amd64/support.S
+++ b/sys/amd64/amd64/support.S
@@ -65,17 +65,10 @@ END(bzero)
/* Address: %rdi */
ENTRY(pagezero)
PUSH_FRAME_POINTER
- movq $-PAGE_SIZE,%rdx
- subq %rdx,%rdi
+ movq $PAGE_SIZE/8,%rcx
xorl %eax,%eax
-1:
- movnti %rax,(%rdi,%rdx)
- movnti %rax,8(%rdi,%rdx)
- movnti %rax,16(%rdi,%rdx)
- movnti %rax,24(%rdi,%rdx)
- addq $32,%rdx
- jne 1b
- sfence
+ rep
+ stosq
POP_FRAME_POINTER
ret
END(pagezero)
OpenPOWER on IntegriCloud