On Thu, 2026-08-06 at 16:35 -0700, Sean Christopherson wrote:
> Add and use APIs to set the local APIC timer period (given a frequency)
> instead of open coding the subtle HZ math in all external callers, and
> make lapic_timer_period local to apic.c.  Provide APIs to specify the
> frequency in both hertz and kilohertz so that Hyper-V and VMware code
> aren't forced to lose precision.
>
> Opportunistically take the frequency as a u64 to harden against the
> possibility that the frequency (in Khz) is greater than 4294967, i.e. if
> the APIC timer runs at ~4.29 GHz.  As pointed out by Sashiko,
> 4294968 * 1000 == 0x1_000002c0, and thus a Khz period of 4294968 would
> silently overflow the 32-bit unsigned integer used by most callers.
>
> Print out who set the period to maintain equivalent Hyper-V and VMware
> functionality, and in general to make it easier to triage/debug issues.
>
> Cc: Michael Kelley <[email protected]>
> Signed-off-by: Sean Christopherson <[email protected]>

Reviewed-by: David Woodhouse <[email protected]>

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to