From patchwork Thu Apr 22 10:57:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 94088 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3MAwLgM027043 for ; Thu, 22 Apr 2010 10:58:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754194Ab0DVK6S (ORCPT ); Thu, 22 Apr 2010 06:58:18 -0400 Received: from va3ehsobe002.messaging.microsoft.com ([216.32.180.12]:40119 "EHLO VA3EHSOBE002.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754172Ab0DVK6R (ORCPT ); Thu, 22 Apr 2010 06:58:17 -0400 Received: from mail14-va3-R.bigfish.com (10.7.14.244) by VA3EHSOBE002.bigfish.com (10.7.40.22) with Microsoft SMTP Server id 8.1.240.5; Thu, 22 Apr 2010 10:58:15 +0000 Received: from mail14-va3 (localhost.localdomain [127.0.0.1]) by mail14-va3-R.bigfish.com (Postfix) with ESMTP id 9B2FEC687C3; Thu, 22 Apr 2010 10:58:15 +0000 (UTC) X-SpamScore: 1 X-BigFish: VPS1(zzab9bhzz1202hzzz32i2a8h87h43h61h) X-Spam-TCS-SCL: 0:0 X-FB-DOMAIN-IP-MATCH: fail Received: from mail14-va3 (localhost.localdomain [127.0.0.1]) by mail14-va3 (MessageSwitch) id 1271933895221073_18915; Thu, 22 Apr 2010 10:58:15 +0000 (UTC) Received: from VA3EHSMHS010.bigfish.com (unknown [10.7.14.249]) by mail14-va3.bigfish.com (Postfix) with ESMTP id 2F63F168053; Thu, 22 Apr 2010 10:58:15 +0000 (UTC) Received: from ausb3extmailp01.amd.com (163.181.251.8) by VA3EHSMHS010.bigfish.com (10.7.99.20) with Microsoft SMTP Server (TLS) id 14.0.482.44; Thu, 22 Apr 2010 10:58:13 +0000 Received: from ausb3twp02.amd.com ([163.181.250.38]) by ausb3extmailp01.amd.com (Switch-3.2.7/Switch-3.2.7) with SMTP id o3MAq6tB015348; Thu, 22 Apr 2010 05:52:09 -0500 X-WSS-ID: 0L19YGT-02-1TR-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 ausb3twp02.amd.com (Tumbleweed MailGate 3.7.2) with ESMTP id 25290FCC16D; Thu, 22 Apr 2010 05:58:05 -0500 (CDT) Received: from storexhtp01.amd.com (172.24.4.3) by sausexhtp01.amd.com (163.181.3.165) with Microsoft SMTP Server (TLS) id 8.2.234.1; Thu, 22 Apr 2010 03:58:08 -0700 Received: from storexmb1.amd.com (10.1.1.14) by storexhtp01.amd.com (172.24.4.3) with Microsoft SMTP Server id 8.2.234.1; Thu, 22 Apr 2010 03:58:07 -0700 Received: from sausexmb1.amd.com ([163.181.3.156]) by storexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 22 Apr 2010 06:58:07 -0400 Received: from seurexmb1.amd.com ([165.204.9.130]) by sausexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 22 Apr 2010 05:58:06 -0500 Received: from lemmy.osrc.amd.com ([165.204.15.93]) by seurexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 22 Apr 2010 12:58:03 +0200 Received: by lemmy.osrc.amd.com (Postfix, from userid 41430) id CF86EC9AB3; Thu, 22 Apr 2010 12:58:03 +0200 (CEST) From: Joerg Roedel To: Avi Kivity , Anthony Liguori CC: kvm@vger.kernel.org, Joerg Roedel Subject: [PATCH] qemu-kvm: Ask kernel about supported svm features Date: Thu, 22 Apr 2010 12:57:59 +0200 Message-ID: <1271933879-15849-1-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.7.0.4 X-OriginalArrivalTime: 22 Apr 2010 10:58:03.0999 (UTC) FILETIME=[AE945EF0:01CAE20A] MIME-Version: 1.0 X-Reverse-DNS: unknown Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 22 Apr 2010 10:58:26 +0000 (UTC) diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c index 748ff69..6eccd69 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -1327,8 +1327,18 @@ int kvm_arch_init_vcpu(CPUState *cenv) qemu_kvm_cpuid_on_env(©); limit = copy.regs[R_EAX]; - for (i = 0x80000000; i <= limit; ++i) - do_cpuid_ent(&cpuid_ent[cpuid_nent++], i, 0, ©); + for (i = 0x80000000; i <= limit; ++i) { + do_cpuid_ent(&cpuid_ent[cpuid_nent], i, 0, ©); + switch (i) { + case 0x8000000a: + cpuid_ent[cpuid_nent].eax = kvm_arch_get_supported_cpuid(cenv, 0x8000000a, R_EAX); + cpuid_ent[cpuid_nent].ebx = kvm_arch_get_supported_cpuid(cenv, 0x8000000a, R_EBX); + cpuid_ent[cpuid_nent].ebx = kvm_arch_get_supported_cpuid(cenv, 0x8000000a, R_EBX); + cpuid_ent[cpuid_nent].edx = kvm_arch_get_supported_cpuid(cenv, 0x8000000a, R_EDX); + break; + } + cpuid_nent += 1; + } kvm_setup_cpuid2(cenv, cpuid_nent, cpuid_ent);