From patchwork Tue Jun 1 12:33:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 103528 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 o51CY1bS008578 for ; Tue, 1 Jun 2010 12:34:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756343Ab0FAMdx (ORCPT ); Tue, 1 Jun 2010 08:33:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47984 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756088Ab0FAMdt (ORCPT ); Tue, 1 Jun 2010 08:33:49 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o51CXnqo013952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 1 Jun 2010 08:33:49 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o51CXmK6002428 for ; Tue, 1 Jun 2010 08:33:48 -0400 Received: from file.tlv.redhat.com (file.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 07BA5250AD8; Tue, 1 Jun 2010 15:33:47 +0300 (IDT) From: Avi Kivity To: Marcelo Tosatti , Glauber Costa Cc: kvm@vger.kernel.org Subject: [PATCH 2/5] Use get_para_features() from upstream Date: Tue, 1 Jun 2010 15:33:44 +0300 Message-Id: <1275395627-2321-3-git-send-email-avi@redhat.com> In-Reply-To: <1275395627-2321-1-git-send-email-avi@redhat.com> References: <1275395627-2321-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 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, 01 Jun 2010 12:34:02 +0000 (UTC) diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c index 0eb4060..3b9be6d 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -1116,34 +1116,6 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *e, uint32_t function, e->edx = env->regs[R_EDX]; } -struct kvm_para_features { - int cap; - int feature; -} para_features[] = { -#ifdef KVM_CAP_CLOCKSOURCE - { KVM_CAP_CLOCKSOURCE, KVM_FEATURE_CLOCKSOURCE }, -#endif -#ifdef KVM_CAP_NOP_IO_DELAY - { KVM_CAP_NOP_IO_DELAY, KVM_FEATURE_NOP_IO_DELAY }, -#endif -#ifdef KVM_CAP_PV_MMU - { KVM_CAP_PV_MMU, KVM_FEATURE_MMU_OP }, -#endif - { -1, -1 } -}; - -static int get_para_features(CPUState *env) -{ - int i, features = 0; - - for (i = 0; i < ARRAY_SIZE(para_features)-1; i++) { - if (kvm_check_extension(kvm_state, para_features[i].cap)) - features |= (1 << para_features[i].feature); - } - - return features; -} - static void kvm_trim_features(uint32_t *features, uint32_t supported) { int i; diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 87c1133..ac9e17b 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -133,8 +133,6 @@ uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, int reg) #endif -#ifdef KVM_UPSTREAM - #ifdef CONFIG_KVM_PARA struct kvm_para_features { int cap; @@ -165,6 +163,8 @@ static int get_para_features(CPUState *env) } #endif +#ifdef KVM_UPSTREAM + int kvm_arch_init_vcpu(CPUState *env) { struct {