From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: CPU vendor in KVM Date: Sat, 04 May 2013 10:47:09 +0200 Message-ID: <5184CB0D.4010004@web.de> References: <5184C14B.9040100@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2SECEINVKBDVTTEOBBOHG" Cc: qemu-devel@nongnu.org, kvm To: =?UTF-8?B?IuadjuaYpeWlhyA8QXJ0aHVyIENodW5xaSBMaT4i?= Return-path: Received: from mout.web.de ([212.227.15.3]:50549 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756652Ab3EDIrN (ORCPT ); Sat, 4 May 2013 04:47:13 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2SECEINVKBDVTTEOBBOHG Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Please don't top-post. On 2013-05-04 10:45, =E6=9D=8E=E6=98=A5=E5=A5=87 wrote= : > But will the difference between the vendor ID and family number cause > confusion to the OS in VM? The confusion is not yet clear to me. About which "-cpu ..." were you talking? Jan >=20 > On Sat, May 4, 2013 at 4:05 PM, Jan Kiszka wrote: >> On 2013-05-04 09:50, =E6=9D=8E=E6=98=A5=E5=A5=87 wr= ote: >>> Hi Jan and All, >>> I find that when enable KVM with qemu, vendor ID of simulated CPU wil= l be >>> set the same as host, but other features such as level, family, model= , >>> stepping are not changed. This may bring out a confusing result, the >>> simulated CPU has a vendor name of "GenuineIntel" but with family num= ber >>> "16". >>> >>> I disabled the related code in function cpu_x86_find_by_name: >>> diff --git a/target-i386/cpu.c b/target-i386/cpu.c >>> index e2302d8..df0e82e 100644 >>> --- a/target-i386/cpu.c >>> +++ b/target-i386/cpu.c >>> @@ -1295,7 +1295,8 @@ static int cpu_x86_find_by_name(x86_def_t >>> *x86_cpu_def, const char *name) >>> * KVM's sysenter/syscall emulation in compatibility mod= e and >>> * when doing cross vendor migration >>> */ >>> - if (kvm_enabled()) { >>> + //if (kvm_enabled()) { >>> + if (0) { >>> uint32_t ebx =3D 0, ecx =3D 0, edx =3D 0; >>> host_cpuid(0, 0, NULL, &ebx, &ecx, &edx); >>> x86_cpu_vendor_words2str(x86_cpu_def->vendor, ebx, e= dx, >>> ecx); >>> >>> And the information of CPU remains consistent and the VM runs OK, eve= n >>> though with nested environment. >>> >>> Why should qemu set simulated cpu's vendor same as the host in KVM >>> environment? >> >> The reason (and a way out) is given in the comment above the cited cod= e. >> >> Jan >> >> >=20 >=20 >=20 ------enig2SECEINVKBDVTTEOBBOHG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlGEyw0ACgkQitSsb3rl5xQggwCgnOJlNutx2qEFTGR8GxT59Lhi vjoAnj7aJFbKZFaJMgkoTtZTlvMdPEK4 =XL3S -----END PGP SIGNATURE----- ------enig2SECEINVKBDVTTEOBBOHG--