svn commit: r264825 - head/sys/amd64/vmm/io
Neel Natu
neel at FreeBSD.org
Wed Apr 23 16:50:41 UTC 2014
Author: neel
Date: Wed Apr 23 16:50:40 2014
New Revision: 264825
URL: http://svnweb.freebsd.org/changeset/base/264825
Log:
Change the vlapic timer frequency to be in the ballpark of contemporary
hardware. This also decouples the vlapic emulation from the host's TSC
frequency.
Requested by: grehan@
Modified:
head/sys/amd64/vmm/io/vlapic.c
Modified: head/sys/amd64/vmm/io/vlapic.c
==============================================================================
--- head/sys/amd64/vmm/io/vlapic.c Wed Apr 23 15:18:40 2014 (r264824)
+++ head/sys/amd64/vmm/io/vlapic.c Wed Apr 23 16:50:40 2014 (r264825)
@@ -70,7 +70,12 @@ __FBSDID("$FreeBSD$");
#define VLAPIC_TIMER_UNLOCK(vlapic) mtx_unlock_spin(&((vlapic)->timer_mtx))
#define VLAPIC_TIMER_LOCKED(vlapic) mtx_owned(&((vlapic)->timer_mtx))
-#define VLAPIC_BUS_FREQ tsc_freq
+/*
+ * APIC timer frequency:
+ * - arbitrary but chosen to be in the ballpark of contemporary hardware.
+ * - power-of-two to avoid loss of precision when converted to a bintime.
+ */
+#define VLAPIC_BUS_FREQ (128 * 1024 * 1024)
static __inline uint32_t
vlapic_get_id(struct vlapic *vlapic)
More information about the svn-src-head
mailing list