Home | History | Annotate | Download | only in include
History log of /src/sys/arch/x86/include/apicvar.h
RevisionDateAuthorComments
 1.11  02-May-2025  imil Add support for CPUID leaf 0x40000010 to detect TSC and LAPIC frequency on
hypervisors implementing the VMware-defined interface

This change enables virtual machines to obtain TSC and LAPIC frequency
information directly from the hypervisor via CPUID leaf 0x40000010, avoiding
the need for runtime calibration, thus reducing boot speed in supported
environments.

Tested on GENERIC and MICROVM kernels, QEMU/KVM and QEMU/NVMM (current and
10.1), Intel and AMD CPUs, NetBSD/amd64 and i386.
 1.10  06-Mar-2025  imil Revert VMware-compatible TSC and LAPIC frequency detection.
 1.9  06-Mar-2025  imil Add support for CPUID leaf 0x40000010, which enables VMware-compatible TSC
and LAPIC frequency detection for virtual machines.
 1.8  25-Apr-2020  bouyer branches: 1.8.26;
Merge the bouyer-xenpvh branch, bringing in Xen PV drivers support under HVM
guests in GENERIC.
Xen support can be disabled at runtime with
boot -c
disable hypervisor
 1.7  21-Apr-2020  msaitoh Get TSC frequency from CPUID 0x15 and/or x16 for newer Intel processors.

- If the max CPUID leaf is >= 0x15, take TSC value from CPUID. Some processors
can take TSC/core crystal clock ratio but core crystal clock frequency
can't be taken. Intel SDM give us the values for some processors.
- It also required to change lapic_per_second to make LAPIC timer correctly.
- Add new file x86/x86/identcpu_subr.c to share common subroutines between
kernel and userland. Some code in x86/x86/identcpu.c and cpuctl/arch/i386.c
will be moved to this file in future.
- Add comment to clarify.
 1.6  14-Jun-2019  msaitoh branches: 1.6.2; 1.6.8;
- Dump LAPIC and I/O APIC correctly.
- Don't print redirect target on LAPIC.
- Fix DEST_MASK:
- DEST_MASK is not 1 bit but 2 bit.
- Add missing "\0"s to print decoded name correctly.
- Support both LAPIC and I/O APIC correctly in apic_format_redir().
- Improve output of some bits using with snprintb()'s "F\B\1" and ":\V".
 1.5  28-Apr-2008  martin branches: 1.5.80; 1.5.88;
Remove clause 3 and 4 from TNF licenses
 1.4  05-Mar-2007  drochner branches: 1.4.40; 1.4.42; 1.4.44;
clean up how cpus and ioapics are attached at the mainbus:
Seperate "cpubus" and "ioapicbus" -- while they share a common "address
space" (the apic id), the kernel doesn't use this fact. There are different
data passed to cpus and apics, which caused some ugly polymorphism. This
also saves the special "submatch" functions needed to distingush cpus
and ioapics for autoconf. (And it makes that "apid" locators wired
in the kernel configuration are honored now; this allows one to dumb down
an mp box to singleprocessor by userconfig.)
Print "apid" locators in the buses "print" function "as everyone does",
so the per-port cpu drivers don't need to do it.
Being here, constify "struct cpu_functions" and g/c the unused MP_PICMODE
flag.
 1.3  29-May-2005  christos branches: 1.3.2; 1.3.34;
Sprinkle const.
 1.2  27-Oct-2003  junyoung Nuke __P().
 1.1  26-Feb-2003  fvdl branches: 1.1.2;
Move some files out of i386 into x86, so that they can be shared with
other ports.
 1.1.2.4  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.1.2.1  03-Aug-2004  skrll Sync with HEAD
 1.3.34.1  12-Mar-2007  rmind Sync with HEAD.
 1.3.2.1  03-Sep-2007  yamt sync with head.
 1.4.44.1  16-May-2008  yamt sync with head.
 1.4.42.1  18-May-2008  yamt sync with head.
 1.4.40.1  02-Jun-2008  mjf Sync with HEAD.
 1.5.88.2  21-Apr-2020  martin Sync with HEAD
 1.5.88.1  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5.80.1  05-Aug-2020  martin Pull up the following revisions, requested by msaitoh in ticket #1593:

sys/arch/x86/conf/files.x86 1.108
sys/arch/x86/include/apicvar.h 1.7 via patch
sys/arch/x86/include/cpu.h 1.121
sys/arch/x86/x86/cpu.c 1.185 via patch
sys/arch/x86/x86/hyperv.c 1.7
sys/arch/x86/x86/tsc.c 1.41
sys/arch/xen/conf/files.xen 1.181

Get TSC frequency from CPUID 0x15 and/or x16 if it's available.
This change fixes a problem that newer Intel processors' timer
counts very slowly.
 1.6.8.1  25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.6.2.1  15-Jul-2020  martin Pull up the following, requested by msaitoh in ticket #1015

sys/arch/x86/conf/files.x86 1.108 (via patch)
sys/arch/x86/include/apicvar.h 1.7 (via patch)
sys/arch/x86/include/cpu.h 1.121 (via patch)
sys/arch/x86/x86/cpu.c 1.185 (via patch)
sys/arch/x86/x86/hyperv.c 1.7 (via patch)
sys/arch/x86/x86/tsc.c 1.41 (via patch)
sys/arch/xen/conf/files.xen 1.181 (via patch)

Get TSC frequency from CPUID 0x15 and/or x16 if it's available.
This change fixes a problem that newer Intel processors' timer
counts very slowly.
 1.8.26.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed