From owner-freebsd-virtualization@FreeBSD.ORG Wed Jan 15 13:08:12 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CBFED3D for ; Wed, 15 Jan 2014 13:08:12 +0000 (UTC) Received: from SMTP.CITRIX.COM (smtp.citrix.com [66.165.176.89]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 975DE11DC for ; Wed, 15 Jan 2014 13:08:10 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.95,663,1384300800"; d="scan'208";a="93066476" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 15 Jan 2014 13:08:02 +0000 Received: from [IPv6:::1] (10.80.16.47) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.2.342.4; Wed, 15 Jan 2014 08:08:02 -0500 Message-ID: <52D68831.2000503@citrix.com> Date: Wed, 15 Jan 2014 14:08:01 +0100 From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Julian Stecklina , Subject: Re: KVM Clock References: <52D5623C.7060401@freebsd.org> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-DLP: MIA2 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jan 2014 13:08:12 -0000 On 15/01/14 13:05, Julian Stecklina wrote: > On 01/14/2014 05:13 PM, Peter Grehan wrote: >> Hi Julian, >> >>> is anyone working on KVM clock support for FreeBSD? If not, I >>> might take a shot at it. >> >> None I know of: go for it :) > > Works for me so far: > https://github.com/blitz/freebsd/commit/cdc5f872b3e48cc0dda031fc7d6bdedc65c3148f Looking > at the code it seems some common routines could be shared between the KVM PV clock and the Xen PV clock (sys/dev/xen/timer/timer.c). The data passed from the hypervisor to the guest has exactly the same format (see struct vcpu_time_info in Xen public headers). At a first sight the KVM clock can benefit from using scale_delta (which is going to be faster than the C version implemented in kvmclock_get_timecount), and xen_fetch_vcpu_tinfo is exactly the same as kvmclock_fetch. Roger.