From: Sven Schnelle <svens@linux.ibm.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>,
linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
hca@linux.ibm.com
Subject: Re: [PATCH v3 3/3] s390: convert to GENERIC_VDSO
Date: Wed, 05 Aug 2020 08:33:31 +0200 [thread overview]
Message-ID: <yt9d8setsitg.fsf@linux.ibm.com> (raw)
In-Reply-To: <87tuxikuub.fsf@nanos.tec.linutronix.de> (Thomas Gleixner's message of "Tue, 04 Aug 2020 22:41:00 +0200")
Hi Thomas,
Thomas Gleixner <tglx@linutronix.de> writes:
> Sven Schnelle <svens@linux.ibm.com> writes:
>> --- /dev/null
>> +++ b/arch/s390/include/asm/vdso/data.h
>> @@ -0,0 +1,13 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +#ifndef __S390_ASM_VDSO_DATA_H
>> +#define __S390_ASM_VDSO_DATA_H
>> +
>> +#include <linux/types.h>
>> +#include <vdso/datapage.h>
>
> I don't think this header needs vdso/datapage.h
Agreed.
>> +struct arch_vdso_data {
>> + __u64 tod_steering_delta;
>> + __u64 tod_steering_end;
>> +};
>> +
>> +#endif /* __S390_ASM_VDSO_DATA_H */
>
>> --- /dev/null
>> +++ b/arch/s390/include/asm/vdso/gettimeofday.h
>
>> +static inline u64 __arch_get_hw_counter(s32 clock_mode)
>> +{
>> + const struct vdso_data *vdso = __arch_get_vdso_data();
>
> If you go and implement time namespace support for VDSO then this
> becomes a problem. See do_hres_timens().
>
> As we did not expect that this function needs vdso_data we should just
> add a vdso_data pointer argument to __arch_get_hw_counter(). And while
> looking at it you're not the first one. MIPS already uses it and because
> it does not support time namespaces so far nobody noticed yet.
>
> That's fine for all others because the compiler will optimize it
> out when it's unused. If the compiler fails to do so, then this is the
> least of our worries :)
>
> As there is no new VDSO conversion pending in next, I can just queue
> that (see below) along with #1 and #2 of this series and send it to
> Linus by end of the week.
Fine with me.
>> + u64 adj, now;
>> +
>> + now = get_tod_clock();
>> + adj = vdso->arch.tod_steering_end - now;
>> + if (unlikely((s64) adj > 0))
>> + now += (vdso->arch.tod_steering_delta < 0) ? (adj >> 15) : -(adj >> 15);
>> + return now;
>> +}
>
>
>> --- /dev/null
>> +++ b/arch/s390/include/asm/vdso/processor.h
>> @@ -0,0 +1,5 @@
>> +/* SPDX-License-Identifier: GPL-2.0-only */
>> +#ifndef __ASM_VDSO_PROCESSOR_H
>> +#define __ASM_VDSO_PROCESSOR_H
>> +
>> +#endif /* __ASM_VDSO_PROCESSOR_H */
>
> The idea of this file was to provide cpu_relax() self contained without
> pulling in tons of other things from asm/processor.h.
Thanks, i'll add that.
>> diff --git a/arch/s390/include/asm/vdso/vdso.h b/arch/s390/include/asm/vdso/vdso.h
>> new file mode 100644
>> index 000000000000..e69de29bb2d1
>> diff --git a/arch/s390/include/asm/vdso/vsyscall.h b/arch/s390/include/asm/vdso/vsyscall.h
>> new file mode 100644
>> index 000000000000..6c67c08cefdd
>> --- /dev/null
>> +++ b/arch/s390/include/asm/vdso/vsyscall.h
>> @@ -0,0 +1,26 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +#ifndef __ASM_VDSO_VSYSCALL_H
>> +#define __ASM_VDSO_VSYSCALL_H
>> +
>> +#ifndef __ASSEMBLY__
>> +
>> +#include <linux/hrtimer.h>
>> +#include <linux/timekeeper_internal.h>
>
> I know you copied that from x86 or some other architecture, but thinking
> about the above these two includes are not required for building VDSO
> itself. Only the kernel update side needs them and they are included
> already there. I'm going to remove them from x86 as well.
Thanks, i removed them from my patch.
>> @@ -443,9 +396,8 @@ static void clock_sync_global(unsigned long long delta)
>> panic("TOD clock sync offset %lli is too large to drift\n",
>> tod_steering_delta);
>> tod_steering_end = now + (abs(tod_steering_delta) << 15);
>> - vdso_data->ts_dir = (tod_steering_delta < 0) ? 0 : 1;
>> - vdso_data->ts_end = tod_steering_end;
>> - vdso_data->tb_update_count++;
>> + vdso_data->arch.tod_steering_end = tod_steering_end;
>
> Leftover from the previous version. Should be arch_data.tod....
Oops, indeed.
> Heiko, do you consider this 5.9 material or am I right to assume that
> this targets 5.10?
I talked to Heiko yesterday and we agreed that it's to late for 5.9, so
we target 5.10.
Thanks,
Sven
prev parent reply other threads:[~2020-08-05 6:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-04 15:01 [PATCH RFC v3] s390: convert to GENERIC_VDSO Sven Schnelle
2020-08-04 15:01 ` [PATCH v3 1/3] vdso: allow to add architecture-specific vdso data Sven Schnelle
2020-08-06 17:10 ` [tip: timers/urgent] lib/vdso: Allow " tip-bot2 for Sven Schnelle
2020-08-04 15:01 ` [PATCH v3 2/3] timekeeping/vsyscall: Provide vdso_update_begin/end() Sven Schnelle
2020-08-06 17:10 ` [tip: timers/urgent] " tip-bot2 for Thomas Gleixner
2020-08-04 15:01 ` [PATCH v3 3/3] s390: convert to GENERIC_VDSO Sven Schnelle
2020-08-04 18:07 ` kernel test robot
2020-08-04 18:07 ` kernel test robot
2020-08-04 18:07 ` kernel test robot
2020-08-04 20:41 ` Thomas Gleixner
2020-08-04 20:41 ` Thomas Gleixner
2020-08-05 6:33 ` Sven Schnelle [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yt9d8setsitg.fsf@linux.ibm.com \
--to=svens@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=vincenzo.frascino@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.