Module Name: src
Committed By: christos
Date: Fri Feb 19 02:15:58 UTC 2021
Modified Files:
src/sys/arch/x86/x86: tsc.c
Log Message:
Penalize TSC on VirtualBox because it is not accurate enough.
To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/x86/x86/tsc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/x86/x86/tsc.c
diff -u src/sys/arch/x86/x86/tsc.c:1.53 src/sys/arch/x86/x86/tsc.c:1.54
--- src/sys/arch/x86/x86/tsc.c:1.53 Wed Feb 17 01:33:47 2021
+++ src/sys/arch/x86/x86/tsc.c Thu Feb 18 21:15:58 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: tsc.c,v 1.53 2021/02/17 06:33:47 rillig Exp $ */
+/* $NetBSD: tsc.c,v 1.54 2021/02/19 02:15:58 christos Exp $ */
/*-
* Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.53 2021/02/17 06:33:47 rillig Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.54 2021/02/19 02:15:58 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -224,6 +224,8 @@ tsc_tc_init(void)
invariant = false;
} else if (vm_guest == VM_GUEST_NO) {
delay_func = tsc_delay;
+ } else if (vm_guest == VM_GUEST_VIRTUALBOX) {
+ tsc_timecounter.tc_quality = -100;
}
if (tsc_freq != 0) {