From patchwork Thu Jun 18 15:24:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= X-Patchwork-Id: 486352 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40603140271 for ; Fri, 19 Jun 2015 01:29:10 +1000 (AEST) Received: from localhost ([::1]:53320 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5bka-0006lu-F5 for incoming@patchwork.ozlabs.org; Thu, 18 Jun 2015 11:29:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5biz-0002bd-1x for qemu-devel@nongnu.org; Thu, 18 Jun 2015 11:27:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5biy-00042s-6R for qemu-devel@nongnu.org; Thu, 18 Jun 2015 11:27:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39355) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5biy-00042l-0L for qemu-devel@nongnu.org; Thu, 18 Jun 2015 11:27:28 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id A47A4376B9A; Thu, 18 Jun 2015 15:27:27 +0000 (UTC) Received: from potion (dhcp-27-168.brq.redhat.com [10.34.27.168]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t5IFROfe027581; Thu, 18 Jun 2015 11:27:25 -0400 Received: by potion (sSMTP sendmail emulation); Thu, 18 Jun 2015 17:27:24 +0200 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= To: qemu-devel@nongnu.org Date: Thu, 18 Jun 2015 17:24:24 +0200 Message-Id: <1434641064-8405-3-git-send-email-rkrcmar@redhat.com> In-Reply-To: <1434641064-8405-1-git-send-email-rkrcmar@redhat.com> References: <1434641064-8405-1-git-send-email-rkrcmar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: pbonzini@redhat.com, bsd@redhat.com, ehabkost@redhat.com, rth@twiddle.net Subject: [Qemu-devel] [PATCH 2/2] target-i386: automatically raise cpuid level to 0xd 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 We already bump to level 7 if features there are requested, so do the same for 0xD. Signed-off-by: Radim Krčmář --- If we want this behavior, we should not do it by writing a case for every level. target-i386/cpu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index d392cf46f517..7a32ead690d2 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -2796,6 +2796,10 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) env->cpuid_level = 7; } + if (env->features[FEAT_XSAVE] && env->cpuid_level < 0xd) { + env->cpuid_level = 0xd; + } + /* On AMD CPUs, some CPUID[8000_0001].EDX bits must match the bits on * CPUID[1].EDX. */