On 24.02.2022 15:09, Roger Pau Monné wrote:
> On Thu, Jan 13, 2022 at 02:17:18PM +0100, Jan Beulich wrote:
>> Except in the "clocksource=tsc" case we can replace the indirect calls
>> involved in accessing the platform timers by direct ones, as they get
>> established once and never changed. To also cover the "tsc" case, invoke
>> what read_tsc() resolves to directly. In turn read_tsc() then becomes
>> unreachable and hence can move to .init.*.
>>
>> Signed-off-by: Jan Beulich <jbeul...@suse.com>
> 
> Reviewed-by: Roger Pau Monné <roger....@citrix.com>

Thanks.

>> ---
>> TBD: Instead of adding __init to read_tsc() we could also ditch the
>>      function altogether, using a dedicated (non-canonical) pointer
>>      constant instead for the .read_counter initializer and the two
>>      comparisons done on plt_src.read_counter.
> 
> I was going to suggest adding an ASSERT_UNREACHABLE, but not sure it
> makes much sense if the function is init only.
> 
> I would be fine with using a non-canonical pointer.

I guess I'll put in the patch as is and do the conversion in a follow-up
change adding __initconst_cf_clobber (once it's clear what to do about
structures which are written to).

Jan


Reply via email to