Any progress with this? Is it pssible to read the MSR from the ESXi shell? Or these being privileged IA32 instructions (https://www.felixcloutier.com/x86/rdmsr and https://wiki.osdev.org/Model_Specific_Registers) need a VMKernel module like the msr.ko in Linux?
Is there such a VIB providing such module similar to the msr.ko in Linux (https://github.com/LLNL/msr-safe)?
If not that's a pain because you can't derisk running ESXi on lower-end hardware w/o ILO, IPMI or DRAC and temperature monitoring is a must.
This hardware although recognized by ESXi, lacks the CIM drivers in the VMKernel and basically the WEBCIM (and in VCenter) will see no sensors. Plus the sensor stuff is vendor specific whereas the MSR reading is generic and should work on any hardware.
Any idea what can be done for the MSR?
Original Message:
Sent: Sep 03, 2023 12:36 PM
From: BarKa_
Subject: Accessing CPU MSR registers on the ESXi host
I coudn't find any official information on this, so I started digging in the files looking for an unsupported way. It seems that there is a library called libhwinfo.so in /lib64, which exports some functions related to accessing MSRs:
objdump -T libhwinfo.so | grep -i msr 00000000000083e0 g DF .text 0000000000000005 Base MSRCache_MSRList000000000000d5d0 g DF .text 0000000000000007 Base VMFeature_GetHostMSRsAndLog0000000000008640 g DF .text 00000000000000ef Base MSRCache_Populate000000000000d130 g DF .text 0000000000000008 Base VMFeature_MSRs0000000000007c20 g DF .text 0000000000000006 Base IntelVT_MSRCount0000000000005870 g DF .text 0000000000000006 Base AMDSVM_MSRCount000000000000d140 g DF .text 0000000000000006 Base VMFeature_MSRCount00000000000083f0 g DF .text 0000000000000059 Base MSRCache_Free0000000000005860 g DF .text 0000000000000008 Base AMDSVM_MSRs0000000000008450 g DF .text 0000000000000133 Base MSRCache_Alloc00000000000083d0 g DF .text 0000000000000004 Base MSRCache_NumMSRs0000000000005880 g DF .text 000000000000003b Base AMDSVM_FindCommonMSRs0000000000007c10 g DF .text 0000000000000008 Base IntelVT_MSRs00000000000085e0 g DF .text 0000000000000054 Base MSRCache_Set0000000000012300 g DO .rodata 0000000000000060 Base vmFeatureMSRs0000000000008590 g DF .text 0000000000000043 Base MSRCache_Get000000000000d330 g DF .text 000000000000000a Base VMFeature_GetHostMSRs0000000000007c60 g DF .text 0000000000000752 Base IntelVT_FindCommonMSRs0000000000008730 g DF .text 00000000000000bf Base MSRCache_Clone00000000000083c0 g DF .text 0000000000000003 Base MSRCache_NumCPUs
A quick github search revealed a header file from VMware Workstation(?) kernel module: https://github.com/ciwei100000/vmware-host-modules/blob/0f36e121bf5c50b8abd77b930e8b01cf7e7102ed/vmmon-only/include/msrCache.h#L61. That gives me signatures of those functions, but absolutely no idea how to actually use them. Are those a part of some API? Is there any documentation I could gain access to?