[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87ecu9tfhw.ffs@tglx>
Date: Mon, 21 Jul 2025 23:12:43 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Arnd Bergmann <arnd@...db.de>, Andreas Larsson <andreas@...sler.com>,
John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>, Arnd Bergmann
<arnd@...nel.org>, Thomas Weißschuh
<thomas.weissschuh@...utronix.de>,
"David S . Miller" <davem@...emloft.net>
Cc: Andy Lutomirski <luto@...nel.org>, Vincenzo Frascino
<vincenzo.frascino@....com>, shuah <shuah@...nel.org>, Anna-Maria Gleixner
<anna-maria@...utronix.de>, Frederic Weisbecker <frederic@...nel.org>,
John Stultz <jstultz@...gle.com>, Stephen Boyd <sboyd@...nel.org>, Catalin
Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>, Eric
Biggers <ebiggers@...gle.com>, sparclinux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] vdso: sparc: stub out custom vdso implementation
On Fri, Jul 11 2025 at 12:31, Arnd Bergmann wrote:
> It is probably not all that hard to convert the VDSO to use the
> generic implementation if you remove the runtime patching between
> TICK and STICK mode. From the code and the documentation, it
> seems that any JPS1 compatible CPU (or newer) uses STICK,
> this would be UltraSPARC III (Cheetah), SPARC64 V (Zeus)
> and all UltraSPARC T. If you want to give it a try to do the
> conversion to the generic VDSO, I could respin my patch to only
> remove the older TICK version and the runtime patching but leave
> the STICK one. I don't think it's worth my time trying to convert
> STICK myself since I have no way of testing it.
Getting rid of the run-time patching is really trivial. The clocksource
setup initializes clocksource::archdata::vdso_clockmode already
correctly with VCLOCK_NONE, VCLOCK_TICK and VCLOCK_STICK.
So all you need is:
static inline u64 __arch_get_hw_counter(s32 clock_mode, const struct vdso_time_data *vd)
{
if (likely(clock_mode == VDSO_CLOCKMODE_STICK))
return vread_stick();
if (clock_mode == VDSO_CLOCKMODE_TICK))
return vread_tick();
return U64_MAX;
}
Plus a 32-bit specific version of vdso_shift_ns(), which means just
renaming the 32-bit variant of __shr64() and removing the then pointless
notrace annotation.
This should just work out of the box and the performance regression will
be minimal if even measurable.
Thanks,
tglx
Powered by blists - more mailing lists