aboutsummaryrefslogtreecommitdiff
path: root/sys/cddl
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2019-03-21 02:52:22 +0000
committerMark Johnston <markj@FreeBSD.org>2019-03-21 02:52:22 +0000
commite362e590f90a1a3d03e9a78f6fe1b314d0a34402 (patch)
treec988557be2084e8a1a164b0a31bbe1a37f6f9c6d /sys/cddl
parent5ee81b26a8494eaa2424d861e2bfbd61b6799d3f (diff)
downloadsrc-e362e590f90a1a3d03e9a78f6fe1b314d0a34402.tar.gz
src-e362e590f90a1a3d03e9a78f6fe1b314d0a34402.zip
Don't attempt to measure TSC skew when running as a VM guest.
It simply doesn't work in general since VCPUs may migrate between physical cores. The approach used to measure skew also doesn't make much sense in a VM. PR: 218452 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=345359
Diffstat (limited to 'sys/cddl')
-rw-r--r--sys/cddl/dev/dtrace/amd64/dtrace_subr.c3
-rw-r--r--sys/cddl/dev/dtrace/i386/dtrace_subr.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
index e080bd66066e..d898319e80c6 100644
--- a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
@@ -319,6 +319,9 @@ dtrace_gethrtime_init(void *arg)
int i;
#endif
+ if (vm_guest)
+ return;
+
/* The current CPU is the reference one. */
sched_pin();
tsc_skew[curcpu] = 0;
diff --git a/sys/cddl/dev/dtrace/i386/dtrace_subr.c b/sys/cddl/dev/dtrace/i386/dtrace_subr.c
index 47dbd6aaf321..fe6ea19ddb15 100644
--- a/sys/cddl/dev/dtrace/i386/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/i386/dtrace_subr.c
@@ -321,6 +321,9 @@ dtrace_gethrtime_init(void *arg)
int i;
#endif
+ if (vm_guest)
+ return;
+
/* The current CPU is the reference one. */
sched_pin();
tsc_skew[curcpu] = 0;