[RFC PATCH v3 08/12] lib: vdso: allow arches to provide vdso data pointer

Christophe Leroy christophe.leroy at c-s.fr
Thu Jan 16 01:16:18 PST 2020

Thomas, Andy,

Le 15/01/2020 à 07:15, Christophe Leroy a écrit :
> Le 15/01/2020 à 00:06, Thomas Gleixner a écrit :
>> Christophe Leroy <christophe.leroy at c-s.fr> writes:
>>>   static __maybe_unused int
>>> +__cvdso_clock_gettime_common(const struct vdso_data *vd, clockid_t 
>>> clock,
>>> +              struct __kernel_timespec *ts)
>>> +{
>>> +#else
>>>   __cvdso_clock_gettime_common(clockid_t clock, struct 
>>> __kernel_timespec *ts)
>>>   {
>>>       const struct vdso_data *vd = __arch_get_vdso_data();
>>> +#endif
>>>       u32 msk;
>> If we do that, then there is no point in propagating this to the inner
>> functions. It's perfectly fine to have this distinction at the outermost
>> level.
> In v2, I did it at the arch level (see 
> https://patchwork.ozlabs.org/patch/1214983/). Andy was concerned about 
> it being suboptimal for arches which (unlike powerpc) have PC related 
> data addressing mode.
> Wouldn't it be the same issue if doing it at the outermost level of 
> generic VDSO ?

Any opinion on this ?

 From your point of view, what should I do:
A/ __arch_get_vdso_data() handled entirely at arch level and arches 
handing over the vdso data pointer to generic C VDSO functions all the 
time (as in my v2 series) ?
B/ Data pointer being handed over all the way up for arches wanting to 
do so, no changes at all for others (as in my v3 series) ?
C/ __arch_get_vdso_data() being called at the outermost generic level 
for arches not interested in handling data pointer from the caller (as 
suggested by Thomas) ?

Andy, with A/ you were concerned about arches being able to do PC 
related accesses. Would it be an issue for C/ as well ? If not, I guess 
C/ would be cleaner than B/ allthought not as clean as A which doesn't 
add any #ifdefery at all.


More information about the linux-arm-kernel mailing list