]> Gentwo Git Trees - linux/.git/commit
x86/apic: Fix frequency in apic=verbose log output
authorJulian Stecklina <julian.stecklina@cyberus-technology.de>
Sat, 30 Oct 2021 14:21:48 +0000 (16:21 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Fri, 7 Nov 2025 16:48:14 +0000 (17:48 +0100)
commited4f9638d905a97cebd49ecea85cc9b706b73761
tree00bdb3f1f193275d94e49d2f7545a27807107bfa
parent27d2afa3b4eab5fb2a03b6ad8b74a3a700e92dce
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
arch/x86/kernel/apic/apic.c