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

H. Peter Anvin
2008-09-25T22:00:36Z

Zachary Amsden wrote:
>
> The whole backdoor thing is also broken because it requires
> non-architectural side effects to operate (IN instructions can not
> arbitrarily change all GPRs). This can confuse applications which are
> very smart and try to single step over the instruction by emulating it,
> logging the port I/O, then restoring GPRs to the state before execution
> and writing the 1 register affected by the IN. Such clever debuggers
> and profiling tools have been written.
>

To be fair, SMM sometimes also play these kinds of games -- even though
it is equally frowned upon there.

However, it is the particular use of this for detection use that is
utterly damning. Using random I/O port probes for hardware detect
should have disappeared in the early 1990's, and it's really disturbing
that virtualization vendors -- not just VMWare -- are, in effect,
re-making all the mistakes hardware vendors did in the 1980's.

Fortunately, we can usually use DMI to bail us out. Just like we used
to look for magic strings in the VGA BIOS so we could figure out what
exact kind of SuperVGA card we have.

-hpa