summaryrefslogtreecommitdiffstats
path: root/sys/amd64/vmm
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-03-30 07:11:49 +0000
committermav <mav@FreeBSD.org>2015-03-30 07:11:49 +0000
commit3e11976044f532ef483da0eb314ce7957b524c5f (patch)
tree401706755b4e541d3706c33ec9c794f3b4be812a /sys/amd64/vmm
parent1d0629a91fc375755679aae4979d143430e2aff6 (diff)
downloadFreeBSD-src-3e11976044f532ef483da0eb314ce7957b524c5f.zip
FreeBSD-src-3e11976044f532ef483da0eb314ce7957b524c5f.tar.gz
MFC r280134:
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.
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