lkml.org 
[lkml]   [2015]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 7/7] xen/arm: set the system time in Xen via the XENPF_settime64 hypercall
Date
On Tuesday 10 November 2015 11:57:55 Stefano Stabellini wrote:
> + op.u.settime64.nsecs = now.tv_nsec;
> + op.u.settime64.system_time = arch_timer_read_counter() * (u64)NSEC_PER_SEC;
> + do_div(op.u.settime64.system_time, arch_timer_get_rate());

NSEC_PER_SEC is a large number, doesn't that multiplication overflow the
64-bit system_time variable?

> + printk("GTOD: Setting to %llu.%u at %llu\n",

%llu.%09u

so you get the leading zeroes.

> + op.u.settime64.secs,
> + op.u.settime64.nsecs,
> + op.u.settime64.system_time);
> + (void)HYPERVISOR_platform_op(&op);

Arnd


\
 
 \ /
  Last update: 2015-11-10 14:01    [W:0.427 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site