From patchwork Mon Apr 30 14:42:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 155878 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 27298B6FA1 for ; Tue, 1 May 2012 00:42:28 +1000 (EST) Received: from localhost ([::1]:34950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SOro2-0008H0-2w for incoming@patchwork.ozlabs.org; Mon, 30 Apr 2012 10:42:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SOrns-0008GJ-85 for qemu-devel@nongnu.org; Mon, 30 Apr 2012 10:42:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SOrnp-0001tG-KU for qemu-devel@nongnu.org; Mon, 30 Apr 2012 10:42:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SOrnp-0001sh-Cr for qemu-devel@nongnu.org; Mon, 30 Apr 2012 10:42:13 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3UEgBnS013011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 30 Apr 2012 10:42:11 -0400 Received: from redhat.com (vpn-202-127.tlv.redhat.com [10.35.202.127]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id q3UEg60J019885; Mon, 30 Apr 2012 10:42:07 -0400 Date: Mon, 30 Apr 2012 17:42:15 +0300 From: "Michael S. Tsirkin" To: Avi Kivity , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org Message-ID: <20120430144214.GA10237@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: davej@redhat.com Subject: [Qemu-devel] [PATCH] qemu: fix cpuid eax for kvm cpu 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 cpuid eax should return the max leaf so that guests can find out the valid range. This matches Xen et al. Tested using -cpu kvm64. Signed-off-by: Michael S. Tsirkin --- target-i386/kvm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index e74a9e4..c097248 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -379,7 +379,7 @@ int kvm_arch_init_vcpu(CPUX86State *env) c->function = KVM_CPUID_SIGNATURE; if (!hyperv_enabled()) { memcpy(signature, "KVMKVMKVM\0\0\0", 12); - c->eax = 0; + c->eax = KVM_CPUID_FEATURES; } else { memcpy(signature, "Microsoft Hv", 12); c->eax = HYPERV_CPUID_MIN;