freebsd-skq/sys
Peter Grehan ec048c7550 Hide host CPUID 0x15 TSC/Crystal ratio/freq info from guest
In recent Linux (5.3+) and OpenBSD (6.6+) kernels, and with hosts that
support CPUID 0x15, the local APIC frequency is determined directly
from the reported crystal clock to avoid calibration against the 8254
timer.

However, the local APIC frequency implemented by bhyve is 128MHz, where
most h/w systems report frequencies around 25MHz. This shows up on
OpenBSD guests as repeated keystrokes on the emulated PS2 keyboard
when using VNC, since the kernel's timers are now much shorter.

Fix by reporting all-zeroes for CPUID 0x15. This allows guests to fall
back to using the 8254 to calibrate the local APIC frequency.

Future work could be to compute values returned for 0x15 that would
match the host TSC and bhyve local APIC frequency, though all dependencies
on this would need to be examined (for example, Linux will start using
0x16 for some hosts).

PR:	246321
Reported by:	Jason Tubnor (and tested)
Reviewed by:	jhb
Approved by:	jhb, bz (mentor)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D24837
2020-05-14 22:18:12 +00:00
..
amd64 Hide host CPUID 0x15 TSC/Crystal ratio/freq info from guest 2020-05-14 22:18:12 +00:00
arm Revert r360944 and r360946 until reported issues can be resolved 2020-05-12 04:34:26 +00:00
arm64 Call acpi_pxm_set_proximity_info() slightly earlier on x86. 2020-05-14 16:07:27 +00:00
bsm bsm: add AUE_CLOSERANGE 2020-04-24 01:27:25 +00:00
cam Add nvd alias back to nda now that it actually works. 2020-05-13 19:17:35 +00:00
cddl Avoid the GEOM topology lock recursion when we automatically expand a pool. 2020-04-25 21:45:31 +00:00
compat linuxkpi: Add EBADRQC to errno.h 2020-05-13 07:49:12 +00:00
conf Remove tests for obsolete compilers in the build system 2020-05-12 15:22:40 +00:00
contrib [ath_hal_ar9300] Ensure AH_BYTE_ORDER is defined before used. 2020-05-12 02:23:11 +00:00
crypto Remove MD5 HMAC from OCF. 2020-05-11 22:08:08 +00:00
ddb kernel: provide panicky version of __unreachable 2020-05-13 18:07:37 +00:00
dev Call acpi_pxm_set_proximity_info() slightly earlier on x86. 2020-05-14 16:07:27 +00:00
dts allwinner: aw_thermal: Cope with DTS changes 2020-04-14 19:05:17 +00:00
fs Remove unused header for DES. 2020-05-13 18:35:02 +00:00
gdb Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
geom Reimplement aliases in geom 2020-05-13 19:17:28 +00:00
gnu dts: Import DTS from Linux 5.6 2020-04-14 18:57:00 +00:00
i386 Fix the i386 build after r361033. 2020-05-14 17:56:44 +00:00
isa sc(4) md bits: stop setting sc->kbd entirely 2019-12-30 02:07:55 +00:00
kern Fix r361037. 2020-05-14 20:17:09 +00:00
kgssapi Remove support for Kernel GSS algorithms deprecated in r348875. 2020-04-10 23:08:41 +00:00
libkern Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
mips Revert r360944 and r360946 until reported issues can be resolved 2020-05-12 04:34:26 +00:00
modules Remove tests for obsolete compilers in the build system 2020-05-12 15:22:40 +00:00
net kernel: provide panicky version of __unreachable 2020-05-13 18:07:37 +00:00
net80211 [net80211] Use the unicast key when transmitting DWDS AP multicast frames. 2020-05-08 17:01:33 +00:00
netgraph Add space for RSSI in data member. 2020-05-09 14:15:44 +00:00
netinet libalias: fix potential memory disclosure from ftp module 2020-05-12 16:38:28 +00:00
netinet6 IPv6: Fix a panic in the nd6 code with unmapped mbufs. 2020-05-12 17:18:44 +00:00
netipsec Don't pass bogus keys down for NULL algorithms. 2020-05-02 01:00:29 +00:00
netpfil pf: Don't allocate per-table entry counters unless required. 2020-05-11 18:47:38 +00:00
netsmb Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
nfs Remove rtable dumping code from bootp. 2020-04-28 07:23:41 +00:00
nfsclient
nfsserver
nlm Make nfslockd depend on xdr. 2020-04-23 09:37:22 +00:00
ofed Convert OFED rtable interactions to the new routing KPI. 2020-04-15 13:06:55 +00:00
opencrypto Trim a few more things I missed from xform_enc.h. 2020-05-13 18:36:02 +00:00
powerpc Revert r360944 and r360946 until reported issues can be resolved 2020-05-12 04:34:26 +00:00
riscv riscv: Fix pmap_protect for superpages 2020-05-13 17:20:51 +00:00
rpc Split XDR into separate kernel module. Make krpc depend on xdr. 2020-04-17 06:04:20 +00:00
security audit_canon_path_vp: don't panic if cdir == NULL 2020-04-17 02:09:31 +00:00
sys kernel: provide panicky version of __unreachable 2020-05-13 18:07:37 +00:00
teken
tests Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
tools vfs: stop null checking routines in vop wrappers 2020-01-26 00:41:38 +00:00
ufs Retire two unused background fsck sysctls. 2020-04-21 17:42:32 +00:00
vm Allocate UMA per-CPU counters earlier. 2020-05-14 16:06:54 +00:00
x86 Call acpi_pxm_set_proximity_info() slightly earlier on x86. 2020-05-14 16:07:27 +00:00
xdr Split XDR into separate kernel module. Make krpc depend on xdr. 2020-04-17 06:04:20 +00:00
xen Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (16 of many) 2020-02-25 19:04:39 +00:00
Makefile Remove sparc64 kernel support 2020-02-03 17:35:11 +00:00