From patchwork Wed Feb 3 21:29:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 76820 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 o13LUJuJ014984 for ; Wed, 3 Feb 2010 21:30:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932632Ab0BCVaR (ORCPT ); Wed, 3 Feb 2010 16:30:17 -0500 Received: from goliath.siemens.de ([192.35.17.28]:21966 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932473Ab0BCVaK (ORCPT ); Wed, 3 Feb 2010 16:30:10 -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 o13LTkXD013379; Wed, 3 Feb 2010 22:29:46 +0100 Received: from localhost.localdomain ([139.25.173.3]) by mail2.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o13LTjGt031176; Wed, 3 Feb 2010 22:29:46 +0100 From: Jan Kiszka To: Anthony Liguori Cc: qemu-devel@nongnu.org, Avi Kivity , Marcelo Tosatti , kvm@vger.kernel.org Subject: [PATCH 1/4] KVM: x86: Fix up misreported CPU features Date: Wed, 3 Feb 2010 22:29:42 +0100 Message-Id: <02a899fb369da18934728821b07a27c0cca97f6f.1265232579.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]); Wed, 03 Feb 2010 21:30:20 +0000 (UTC) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 5b093ce..f690b2e 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -99,12 +99,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; }