linux/arch/x86/kernel/apic
Julian Stecklina ed4f9638d9 x86/apic: Fix frequency in apic=verbose log output
When apic=verbose is specified, the LAPIC timer calibration prints its results
to the console. At least while debugging virtualization code, the CPU and bus
frequencies are printed incorrectly.

Specifically, for a 1.7 GHz CPU with 1 GHz bus frequency and HZ=1000,
the log includes a superfluous 0 after the period:

  ..... calibration result: 999978
  ..... CPU clock speed is 1696.0783 MHz.
  ..... host bus clock speed is 999.0978 MHz.

Looking at the code, this only worked as intended for HZ=100. After the fix,
the correct frequency is printed:

  ..... calibration result: 999828
  ..... CPU clock speed is 1696.507 MHz.
  ..... host bus clock speed is 999.828 MHz.

There is no functional change to the LAPIC calibration here, beyond the
printing format changes.

  [ bp: - Massage commit message
        - Figures it should apply this patch about ~4 years later
        - Massage it into the current code ]

Suggested-by: Markus Napierkowski <markus.napierkowski@cyberus-technology.de>
Signed-off-by: Julian Stecklina <julian.stecklina@cyberus-technology.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20211030142148.143261-1-js@alien8.de
2025-11-07 17:48:14 +01:00
..
Makefile x86/apic: Add new driver for Secure AVIC 2025-08-28 17:57:19 +02:00
apic.c x86/apic: Fix frequency in apic=verbose log output 2025-11-07 17:48:14 +01:00
apic_common.c x86/apic: Remove yet another dubious callback 2024-02-15 22:07:41 +01:00
apic_flat_64.c x86/apic: Remove logical destination mode for 64-bit 2024-08-09 14:34:16 +02:00
apic_noop.c arch/x86: Provide the CPU number in the wakeup AP callback 2025-05-23 16:30:56 +00:00
apic_numachip.c hyperv-next for v6.16 2025-06-03 08:39:20 -07:00
hw_nmi.c * Rework apic callbacks, getting rid of unnecessary ones and 2023-08-30 10:44:46 -07:00
init.c x86/apic: Provide static call infrastructure for APIC callbacks 2023-08-09 12:00:55 -07:00
io_apic.c x86/ioapic: Simplify mp_irqdomain_alloc() slightly 2025-10-21 08:47:33 +02:00
ipi.c Miscellaneous x86 cleanups by Arnd Bergmann, Charles Han, 2025-03-24 22:39:53 -07:00
local.h x86/smp: Drop 32-bit "bigsmp" machine support 2025-02-27 11:19:05 +01:00
msi.c x86/apic: Convert to IRQCHIP_MOVE_DEFERRED 2025-01-15 21:38:53 +01:00
probe_32.c x86/smp: Drop 32-bit "bigsmp" machine support 2025-02-27 11:19:05 +01:00
probe_64.c x86/apic: Provide common init infrastructure 2023-08-09 11:58:34 -07:00
vector.c x86/apic: Add update_vector() callback for APIC drivers 2025-09-01 12:36:46 +02:00
x2apic_cluster.c x86/cpu: Improve readability of per-CPU cpumask initialization code 2024-04-10 07:02:33 +02:00
x2apic_phys.c x86/apic: Remove the pointless writeback of boot_cpu_physical_apicid 2024-02-15 22:07:41 +01:00
x2apic_savic.c x86/apic/savic: Do not use snp_abort() 2025-09-04 13:12:51 +02:00
x2apic_uv_x.c arch/x86: Provide the CPU number in the wakeup AP callback 2025-05-23 16:30:56 +00:00