I still really don't understand the need for the CPUID loop. KVM only ever programs CPUID function 0x40000000, right?
Nope. When you enable hyper-v emulation features you'll go find the kvm cpuid @ 0x40000000 and the hyper-v cpuid @ 0x40000100 (or the other way around, not sure).
Ah, thanks. I just saw the comment above get_out_of_range_cpuid_entry() in arch/x86/kvm/cpuid.c where HyperV would get the 0x40000000-0x400000ff range and KVM would then get the 0x40000100-0x400001ff range (basically each hypervisor class gets their own 0x100 range).