From patchwork Mon Jun 28 16:14:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 57163 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E61DFB6EEC for ; Tue, 29 Jun 2010 02:29:25 +1000 (EST) Received: from localhost ([127.0.0.1]:47880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTHCz-0001VS-Cv for incoming@patchwork.ozlabs.org; Mon, 28 Jun 2010 12:29:21 -0400 Received: from [140.186.70.92] (port=46661 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTGzp-0006Vk-PI for qemu-devel@nongnu.org; Mon, 28 Jun 2010 12:15:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OTGzm-0001Cj-E5 for qemu-devel@nongnu.org; Mon, 28 Jun 2010 12:15:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33307) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OTGzm-0001CY-5y for qemu-devel@nongnu.org; Mon, 28 Jun 2010 12:15:42 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5SGFeaj020423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 28 Jun 2010 12:15:40 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5SGFdh2024447; Mon, 28 Jun 2010 12:15:39 -0400 Received: from amt.cnet (vpn2-11-80.ams2.redhat.com [10.36.11.80]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o5SGFbZO017391; Mon, 28 Jun 2010 12:15:38 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 15A3768A892; Mon, 28 Jun 2010 13:14:32 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o5SGESws007578; Mon, 28 Jun 2010 13:14:28 -0300 From: Marcelo Tosatti To: Anthony Liguori Date: Mon, 28 Jun 2010 13:14:09 -0300 Message-Id: <8935499831312ec3e108287d3d49614915847ab2.1277741654.git.mtosatti@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Andre Przywara , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 2/7] fix CPUID vendor override X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Andre Przywara the meaning of vendor_override is actually the opposite of how it is currently used :-( Fix it to allow KVM to export the non-native CPUID vendor if explicitly requested by the user. The intended behavior is: With TCG: - always inject the configured vendor (either hard-coded, in config files or via ",vendor=" commandline) With KVM: - by default inject the host's vendor - if the user specifies ",vendor=" on the commandline, use this instead of the host's vendor - all pre-configured vendors (hard-coded, config file) are ignored Signed-off-by: Andre Przywara Signed-off-by: Marcelo Tosatti --- target-i386/cpuid.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index 6a0f7ca..fe0e6b2 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -982,7 +982,7 @@ static void get_cpuid_vendor(CPUX86State *env, uint32_t *ebx, * this if you want to use KVM's sysenter/syscall emulation * in compatibility mode and when doing cross vendor migration */ - if (kvm_enabled() && env->cpuid_vendor_override) { + if (kvm_enabled() && ! env->cpuid_vendor_override) { host_cpuid(0, 0, NULL, ebx, ecx, edx); } }