Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760547AbYFDUGG (ORCPT ); Wed, 4 Jun 2008 16:06:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755540AbYFDUFx (ORCPT ); Wed, 4 Jun 2008 16:05:53 -0400 Received: from gw.goop.org ([64.81.55.164]:49733 "EHLO mail.goop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754159AbYFDUFv (ORCPT ); Wed, 4 Jun 2008 16:05:51 -0400 Message-ID: <4846F577.10603@goop.org> Date: Wed, 04 Jun 2008 21:05:11 +0100 From: Jeremy Fitzhardinge User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: Jeff Dike CC: Andrew Morton , Nix , dhazelton@enter.net, linux-kernel@vger.kernel.org, user-mode-linux-devel@lists.sourceforge.net Subject: Re: [PATCH 1/6] UML - Deal with host time going backwards References: <20080603190235.GA9511@c2.user-mode-linux.org> <20080603123211.e129c222.akpm@linux-foundation.org> <200806031543.56864.dhazelton@enter.net> <878wxmfg99.fsf@hades.wkstn.nix> <20080603130709.fcf6a751.akpm@linux-foundation.org> <20080603210048.GA12182@c2.user-mode-linux.org> <4846A75E.40305@goop.org> <20080604193715.GA11943@c2.user-mode-linux.org> In-Reply-To: <20080604193715.GA11943@c2.user-mode-linux.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 877 Lines: 22 Jeff Dike wrote: > On Wed, Jun 04, 2008 at 03:31:58PM +0100, Jeremy Fitzhardinge wrote: > >> Shouldn't UML use a monotonic host clock for guest timekeeping? >> > > Indeed, Eric pointed out the posix timers, which I had forgotten > about. On the face of it, a monotonic timer should do the trick, but > it's not obvious how to get it to behave like a monotonic > gettimeofday... You can either read the monotonic clock directly, or use it as a time source for a monotonic timer. clock_gettime(CLOCK_MONOTONIC, &ts) will return the time in ns, and you can just feed that directly into the guest as a clocksource. J -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/