[lkml]   [2019]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC PATCH v3 4/6] psci: Add hvc call service for ptp_kvm.
On 18/09/19 10:07, Jianyong Wu wrote:
> + getnstimeofday(ts);

This is not Y2038-safe. Please use ktime_get_real_ts64 instead, and
split the 64-bit seconds value between val[0] and val[1].

However, it seems to me that the new function is not needed and you can
just use ktime_get_snapshot. You'll get the time in
systime_snapshot->real and the cycles value in systime_snapshot->cycles.

> + get_current_counterval(&sc);
> + val[0] = ts->tv_sec;
> + val[1] = ts->tv_nsec;
> + val[2] = sc.cycles;
> + val[3] = 0;
> + break;

This should return a guest-cycles value. If the cycles values always
the same between the host and the guest on ARM, then okay. If not, you
have to apply whatever offset exists.



 \ /
  Last update: 2019-09-18 10:26    [W:0.089 / U:14.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site