Re: [PATCH 2/2] timers: retpoline mitigation for time funcs

From: Thomas Gleixner
Date: Mon Apr 11 2022 - 07:11:52 EST


On Sun, Apr 10 2022 at 14:14, Thomas Gleixner wrote:
> On Fri, Feb 18 2022 at 14:18, Pete Swain wrote:
>> @@ -245,7 +245,8 @@ static int clockevents_program_min_delta(struct clock_event_device *dev)
>>
>> dev->retries++;
>> clc = ((unsigned long long) delta * dev->mult) >> dev->shift;
>> - if (dev->set_next_event((unsigned long) clc, dev) == 0)
>> + if (INDIRECT_CALL_1(dev->set_next_event, lapic_next_deadline,
>> + (unsigned long) clc, dev) == 0)
>
> No. We are not sprinkling x86'isms into generic code.

Even if we would do that, then this is completely useless.

The hotpath function is clockevents_program_event() and not
clockevents_program_min_delta().

The latter is invoked from the former if the to be programmed event is
in the past _and_ the force argument is set, i.e. in 0.1% of the
invocations of clockevents_program_event(), which itself has an indirect
call to dev->set_next_event().

If your profiles show clockevents_program_min_delta() as dominant, then
there is something massively wrong with your kernel.

Thanks,

tglx