Re: [PATCH 1/2] VMware detection support for x86 and x86-64

From: Zachary Amsden
Date: Fri Sep 26 2008 - 16:37:45 EST


On Fri, 2008-09-26 at 06:22 -0700, Valdis.Kletnieks@xxxxxx 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/