From patchwork Sat May 4 07:50:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5pil5aWH?= X-Patchwork-Id: 241434 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3F2802C00D3 for ; Sat, 4 May 2013 17:51:20 +1000 (EST) Received: from localhost ([::1]:45910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYXFV-0000rc-RD for incoming@patchwork.ozlabs.org; Sat, 04 May 2013 03:51:17 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type; bh=KPJyO692WVoFzqAWdqalWcoekM7z2jVAk5IM9taIiNk=; b=sA3tBaLOTGYpEPMRffFFeNMu8hqClqstu9fF2i3toLDXhOVwkLuepBgaybHaP2d89t 0AyLPAWjWTvkPBVbX3MqOOMBbK7I1fUn5b/BHLUGh7eAeq+mfNap6e4zujP9phzVfiwh SAEgH+Mf0zyKt7Z+8WRGsoZkEJYYtZbcksoKRpH+Su9HOf6U9QLotEoBbQAt7mzYuGWE Gd3A9WIytdC8f1TdJVM+CBY/vQ/PeJIDSX/O0Ryln2TMIse+2isng2mx9pWt/wgWRKSR Q1OPJAmUx+dg2Z4vXD+p1RKm4Rl+xqjJpCNRF+KOgGCeyNPAmjO9YTIgKq8Bhxrs2aDn /Bsg== MIME-Version: 1.0 X-Received: by 10.112.155.99 with SMTP id vv3mr5334585lbb.67.1367653851905; Sat, 04 May 2013 00:50:51 -0700 (PDT) Received: by 10.112.73.67 with HTTP; Sat, 4 May 2013 00:50:51 -0700 (PDT) Date: Sat, 4 May 2013 15:50:51 +0800 Message-ID: From: =?UTF-8?B?5p2O5pil5aWHIDxBcnRodXIgQ2h1bnFpIExpPg==?= To: qemu-devel@nongnu.org, kvm X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::233 Cc: Jan Kiszka Subject: [Qemu-devel] CPU vendor in KVM X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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: 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? 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);