summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authormjg <mjg@FreeBSD.org>2016-08-11 09:30:25 +0000
committermjg <mjg@FreeBSD.org>2016-08-11 09:30:25 +0000
commit81d25dd54fcac16c33b36e2ebe8e82c2a70c5986 (patch)
tree60a99d20322e91de6254a84ff3efd56e9e6e368a /sys/amd64
parentf6eab3bb444ed8b47aa811577447abfcd80c5a8b (diff)
downloadFreeBSD-src-81d25dd54fcac16c33b36e2ebe8e82c2a70c5986.zip
FreeBSD-src-81d25dd54fcac16c33b36e2ebe8e82c2a70c5986.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. Approved by: re (gjb)
Diffstat (limited to 'sys/amd64')
-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 dc94891..e7af5d7 100644
--- a/sys/amd64/amd64/support.S
+++ b/sys/amd64/amd64/support.S
@@ -64,17 +64,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