Linux-MIPS Archive mirror
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@kernel.org>,
	 Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	 Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	 Russell King <linux@armlinux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	 Will Deacon <will@kernel.org>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	 Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	 Christophe Leroy <chleroy@kernel.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	 Vincenzo Frascino <vincenzo.frascino@arm.com>,
	linux-kernel@vger.kernel.org,
	 linux-arm-kernel@lists.infradead.org,
	linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org
Subject: Re: [PATCH 5/7] MIPS: VDSO: Drop kconfig MIPS_CLOCK_VSYSCALL
Date: Fri, 27 Feb 2026 11:17:27 +0100	[thread overview]
Message-ID: <20260227110939-7ba009bc-3223-4d85-8ac8-e388568af399@linutronix.de> (raw)
In-Reply-To: <a1533e92-5d95-4c11-959a-a73d90eaf030@app.fastmail.com>

On Fri, Feb 27, 2026 at 11:03:30AM +0100, Arnd Bergmann wrote:
> On Fri, Feb 27, 2026, at 10:31, Thomas Weißschuh wrote:
> > On Fri, Feb 27, 2026 at 09:46:23AM +0100, Arnd Bergmann wrote:
> >> On Fri, Feb 27, 2026, at 07:57, Thomas Weißschuh wrote:
> >> 
> >> The #ifdef was originally been added in commit 7d2aa4bb90f5 ("mips:
> >> Fix gettimeofday() in the vdso library") as a bug fix. This may not
> >> have been the correct fix because I don't see how it addressed the
> >> case of a kernel with MIPS_CLOCK_VSYSCALL enabled running on a
> >> CPU without the timer registers, but I think we should try to make
> >> sure that there is no regression from reverting it now.
> >
> > I can't make sense out of this commit. The generic vDSO automatically falls
> > back to the syscall if it can not handle the current clocksource.
> > There is no explanation *why* this should be broken on MIPS.
> > It works correctly on my x86 machines.
> 
> Agreed, the explanation is incomplete at best. Maybe Vincenzo remembers
> more details as he did the original patch.

That would be great.

> Maybe the fallback logic didn't exist at the time of that fix?

It did, and as far as I can see it looks fine.

> > Also vdso_clock_gettime() uses the same codepaths as vdso_gettimeofday()
> > and apparently that is not broken.
> 
> Not sure, maybe nobody noticed the bug yet, or maybe both 
> vdso_gettimeofday() and vdso_clock_gettime() now work correctly
> after another bugfix.

This is my suspicion.

If I mark the R4K and GIC clocksources as not vDSO compatible,
the automatic syscall fallback works correctly in my tests.

> The condition is fairly rare, as almost all MIPS systems have
> a working clocksource, the few exceptions I see in Kconfig are
> 
> - R3000 based DECstation
> - Sibyte
> - Ingenic Xburst
> - Octeon
> 
> There are not many users left on R3000 and Sibyte platforms, but
> Xburst and Octeon were reasonably common in the past, so it should
> have come up at some point.
> 
> >>  config MIPS_DISABLE_VDSO
> >> -	def_bool CPU_MICROMIPS
> >> +	def_bool CPU_MICROMIPS || !(CSRC_R4K || CLKSRC_MIPS_GIC)
> >
> > That is an an independent optimization IMO.
> 
> The idea here was that doing this would save you the trouble
> of figuring out exactly how it was broken in the past and
> whether the #ifdef is still needed.

We would still have the problem that on modern systems the clocksource
can get marked as unstable which will trigger a switchover to another
clocksource. If that one is not vDSO compatible the systemcall fallback
will also be used. So we want to fix this properly in any case. And then
the config change is only an optimization.


Thomas

  reply	other threads:[~2026-02-27 10:17 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-27  6:57 [PATCH 0/7] vDSO: Respect COMPAT_32BIT_TIME Thomas Weißschuh
2026-02-27  6:57 ` [PATCH 1/7] x86/vdso: " Thomas Weißschuh
2026-02-27  8:51   ` Arnd Bergmann
2026-02-27  8:58     ` Arnd Bergmann
2026-02-27  9:34       ` Thomas Weißschuh
2026-03-03 18:11         ` H. Peter Anvin
2026-03-03 20:50           ` Arnd Bergmann
2026-03-03 21:00             ` H. Peter Anvin
2026-03-03 21:27               ` Arnd Bergmann
2026-03-03 21:36                 ` H. Peter Anvin
2026-04-10  7:24             ` Thomas Weißschuh
2026-04-13 15:59               ` Arnd Bergmann
2026-04-13 16:13                 ` Thomas Weißschuh
2026-04-13 16:57                   ` Arnd Bergmann
2026-04-14 10:16                     ` Thomas Weißschuh
2026-03-04  7:35           ` Thomas Weißschuh
2026-03-04 18:30             ` H. Peter Anvin
2026-03-05  9:24               ` Thomas Weißschuh
2026-03-05 23:57                 ` H. Peter Anvin
2026-03-06  9:42                   ` Thomas Weißschuh
2026-03-06 20:52                     ` H. Peter Anvin
2026-02-27  6:57 ` [PATCH 2/7] ARM: VDSO: " Thomas Weißschuh
2026-02-27  6:57 ` [PATCH 3/7] arm64: vdso32: " Thomas Weißschuh
2026-02-27  6:57 ` [PATCH 4/7] powerpc/vdso: " Thomas Weißschuh
2026-02-27  6:57 ` [PATCH 5/7] MIPS: VDSO: Drop kconfig MIPS_CLOCK_VSYSCALL Thomas Weißschuh
2026-02-27  8:46   ` Arnd Bergmann
2026-02-27  9:31     ` Thomas Weißschuh
2026-02-27 10:03       ` Arnd Bergmann
2026-02-27 10:17         ` Thomas Weißschuh [this message]
2026-02-27  6:57 ` [PATCH 6/7] MIPS: VDSO: Respect COMPAT_32BIT_TIME Thomas Weißschuh
2026-02-27  6:57 ` [PATCH 7/7] vdso/gettimeofday: Verify COMPAT_32BIT_TIME interactions Thomas Weißschuh
2026-02-27  8:49   ` Arnd Bergmann

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=20260227110939-7ba009bc-3223-4d85-8ac8-e388568af399@linutronix.de \
    --to=thomas.weissschuh@linutronix.de \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=chleroy@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=luto@kernel.org \
    --cc=maddy@linux.ibm.com \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=tglx@kernel.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=vincenzo.frascino@arm.com \
    --cc=will@kernel.org \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).