All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: "Arnd Bergmann" <arnd@arndb.de>,
	"Andreas Larsson" <andreas@gaisler.com>,
	"John Paul Adrian Glaubitz" <glaubitz@physik.fu-berlin.de>,
	"Arnd Bergmann" <arnd@kernel.org>,
	"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"David S . Miller" <davem@davemloft.net>
Cc: Andy Lutomirski <luto@kernel.org>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	shuah <shuah@kernel.org>,
	Anna-Maria Gleixner <anna-maria@linutronix.de>,
	Frederic Weisbecker <frederic@kernel.org>,
	John Stultz <jstultz@google.com>, Stephen Boyd <sboyd@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Eric Biggers <ebiggers@google.com>,
	sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] vdso: sparc: stub out custom vdso implementation
Date: Mon, 21 Jul 2025 23:12:43 +0200	[thread overview]
Message-ID: <87ecu9tfhw.ffs@tglx> (raw)
In-Reply-To: <ba62bc7b-fa3e-4f34-a966-cc734468b8ef@app.fastmail.com>

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


  parent reply	other threads:[~2025-07-21 21:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-07 14:46 [PATCH 1/2] vdso: sparc: stub out custom vdso implementation Arnd Bergmann
2025-07-07 14:46 ` [PATCH 2/2] clocksource: remove ARCH_CLOCKSOURCE_DATA Arnd Bergmann
2025-07-07 17:31   ` John Stultz
2025-07-07 15:22 ` [PATCH 1/2] vdso: sparc: stub out custom vdso implementation John Paul Adrian Glaubitz
2025-07-07 15:45   ` Arnd Bergmann
2025-07-07 16:05     ` John Paul Adrian Glaubitz
2025-07-10 16:22       ` Andreas Larsson
2025-07-11 10:31         ` Arnd Bergmann
2025-07-14  8:40           ` John Paul Adrian Glaubitz
2025-07-21 21:12           ` Thomas Gleixner [this message]
2025-07-08  5:39 ` Thomas Weißschuh
2025-07-08  6:40   ` Arnd Bergmann
2025-07-08  7:13     ` Thomas Weißschuh
2025-07-23 10:57 ` Thomas Weißschuh
2025-07-23 11:10   ` John Paul Adrian Glaubitz
2025-07-23 17:24   ` Thomas Gleixner

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=87ecu9tfhw.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=andreas@gaisler.com \
    --cc=anna-maria@linutronix.de \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=davem@davemloft.net \
    --cc=ebiggers@google.com \
    --cc=frederic@kernel.org \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=shuah@kernel.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=vincenzo.frascino@arm.com \
    --cc=will@kernel.org \
    /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.