From patchwork Tue Sep 28 10:05:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 65952 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 D0E02B70A5 for ; Tue, 28 Sep 2010 20:06:20 +1000 (EST) Received: from localhost ([127.0.0.1]:46359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0X4i-0008LK-F3 for incoming@patchwork.ozlabs.org; Tue, 28 Sep 2010 06:06:16 -0400 Received: from [140.186.70.92] (port=42877 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0X3g-0008LF-7S for qemu-devel@nongnu.org; Tue, 28 Sep 2010 06:05:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0X3b-0001Qx-3e for qemu-devel@nongnu.org; Tue, 28 Sep 2010 06:05:12 -0400 Received: from tx2ehsobe005.messaging.microsoft.com ([65.55.88.15]:22302 helo=TX2EHSOBE010.bigfish.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0X3a-0001Qf-QQ for qemu-devel@nongnu.org; Tue, 28 Sep 2010 06:05:07 -0400 Received: from mail59-tx2-R.bigfish.com (10.9.14.249) by TX2EHSOBE010.bigfish.com (10.9.40.30) with Microsoft SMTP Server id 8.1.340.0; Tue, 28 Sep 2010 10:05:05 +0000 Received: from mail59-tx2 (localhost.localdomain [127.0.0.1]) by mail59-tx2-R.bigfish.com (Postfix) with ESMTP id 003B1C0835E; Tue, 28 Sep 2010 10:05:05 +0000 (UTC) X-SpamScore: -42 X-BigFish: VS-42(zzbb2dK10e3M1432N98dN148cM9371Pzz1202hzz8275bh15d4Rz32i87h2a8h43h61h) X-FB-DOMAIN-IP-MATCH: fail Received: from mail59-tx2 (localhost.localdomain [127.0.0.1]) by mail59-tx2 (MessageSwitch) id 1285668304489647_15751; Tue, 28 Sep 2010 10:05:04 +0000 (UTC) Received: from TX2EHSMHS038.bigfish.com (unknown [10.9.14.235]) by mail59-tx2.bigfish.com (Postfix) with ESMTP id 69B03DD804F; Tue, 28 Sep 2010 10:05:04 +0000 (UTC) Received: from ausb3extmailp01.amd.com (163.181.251.8) by TX2EHSMHS038.bigfish.com (10.9.99.138) with Microsoft SMTP Server (TLS) id 14.0.482.44; Tue, 28 Sep 2010 10:05:04 +0000 Received: from ausb3twp01.amd.com ([163.181.250.37]) by ausb3extmailp01.amd.com (Switch-3.2.7/Switch-3.2.7) with SMTP id o8SA8c0q024450; Tue, 28 Sep 2010 05:08:42 -0500 X-WSS-ID: 0L9GC07-01-7IJ-02 X-M-MSG: Received: from sausexhtp01.amd.com (sausexhtp01.amd.com [163.181.3.165]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by ausb3twp01.amd.com (Tumbleweed MailGate 3.7.2) with ESMTP id 2D4BE1028549; Tue, 28 Sep 2010 05:04:55 -0500 (CDT) Received: from storexhtp02.amd.com (172.24.4.4) by sausexhtp01.amd.com (163.181.3.165) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 28 Sep 2010 05:04:58 -0500 Received: from gwo.osrc.amd.com (165.204.16.204) by storexhtp02.amd.com (172.24.4.4) with Microsoft SMTP Server id 8.3.83.0; Tue, 28 Sep 2010 06:04:58 -0400 Received: from lemmy.osrc.amd.com (lemmy.osrc.amd.com [165.204.15.93]) by gwo.osrc.amd.com (Postfix) with ESMTP id F0E8849C121; Tue, 28 Sep 2010 11:04:57 +0100 (BST) Received: by lemmy.osrc.amd.com (Postfix, from userid 1000) id AA6CCA06ED; Tue, 28 Sep 2010 12:05:20 +0200 (CEST) Date: Tue, 28 Sep 2010 12:05:20 +0200 From: "Roedel, Joerg" To: Avi Kivity Message-ID: <20100928100520.GL9817@amd.com> References: <1285593377-1754-1-git-send-email-joerg.roedel@amd.com> <1285593377-1754-4-git-send-email-joerg.roedel@amd.com> <4CA0B116.4070107@redhat.com> <4CA0B1FF.8040903@redhat.com> <20100927154049.GI9817@amd.com> <4CA0C4B5.2010303@redhat.com> <20100928092851.GK9817@amd.com> <4CA1B776.20105@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4CA1B776.20105@redhat.com> Organization: Advanced Micro Devices =?iso-8859-1?Q?GmbH?= =?iso-8859-1?Q?=2C_Karl-Hammerschmidt-Str=2E_34=2C_85609_Dornach_bei_M=FC?= =?iso-8859-1?Q?nchen=2C_Gesch=E4ftsf=FChrer=3A_Thomas_M=2E_McCoy=2C_Giuli?= =?iso-8859-1?Q?ano_Meroni=2C_Andrew_Bowd=2C_Sitz=3A_Dornach=2C_Gemeinde_A?= =?iso-8859-1?Q?schheim=2C_Landkreis_M=FCnchen=2C_Registergericht_M=FCnche?= =?iso-8859-1?Q?n=2C?= HRB Nr. 43632 User-Agent: Mutt/1.5.20 (2009-06-14) X-Reverse-DNS: unknown X-detected-operating-system: by eggs.gnu.org: Windows 2000 SP4, XP SP1+ Cc: Marcelo Tosatti , Alexander Graf , "kvm@vger.kernel.org" , "qemu-devel@nongnu.org" Subject: [Qemu-devel] Re: [PATCH 3/3] Add svm cpuid features 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 On Tue, Sep 28, 2010 at 05:37:58AM -0400, Avi Kivity wrote: > On 09/28/2010 11:28 AM, Roedel, Joerg wrote: > > Weird, it worked here as I tested it. I had it on qemu/master and with > > all three patches. But patch 1 should not make the difference. I take a > > look, have you pushed the failing uq/master? > > Yes, 8fe6a21c76. > > > What was your command line? > > qemu-system-x86_64 -m 2G -cpu kvm64,+svm,+npt -enable-kvm ... > > Note this is qemu.git, so -enable-kvm is needed. Ok, I apparently forgot to force the CPUID xlevel to be 0x8000000A when SVM is enabled, probably because I only tested CPUID models where xlevel already defaults to 0x8000000A. Attached is a fix, thanks for catching this. Joerg From d18d973d037f1af1869e114aea1f076ea3a1ee7a Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Tue, 28 Sep 2010 11:58:49 +0200 Subject: [PATCH 1/1] qemu: Force xlevel to at least 0x8000000A if SVM is enabled This patch forces the extended CPUID level to be at least 0x8000000A if SVM is enabled in the CPU model. Signed-off-by: Joerg Roedel --- target-i386/cpuid.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index 0e0bf60..0630fe1 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -714,6 +714,11 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *cpu_model) x86_cpu_def->ext3_features &= ~minus_ext3_features; x86_cpu_def->kvm_features &= ~minus_kvm_features; x86_cpu_def->svm_features &= ~minus_svm_features; + if ((x86_cpu_def->ext3_features & CPUID_EXT3_SVM) && + (x86_cpu_def->xlevel < 0x8000000A)) { + /* Force xlevel to at least 0x8000000A if SVM enabled */ + x86_cpu_def->xlevel = 0x8000000A; + } if (check_cpuid) { if (check_features_against_host(x86_cpu_def) && enforce_cpuid) goto error;