> On Mon, May 20, 2013 at 8:42 PM, Mike Larkin <mlar...@azathoth.net> wrote: > > On Mon, May 20, 2013 at 05:11:35PM +0000, Alexey E. Suslikov wrote: > >> Theo de Raadt <deraadt <at> cvs.openbsd.org> writes: > >> > >> > If these VM's are real VM's the should start emulating the machines > >> > they claim to be emulating correctly, or they should start advertising > >> > that they are something "different", so that we can isolate the bullshit > >> > factor. > >> > >> Ok. I see. > >> > >> Could we trim that down to the following? > >> > >> --- sys/arch/amd64/amd64/identcpu.c.orig Mon May 20 19:58:06 2013 > >> +++ sys/arch/amd64/amd64/identcpu.c Mon May 20 20:01:08 2013 > >> @@ -127,6 +127,7 @@ > >> { CPUIDECX_AVX, "AVX" }, > >> { CPUIDECX_F16C, "F16C" }, > >> { CPUIDECX_RDRAND, "RDRAND" }, > >> + { CPUIDECX_HV, "HV" }, > >> }, cpu_ecpuid_ecxfeatures[] = { > >> { CPUIDECX_LAHF, "LAHF" }, > >> { CPUIDECX_CMPLEG, "CMPLEG" }, > >> --- sys/arch/amd64/include/specialreg.h.orig Mon May 20 20:01:56 2013 > >> +++ sys/arch/amd64/include/specialreg.h Mon May 20 20:06:09 2013 > >> @@ -158,6 +158,7 @@ > >> #define CPUIDECX_AVX 0x10000000 /* Advanced Vector > >> Extensions */ > >> #define CPUIDECX_F16C 0x20000000 /* 16bit fp conversion */ > >> #define CPUIDECX_RDRAND 0x40000000 /* RDRAND instruction */ > >> +#define CPUIDECX_HV 0x80000000 /* Hypervisor > >> presence */ > >> > >> /* > >> * "Structured Extended Feature Flags Parameters" (CPUID function 0x7, > >> leaf 0) > >> > > > > That's certainly less objectionable but I'm not sure what useful information > > this diff provides. > > Seen in dmesg, HV flag will indicate operating system is run under hypervisor > and weird things are possible while running kernel code which depends on CPU > features. > > After all, it is kinda documented by AMD on page 570 of > http://support.amd.com/us/Processor_TechDocs/24594_APM_v3.pdf > > (AMD named it RAZ, but I put meaningful name like in FreeBSD - should we > put a reference to above mentioned document near the define?).
Your statements here are trying to convince us of something which is false. AMD says "RAZ. Reserved for use by hypervisor to indicate guest status." That sentence does not translate to "The hypervisor is heavily broken and fails to completely emulate the machine otherwise advertised by the rest of the CPUID fields". It does not indicate that weird things are possible. If those weird things are possible, it is not because the hardware is broken, but because the *emulation of the hardware* by the VM is broken!