patch review: 0x40000010 CPUID leaf support for NVMM

Emile `iMil' Heitor <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
The NVMM hypervisor currently does not implement CPUID leaf 0x40000010,
which returns the host's CPU TSC frequency in EAX and the host's LAPIC
frequency in EBX. Implementing this leaf would help reduce boot time by
avoiding the calculation of both values.
Additionally, as reported in pr/59170, NVMM returns an invalid value
when querying this CPUID leaf on AMD CPUs, which causes a kernel panic:
https://releng.netbsd.org/b5reports/amd64/2025/2025.03.06.09.02.46/install.log 
with this (now reverted) patch which implements CPUID 0x40000010
query in the guest system:
https://mail-index.netbsd.org/tech-kern/2025/02/27/msg030096.html

The following patch implements support for said CPUID leaf in NVMM.
For the very unlikely case NVMM would happen to be loaded / used on Xen
or harware without LAPIC, I added a has_lapic() helper function which
allows NVMM to be aware at runtime of LAPIC support in the kernel when
built as a module.

https://imil.net/NetBSD/nvmm-vmwarecpuid.patch

------------------------------------------------------------------------
Emile `iMil' Heitor <imil@{home.imil.net,NetBSD.org}> | https://imil.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.