summaryrefslogtreecommitdiffstats
path: root/sys/amd64/vmm
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-03-16 11:57:03 +0000
committermav <mav@FreeBSD.org>2015-03-16 11:57:03 +0000
commitaf4c17529a2985f963af921ce650b32ab516d452 (patch)
tree12fbe148d3c71abf68e022ef2678194aa221427d /sys/amd64/vmm
parentcfdd687fd71a37a2a9e69bd47ef91b7aac3c5074 (diff)
downloadFreeBSD-src-af4c17529a2985f963af921ce650b32ab516d452.zip
FreeBSD-src-af4c17529a2985f963af921ce650b32ab516d452.tar.gz
Report ARAT (APIC-Timer-always-running) feature for virtual CPU.
This makes FreeBSD guest to not avoid using LAPIC timer, preferring HPET due to worries about non-existing for virtual CPUs deep sleep states. Benchmarks of usleep(1) on guest and host show such extra latencies: - 51us for virtual HPET, - 22us for virtual LAPIC timer, - 22us for host HPET and - 3us for host LAPIC timer. MFC after: 2 weeks
Diffstat (limited to 'sys/amd64/vmm')
-rw-r--r--sys/amd64/vmm/x86.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/amd64/vmm/x86.c b/sys/amd64/vmm/x86.c
index c0c3e9c..c37d21c 100644
--- a/sys/amd64/vmm/x86.c
+++ b/sys/amd64/vmm/x86.c
@@ -361,6 +361,12 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
break;
case CPUID_0000_0006:
+ regs[0] = CPUTPM1_ARAT;
+ regs[1] = 0;
+ regs[2] = 0;
+ regs[3] = 0;
+ break;
+
case CPUID_0000_000A:
/*
* Handle the access, but report 0 for
OpenPOWER on IntegriCloud