[PATCH 2/3] clocksource/drivers/arm_arch_timer: Expose a direct accessor for the virtual counter

Will Deacon will at kernel.org
Thu Feb 26 10:09:53 PST 2026


On Thu, Feb 26, 2026 at 04:48:05PM +0000, Marc Zyngier wrote:
> On Thu, 26 Feb 2026 14:03:36 +0000,
> Ben Horgan <ben.horgan at arm.com> wrote:
> > Or is the point that if you haven't enabled a relevant workaround then
> > all cores are treated the same and so there is no need to disable
> > preemption?
> 
> There are multiple things at play here:
> 
> - we cannot fail to enable a workaround. If we find one, we enable it.
> 
> - if no workaround are available, then there is no need to disable
>   preemption, because the read of the counter is the same on all CPUs.
> 
> However, this code is a bug nest, and I just re-discovered an
> interesting failure mode (boot on a sane CPU, keeping the broken CPUs
> offline, online a broken CPU late, enjoy the fireworks).

Damn, that was the scenario I was worried about :(

I couldn't see an alternative to disabling preemption for everybody
but my brain's not firing on all cylinders this week.

> Plus the fact that we don't indirect sched_clock(), which means we
> never really enable a workaround if the boot CPU is not affected.
> 
> I have a small pile of hacks to address all of this, but I need to
> convince myself that this is actually correct.
> 
> Stay tuned...

I'll keep an eye out!

Will



More information about the linux-arm-kernel mailing list