Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Mar 2015 11:57:04 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r280134 - head/sys/amd64/vmm
Message-ID:  <201503161157.t2GBv4YJ069380@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Mar 16 11:57:03 2015
New Revision: 280134
URL: https://svnweb.freebsd.org/changeset/base/280134

Log:
  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

Modified:
  head/sys/amd64/vmm/x86.c

Modified: head/sys/amd64/vmm/x86.c
==============================================================================
--- head/sys/amd64/vmm/x86.c	Mon Mar 16 09:15:59 2015	(r280133)
+++ head/sys/amd64/vmm/x86.c	Mon Mar 16 11:57:03 2015	(r280134)
@@ -361,6 +361,12 @@ x86_emulate_cpuid(struct vm *vm, int vcp
 			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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503161157.t2GBv4YJ069380>