]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
apic: prevent divide by zero in CPU frequency init
authorMina Galić <freebsd@igalic.co>
Tue, 28 Feb 2023 02:58:45 +0000 (19:58 -0700)
committerWarner Losh <imp@FreeBSD.org>
Thu, 2 Mar 2023 17:09:47 +0000 (10:09 -0700)
commit55639067a29b1250f7ba7dfc012723a843c5f91c
tree747f733f163796cd99f4f6271cf071eaa79e3b38
parent572900bd93fdbbc2b42f0ad7374f390d8dd54de8
apic: prevent divide by zero in CPU frequency init

If a CPU for some reason returns 0 as CPU frequency, we currently panic
on the resulting divide by zero when trying to initialize the CPU(s) via
APIC. When this happens, we'll fallback to measuring the frequency
instead.

PR: 269767
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/664
Approved by: re@ (cperciva)

(cherry picked from commit 499171a98c8813e4dc6e085461d5c47750efa555)
(cherry picked from commit a1c63b8e29e832d9ada7c252e7e80ce8b94aeb41)
sys/x86/x86/local_apic.c