Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation.

From: Christophe Leroy
Date: Fri Dec 20 2019 - 13:24:26 EST


Hi Thomas,

In do_hres(), I see:

cycles = __arch_get_hw_counter(vd->clock_mode);
ns = vdso_ts->nsec;
last = vd->cycle_last;
if (unlikely((s64)cycles < 0))
return -1;

__arch_get_hw_counter() returns a u64 values. On the PPC, this is read from the timebase which is a 64 bits counter.

Why returning -1 if (s64)cycles < 0 ? Does it means we have to mask out the most significant bit when reading the HW counter ?

Christophe