Quantcast
Channel: Hyper-V forum
Viewing all articles
Browse latest Browse all 8743

[URGENT] : CPUId on HyperV

$
0
0
We have this Win2k12 HyperV role installed and we detect whether the guest is Hyper-V is not using the CPUId instruction for x86 and x86_64 processor.

The below is on a host. I thought only guests were supposed to get the CPUID as Hyper-V or "Microsoft Hv" when you install linux or windows inside the guests. It works fine for all the guests I have tested even of AWS.

But for host it is like giving me this value and it doesn't happen for Vmware ESX, KVM host, Xen host ie it gives an empty string ('\0') for all three.

I don't know maybe it is a design decision or maybe you support nested guests. I really don't know the technology . It would be really kind of you if you can get me the contact or answers for this. If you are not the right person, please let me know how to go about this ?


The below code snippet is what we use .


static const char *IsGuestType(void)
{
   int idx[4];
   static char cpustring[128];
   memset(cpustring,'\0',sizeof(cpustring));
   __cpuid(idx, 0x40000000);

   strcpy_s(cpustring,(const char *)((int*)idx+1));
   strcat_s(cpustring,(const char *)((int*)idx+3));
   strcat_s(cpustring,(const char *)((int*)idx+2));

   return cpustring;
}

C:\Users\hyperadm\Desktop>cpuid  (on host)
Microsoft Hv

Viewing all articles
Browse latest Browse all 8743

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>