On 29.01.2026 09:48, Jan Beulich wrote:
> On 22.01.2026 17:47, Oleksii Kurochko wrote:
>> ticks_to_ns() and ns_to_ticks() are not architecture-specific, so provide a
>> common implementation that is more resilient to overflow than the historical
>> Arm version. This is not a practical issue for Arm, as the latest ARM ARM
>> that timer frequency should be fixed at 1 GHz and older platforms used much
>> lower rates, which is shy of 32-bit overflow. As the helpers are declared
>> as static inline, they should not affect x86, which does not use them.
>>
>> On Arm, these helpers were historically implemented as out-of-line functions
>> because the counter frequency was originally defined as static and 
>> unavailable
>> to headers [1]. Later changes [2] removed this restriction, but the helpers
>> remained unchanged. Now they can be implemented as static inline without any
>> issues.
>>
>> Centralising the helpers avoids duplication and removes subtle differences
>> between architectures while keeping the implementation simple.
>>
>> Drop redundant <asm/time.h> includes where <xen/time.h> already pulls it in.
>>
>> No functional change is intended.
>>
>> [1] ddee56dc2994 arm: driver for the generic timer for ARMv7
>> [2] 096578b4e489 xen: move XEN_SYSCTL_physinfo, XEN_SYSCTL_numainfo and
>>                       XEN_SYSCTL_topologyinfo to common code
>>
>> Signed-off-by: Oleksii Kurochko <[email protected]>
>> Suggested-by: Jan Beulich <[email protected]>
> 
> Nit: Flip the two (chronological order).
> 
> Reviewed-by: Jan Beulich <[email protected]>

Btw, if this got the necessary Arm ack, I think it could also go in ahead of
all earlier patches in the series?

Jan

Reply via email to