K 10 svn:author V 7 git2svn K 8 svn:date V 27 2023-01-29T18:57:15.238068Z K 7 svn:log V 982 kvmclock: Fix initialization when EARLY_AP_STARTUP is not defined To attach to the hypervisor, kvmclock needs to write a per-CPU MSR. When EARLY_AP_STARTUP is not defined, device attach happens too early: APs are not yet spun up, so smp_rendezvous only runs the callback on the local CPU. As a result, the timecounter only gets initialized on the BSP, and then timekeeping is broken on SMP systems. Implement handling for !EARLY_AP_STARTUP kernels: keep track of the CPU on which device attach ran, and then use a SI_SUB_SMP SYSINIT to register the rest of the CPUs with the hypervisor. Reported by: Shrikanth R Kamath Reviewed by: kib, jhb (earlier versions) Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D37705 (cherry picked from commit 568f552b0410f4f72db9ce710f7803acca23f79f) Git Hash: 870464f11f3c53fcc7114ea406f95655b9821263 Git Author: markj@FreeBSD.org END