From patchwork Tue Feb 2 08:18:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 76312 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 o128JeOZ029958 for ; Tue, 2 Feb 2010 08:19:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754858Ab0BBITh (ORCPT ); Tue, 2 Feb 2010 03:19:37 -0500 Received: from goliath.siemens.de ([192.35.17.28]:18303 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753541Ab0BBITe (ORCPT ); Tue, 2 Feb 2010 03:19:34 -0500 Received: from mail2.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o128JAGR013812; Tue, 2 Feb 2010 09:19:10 +0100 Received: from localhost.localdomain ([139.25.173.39]) by mail2.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o128J7sK008551; Tue, 2 Feb 2010 09:19:10 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Cc: kvm@vger.kernel.org, Anthony Liguori , Alexander Graf , Glauber Costa , qemu-devel@nongnu.org Subject: [PATCH 04/21] KVM: x86: Fix up misreported CPU features Date: Tue, 2 Feb 2010 09:18:50 +0100 Message-Id: <46da1a46a36f5dcbda7852fb60ef330b49755fa4.1265098706.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: References: In-Reply-To: References: 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]); Tue, 02 Feb 2010 08:19:40 +0000 (UTC) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 504f501..9fb96b5 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -101,12 +101,18 @@ uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, int reg) break; case R_EDX: ret = cpuid->entries[i].edx; - if (function == 0x80000001) { + switch (function) { + case 1: + /* KVM before 2.6.30 misreports the following features */ + ret |= CPUID_MTRR | CPUID_PAT | CPUID_MCE | CPUID_MCA; + break; + case 0x80000001: /* On Intel, kvm returns cpuid according to the Intel spec, * so add missing bits according to the AMD spec: */ cpuid_1_edx = kvm_arch_get_supported_cpuid(env, 1, R_EDX); ret |= cpuid_1_edx & 0xdfeff7ff; + break; } break; }