Messages in this thread | | | Subject | Re: [PATCH 1/2] VMware detection support for x86 and x86-64 | From | Zachary Amsden <> | Date | Fri, 26 Sep 2008 13:35:48 -0700 |
| |
On Fri, 2008-09-26 at 06:22 -0700, Valdis.Kletnieks@vt.edu wrote: > On Fri, 26 Sep 2008 14:47:21 +0200, Gerd Hoffmann said: > > Hi, > > > > > This, of course, is what CPUID is for. > > > > ... except that it doesn't always work. It requires vmx/svm, otherwise > > cpuid doesn't trap and thus can't be filled by the hypervisor ... > > Which would be hardware implementers in the '80s getting wrong the first few > times what IBM did right the first time. Doesn't *anybody* do literature > searches before doing stuff anymore? ;)
>From your description, IBM also did it wrong the first time. Having an instruction which operates differently when running on bare metal vs. in a hypervisor is never acceptible unless the instruction is trappable.
There will always be a guest which refuses to operate propely in a hypervisor, either by defect or by design, so 'sensitive' instructions should always be trappable. Do it right and you can nest recursively ;)
Zach
| |