Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amd64/amd64 Deal with KMSAN fussiness. Pointed out...
details: https://anonhg.NetBSD.org/src/rev/3bc10df785f4
branches: trunk
changeset: 972233:3bc10df785f4
user: ad <ad%NetBSD.org@localhost>
date: Wed May 20 18:39:25 2020 +0000
description:
Deal with KMSAN fussiness. Pointed out by msaitoh@.
diffstat:
sys/arch/amd64/amd64/cpufunc.S | 27 ++++++++++++++++++++-------
1 files changed, 20 insertions(+), 7 deletions(-)
diffs (51 lines):
diff -r 3e4798288705 -r 3bc10df785f4 sys/arch/amd64/amd64/cpufunc.S
--- a/sys/arch/amd64/amd64/cpufunc.S Wed May 20 18:37:50 2020 +0000
+++ b/sys/arch/amd64/amd64/cpufunc.S Wed May 20 18:39:25 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpufunc.S,v 1.54 2020/05/19 21:54:10 ad Exp $ */
+/* $NetBSD: cpufunc.S,v 1.55 2020/05/20 18:39:25 ad Exp $ */
/*
* Copyright (c) 1998, 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -206,7 +206,23 @@
END(x86_hotpatch)
#endif /* !XENPV */
-ENTRY(tsc_get_timecount)
+/* Could be exact same as cpu_counter but for KASAN fussiness. */
+ENTRY(cpu_counter32)
+ movq CPUVAR(CURLWP), %rcx
+1:
+ movq L_NCSW(%rcx), %rdi
+ rdtsc
+ addl CPUVAR(CC_SKEW), %eax
+ cmpq %rdi, L_NCSW(%rcx)
+ jne 2f
+ KMSAN_INIT_RET(4)
+ ret
+2:
+ jmp 1b
+END(cpu_counter32)
+STRONG_ALIAS(tsc_get_timecount, cpu_counter32)
+
+ENTRY(cpu_counter)
movq CPUVAR(CURLWP), %rcx
1:
movq L_NCSW(%rcx), %rdi
@@ -216,14 +232,11 @@
addq CPUVAR(CC_SKEW), %rax
cmpq %rdi, L_NCSW(%rcx)
jne 2f
- KMSAN_INIT_RET(4)
+ KMSAN_INIT_RET(8)
ret
2:
jmp 1b
-END(tsc_get_timecount)
-
-STRONG_ALIAS(cpu_counter, tsc_get_timecount)
-STRONG_ALIAS(cpu_counter32, tsc_get_timecount)
+END(cpu_counter)
ENTRY(rdmsr_safe)
movq CPUVAR(CURLWP), %r8
Home |
Main Index |
Thread Index |
Old Index