We don't currently emulate all TSC related features yet. While hacking on other issues, I've found some more obnoxious guests (*cough* debian *cough*) constantly try to read the IA32_TSC_ADJUST msr every second, not getting the hint when we inject #GP. This floods the kernel message buffer with things like:
vmx_handle_rdmsr: unsupported rdmsr (msr=0x3b), injecting #GP (The above debug logging exists to help find msr's we're not supporting that guests are poking, so I guess you can say it's working as intended [1].) If and when we add more TSC capabilities to vmm we can always unmask. Ok? [1] https://marc.info/?l=openbsd-tech&m=161739346822128&w=2 Index: sys/arch/amd64/include/vmmvar.h =================================================================== RCS file: /cvs/src/sys/arch/amd64/include/vmmvar.h,v retrieving revision 1.71 diff -u -p -r1.71 vmmvar.h --- sys/arch/amd64/include/vmmvar.h 5 Apr 2021 18:26:46 -0000 1.71 +++ sys/arch/amd64/include/vmmvar.h 16 May 2021 16:55:06 -0000 @@ -637,6 +637,7 @@ struct vm_mprotect_ept_params { /* * SEFF flags - copy from host minus: + * TSC_ADJUST (SEFF0EBX_TSC_ADJUST) * SGX (SEFF0EBX_SGX) * HLE (SEFF0EBX_HLE) * INVPCID (SEFF0EBX_INVPCID) @@ -655,7 +656,8 @@ struct vm_mprotect_ept_params { * PT (SEFF0EBX_PT) * AVX512VBMI (SEFF0ECX_AVX512VBMI) */ -#define VMM_SEFF0EBX_MASK ~(SEFF0EBX_SGX | SEFF0EBX_HLE | SEFF0EBX_INVPCID | \ +#define VMM_SEFF0EBX_MASK ~(SEFF0EBX_TSC_ADJUST | SEFF0EBX_SGX | \ + SEFF0EBX_HLE | SEFF0EBX_INVPCID | \ SEFF0EBX_RTM | SEFF0EBX_PQM | SEFF0EBX_MPX | \ SEFF0EBX_PCOMMIT | SEFF0EBX_PT | \ SEFF0EBX_AVX512F | SEFF0EBX_AVX512DQ | \
