ESXi

 View Only
  • 1.  Accessing CPU MSR registers on the ESXi host

    Posted Aug 25, 2023 09:39 PM

    Hello

    I'm trying to read out some information from the MSRs on my ESXi host. On Linux this would be relatively simple to do, there's a kernel module and userspace tool called rdmsr. Of course ESXi is not linux, so I need to find a different way. Is there a possibility to write such application, or maybe by any chance such tool already exists?



  • 2.  RE: Accessing CPU MSR registers on the ESXi host

    Posted Sep 03, 2023 12:36 PM

    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_MSRList
    000000000000d5d0 g    DF .text	0000000000000007  Base        VMFeature_GetHostMSRsAndLog
    0000000000008640 g    DF .text	00000000000000ef  Base        MSRCache_Populate
    000000000000d130 g    DF .text	0000000000000008  Base        VMFeature_MSRs
    0000000000007c20 g    DF .text	0000000000000006  Base        IntelVT_MSRCount
    0000000000005870 g    DF .text	0000000000000006  Base        AMDSVM_MSRCount
    000000000000d140 g    DF .text	0000000000000006  Base        VMFeature_MSRCount
    00000000000083f0 g    DF .text	0000000000000059  Base        MSRCache_Free
    0000000000005860 g    DF .text	0000000000000008  Base        AMDSVM_MSRs
    0000000000008450 g    DF .text	0000000000000133  Base        MSRCache_Alloc
    00000000000083d0 g    DF .text	0000000000000004  Base        MSRCache_NumMSRs
    0000000000005880 g    DF .text	000000000000003b  Base        AMDSVM_FindCommonMSRs
    0000000000007c10 g    DF .text	0000000000000008  Base        IntelVT_MSRs
    00000000000085e0 g    DF .text	0000000000000054  Base        MSRCache_Set
    0000000000012300 g    DO .rodata	0000000000000060  Base        vmFeatureMSRs
    0000000000008590 g    DF .text	0000000000000043  Base        MSRCache_Get
    000000000000d330 g    DF .text	000000000000000a  Base        VMFeature_GetHostMSRs
    0000000000007c60 g    DF .text	0000000000000752  Base        IntelVT_FindCommonMSRs
    0000000000008730 g    DF .text	00000000000000bf  Base        MSRCache_Clone
    00000000000083c0 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?



  • 3.  RE: Accessing CPU MSR registers on the ESXi host

    Posted Mar 11, 2024 07:11 AM

    Hello,

    I'm facing a similar issue. Have you made any progress in resolving it?

    Regards!



  • 4.  RE: Accessing CPU MSR registers on the ESXi host

    Posted Mar 13, 2024 07:39 AM

    Hello, unfortunately no. I came to a conclusion that it may not be possible without access to the driver SDKs, which are available only to the hardware manufacturers.



  • 5.  RE: Accessing CPU MSR registers on the ESXi host

    Posted 24 days ago

    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?