From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYXFC-0000r7-0a for qemu-devel@nongnu.org; Sat, 04 May 2013 03:51:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UYXF7-0004h6-NK for qemu-devel@nongnu.org; Sat, 04 May 2013 03:50:57 -0400 Received: from mail-la0-x233.google.com ([2a00:1450:4010:c03::233]:48796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYXF7-0004gh-Ff for qemu-devel@nongnu.org; Sat, 04 May 2013 03:50:53 -0400 Received: by mail-la0-f51.google.com with SMTP id ep20so2119343lab.10 for ; Sat, 04 May 2013 00:50:51 -0700 (PDT) MIME-Version: 1.0 Date: Sat, 4 May 2013 15:50:51 +0800 Message-ID: From: =?UTF-8?B?5p2O5pil5aWHIDxBcnRodXIgQ2h1bnFpIExpPg==?= Content-Type: multipart/alternative; boundary=047d7b62471804c58b04dbdfba8b Subject: [Qemu-devel] CPU vendor in KVM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, kvm Cc: Jan Kiszka --047d7b62471804c58b04dbdfba8b Content-Type: text/plain; charset=ISO-8859-1 Hi Jan and All, I find that when enable KVM with qemu, vendor ID of simulated CPU will 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 number "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 mode and * when doing cross vendor migration */ - if (kvm_enabled()) { + //if (kvm_enabled()) { + if (0) { uint32_t ebx = 0, ecx = 0, edx = 0; host_cpuid(0, 0, NULL, &ebx, &ecx, &edx); x86_cpu_vendor_words2str(x86_cpu_def->vendor, ebx, edx, ecx); And the information of CPU remains consistent and the VM runs OK, even though with nested environment. Why should qemu set simulated cpu's vendor same as the host in KVM environment? -- Arthur Chunqi Li Department of Computer Science School of EECS Peking University Beijing, China --047d7b62471804c58b04dbdfba8b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Jan and All,
I find that when enable KVM= with qemu, vendor ID of simulated CPU will be set the same as host, but ot= her features such as level, family, model, stepping are not changed. This m= ay bring out a confusing result, the simulated CPU has a vendor name of &qu= ot;GenuineIntel" but with family number "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)
=A0 = =A0 =A0 =A0 =A0 =A0 =A0 * KVM's sysenter/syscall emulation in compatibi= lity mode and
=A0 =A0 =A0 =A0 =A0 =A0 =A0 * when doing cross vendor migration
<= div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 */
- =A0 =A0 =A0 =A0 =A0 =A0if (k= vm_enabled()) {
+ =A0 =A0 =A0 =A0 =A0 =A0//if (kvm_enabled()) {
+ =A0 =A0 =A0 =A0 =A0 =A0if (0) {
=A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0uint32_t =A0ebx =3D 0, ecx =3D 0, edx =3D 0;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0host_cpuid(0, 0, NULL, &ebx, &a= mp;ecx, &edx);
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0x86_cpu_ven= dor_words2str(x86_cpu_def->vendor, ebx, edx, ecx);

<= div>And the information of CPU remains consistent and the VM runs OK, even = though with nested environment.

Why should qemu set simulated cpu's vendor same as = the host in KVM environment?

--=A0
Arthu= r Chunqi Li
Department of Computer Science
School of EE= CS
Peking University
Beijing, China
--047d7b62471804c58b04dbdfba8b--