[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v6 01/51] x86/apic: Provide helpers to set local APIC timer frequency in hz and khz



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 <mhklinux@xxxxxxxxxxx>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>

Reviewed-by: David Woodhouse <dwmw@xxxxxxxxxxxx>

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.