From: Yan Li <elliot.li.tech@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Yan Li <elliot.li.tech@gmail.com>,
linux-kernel@vger.kernel.org, joerg.roedel@amd.com,
rjmaomao@gmail.com, Yinghai Lu <yhlu.kernel@gmail.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
nancydreaming@gmail.com
Subject: Re: [PATCH 1/2] VMware detection support for x86 and x86-64
Date: Tue, 9 Sep 2008 08:20:56 +0800 [thread overview]
Message-ID: <20080909002055.GA8573@yantp.cn.ibm.com> (raw)
In-Reply-To: <20080908140423.GG11993@elte.hu>
On Mon, Sep 08, 2008 at 04:04:23PM +0200, Ingo Molnar wrote:
> hm, i know it's not your fault as you just took this vmware code, but
> this is really not an acceptable method of detection. The above is
> totally unsafe to do on native hardware - we dont know whether there's
> anything on that port.
Yeah, I agree with you, it's a bad method. I just took it for granted
that vmware has done the necessary study and they knew what they were
doing. I have tested it on two boxes so I thought they were OK. Now I
agree it's a bit dangerous to put this in a general purpose kernel.
> vmware could have used one of the following methods to communicate to
> the guest kernel:
>
> - a CPUID and an MSR range - like a good virtual CPU should. That way
> even bootloaders could detect the presence of vmware.
They haven't done this. Per VMware's design, the cpuinfo in virtual
guest is identical to the underlying physical CPU. I guess they want
to send most of the code to run on underlying CPU directly and won't
have to do code mutation or emulation and get better performance.
> - or a PCI ID and a PCI driver like KVM does
Yup. But checking DMI would be easier for us.
> - or a system call hypercall gateway like Xen and KVM does
I think they didn't use this way cause VMware wanted it to be
OS-neutral.
> - or it could even have used a DMI signature of some sort
Some people are using this idea. From dmidcode, the VMware-related
parts are:
Handle 0x0001, DMI type 1, 25 bytes
System Information
Manufacturer: VMware, Inc.
Product Name: VMware Virtual Platform
Version: None
Serial Number: VMware-56 4d d2 bf 8d ea 6e ec-81 67 6d 50 42
72 07 46
UUID: 564DD2BF-8DEA-6EEC-8167-6D5042720746
Wake-up Type: Power Switch
............
Handle 0x001A, DMI type 10, 8 bytes
On Board Device 1 Information
Type: Video
Status: Disabled
Description: VMware SVGA II
I think it's pretty safe to assume all VMware products include
"[VM|vm]ware" in the manufacturer.
> but no, vmware had to use 30 year old unsafe ISA port magic...
>
> To add insult to injury that port is named 'backdoor' - very smart and
> confidence raising naming. Plus it does not even use some well-known PC
> port that is harmless to read - it has to be from the middle of the
> generic IO port resource range where a real PCI card could sit: 0x5658.
> Brilliant.
>
> is there really no vmware PCI ID to query? Could you post the lspci -v
> output of your vmware guest? We could add an early-quirk for one of the
> core vmware PCI devices (in case there are any - i bet there are).
VMware may change the PCI ID at their will so I prefer checking the
DMI since it's easier.
So if we ditched the official method we run the risk of some false
negatives. But checking the DMI manufacturer would be good enough.
--
Li, Yan
"Everything that is really great and inspiring is created by the
individual who can labor in freedom."
- Albert Einstein, in Out of My Later Years (1950)
next prev parent reply other threads:[~2008-09-09 0:21 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-21 11:32 [PATCH] X86: remove WARN_ON if MTRRs are all blank Joerg Roedel
2008-02-21 11:54 ` Ingo Molnar
2008-02-21 12:47 ` Joerg Roedel
2008-02-21 13:03 ` Ingo Molnar
2008-02-21 13:27 ` Joerg Roedel
2008-09-07 23:45 ` [PATCH 1/2] VMware detection support for x86 and x86-64 Yan Li
2008-09-08 0:36 ` David Dillow
2008-09-08 1:49 ` Yan Li
2008-09-08 14:04 ` Ingo Molnar
2008-09-09 0:20 ` Yan Li [this message]
2008-09-09 0:34 ` H. Peter Anvin
2008-09-09 12:28 ` Yan Li
2008-09-09 20:12 ` H. Peter Anvin
2008-09-16 13:32 ` Yan Li
2008-09-17 10:52 ` Ingo Molnar
2008-09-17 14:03 ` Yan Li
2008-09-17 14:10 ` Ingo Molnar
2008-09-17 15:38 ` H. Peter Anvin
2008-09-24 12:22 ` [PATCH 1/2] VMware guest detection " Yan Li
2008-09-24 14:10 ` Cristi Magherusan
2008-09-24 14:23 ` Yan Li
2008-09-24 16:19 ` Alok kataria
2008-09-24 16:21 ` H. Peter Anvin
2008-09-25 0:19 ` Yan Li
2008-09-25 0:15 ` Yan Li
2008-09-25 0:26 ` H. Peter Anvin
2008-09-25 2:34 ` Yan Li
2008-09-24 18:13 ` Cristi Magherusan
2008-09-24 18:16 ` H. Peter Anvin
2008-09-25 0:23 ` Yan Li
2008-09-25 1:28 ` Bernd Eckenfels
2008-09-24 16:19 ` H. Peter Anvin
2008-09-25 0:32 ` Yan Li
2008-09-25 0:37 ` H. Peter Anvin
2008-09-25 2:48 ` Yan Li
2008-09-25 9:56 ` David Sanders
2008-09-25 10:23 ` Yan Li
2008-09-25 2:23 ` Greg KH
2008-09-25 2:47 ` Yan Li
2008-09-25 2:55 ` Greg KH
2008-09-25 3:29 ` Yan Li
2008-09-25 4:54 ` H. Peter Anvin
2008-09-25 12:56 ` Greg KH
2008-09-25 14:38 ` Yan Li
2008-09-25 2:28 ` [PATCH 1/2] VMware detection support " Alok kataria
2008-09-25 4:38 ` H. Peter Anvin
2008-09-25 4:46 ` Alok Kataria
2008-09-25 4:54 ` H. Peter Anvin
2008-09-25 5:02 ` Alok Kataria
2008-09-25 5:04 ` H. Peter Anvin
2008-09-25 5:23 ` Alok Kataria
2008-09-25 5:30 ` H. Peter Anvin
2008-09-25 8:45 ` Alan Cox
2008-09-25 20:48 ` Zachary Amsden
2008-09-25 21:59 ` H. Peter Anvin
2008-09-25 22:20 ` Zachary Amsden
2008-09-25 22:27 ` H. Peter Anvin
2008-09-26 12:27 ` Valdis.Kletnieks
2008-09-26 12:47 ` Gerd Hoffmann
2008-09-26 13:22 ` Valdis.Kletnieks
2008-09-26 17:37 ` H. Peter Anvin
2008-10-03 14:12 ` Pavel Machek
2008-09-26 20:35 ` Zachary Amsden
2008-09-25 22:17 ` David Sanders
2008-09-07 23:47 ` [PATCH 2/2] avoid mtrr warning message when running as VMware guest Yan Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080909002055.GA8573@yantp.cn.ibm.com \
--to=elliot.li.tech@gmail.com \
--cc=hpa@zytor.com \
--cc=joerg.roedel@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nancydreaming@gmail.com \
--cc=rjmaomao@gmail.com \
--cc=tglx@linutronix.de \
--cc=yhlu.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome