From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0Bbb-0005tH-Em for qemu-devel@nongnu.org; Mon, 17 Apr 2017 14:42:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0Bba-0004BJ-BA for qemu-devel@nongnu.org; Mon, 17 Apr 2017 14:42:31 -0400 Received: from mail-wr0-x230.google.com ([2a00:1450:400c:c0c::230]:35576) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0Bba-0004AQ-4j for qemu-devel@nongnu.org; Mon, 17 Apr 2017 14:42:30 -0400 Received: by mail-wr0-x230.google.com with SMTP id o21so88121901wrb.2 for ; Mon, 17 Apr 2017 11:42:29 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20170415192930.1443-1-bobby.prani@gmail.com> References: <20170415192930.1443-1-bobby.prani@gmail.com> From: Peter Maydell Date: Mon, 17 Apr 2017 19:42:08 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] timer.h: Provide monotonic time for ARM guests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pranith Kumar Cc: Paolo Bonzini , Cao jin , Michael Tokarev , =?UTF-8?B?QWxleCBCZW5uw6ll?= , "Edgar E. Iglesias" , "open list:All patches CC here" On 15 April 2017 at 20:29, Pranith Kumar wrote: > Tested and confirmed that the stretch i386 debian qcow2 image on a > raspberry pi 2 works. > > Fixes: LP#: 893208 > Signed-off-by: Pranith Kumar > --- > include/qemu/timer.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/include/qemu/timer.h b/include/qemu/timer.h > index e1742f2f3d..14c9558da4 100644 > --- a/include/qemu/timer.h > +++ b/include/qemu/timer.h > @@ -1015,6 +1015,16 @@ static inline int64_t cpu_get_host_ticks(void) > return cur - ofs; > } > > +#elif defined(__arm__) || defined(__aarch64__) > + > +/* ARM does not have a user-space readble cycle counter available. > + * This is a compromise to get monotonically increasing time. > + */ > +static inline int64_t cpu_get_host_ticks(void) > +{ > + return get_clock(); > +} This doesn't look like it should be ARM-specific. Is it better than the current default implementation? If so, why not make this the default implementation? > + > #else > /* The host CPU doesn't have an easily accessible cycle counter. > Just return a monotonically increasing value. This will be > -- > 2.11.0 The comment here says that our default is already a monotonically increasing implementation -- is it wrong, or is there some other advantage of your version? thanks -- PMM