From patchwork Mon Nov 9 21:05:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hollis Blanchard X-Patchwork-Id: 38031 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 DF902B7B77 for ; Tue, 10 Nov 2009 11:23:29 +1100 (EST) Received: from localhost ([127.0.0.1]:53130 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7bdN-0007J2-VQ for incoming@patchwork.ozlabs.org; Mon, 09 Nov 2009 16:18:46 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7bXK-0000nk-TC for qemu-devel@nongnu.org; Mon, 09 Nov 2009 16:12:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7bXG-0000jY-IQ for qemu-devel@nongnu.org; Mon, 09 Nov 2009 16:12:30 -0500 Received: from [199.232.76.173] (port=32812 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7bXG-0000jA-28 for qemu-devel@nongnu.org; Mon, 09 Nov 2009 16:12:26 -0500 Received: from e9.ny.us.ibm.com ([32.97.182.139]:46137) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N7bXE-0006vF-2f for qemu-devel@nongnu.org; Mon, 09 Nov 2009 16:12:25 -0500 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by e9.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id nA9L7RUx027810 for ; Mon, 9 Nov 2009 16:07:27 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nA9LCMXq868370 for ; Mon, 9 Nov 2009 16:12:22 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nA9H7enq022838 for ; Mon, 9 Nov 2009 12:07:40 -0500 Received: from localhost.localdomain (sig-9-65-196-233.mts.ibm.com [9.65.196.233]) by d01av02.pok.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id nA9H7bqs022720; Mon, 9 Nov 2009 12:07:39 -0500 MIME-Version: 1.0 X-Mercurial-Node: 204026d59328febd9789b02ca50094d9ee8504f9 Message-Id: <204026d59328febd9789.1257800737@localhost.localdomain> In-Reply-To: References: User-Agent: Mercurial-patchbomb/1.3.1 Date: Mon, 09 Nov 2009 21:05:37 -0000 From: Hollis Blanchard To: aliguori@us.ibm.com X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: qemu-devel@nongnu.org, kvm-ppc@vger.kernel.org Subject: [Qemu-devel] [PATCH 1 of 2] kvm: Move KVM mp_state accessors to i386-specific code 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 Unbreaks PowerPC and S390 KVM builds. Signed-off-by: Hollis Blanchard diff --git a/kvm-all.c b/kvm-all.c --- a/kvm-all.c +++ b/kvm-all.c @@ -207,26 +207,6 @@ err: return ret; } -int kvm_put_mp_state(CPUState *env) -{ - struct kvm_mp_state mp_state = { .mp_state = env->mp_state }; - - return kvm_vcpu_ioctl(env, KVM_SET_MP_STATE, &mp_state); -} - -int kvm_get_mp_state(CPUState *env) -{ - struct kvm_mp_state mp_state; - int ret; - - ret = kvm_vcpu_ioctl(env, KVM_GET_MP_STATE, &mp_state); - if (ret < 0) { - return ret; - } - env->mp_state = mp_state.mp_state; - return 0; -} - /* * dirty pages logging control */ diff --git a/kvm.h b/kvm.h --- a/kvm.h +++ b/kvm.h @@ -74,9 +74,6 @@ int kvm_vm_ioctl(KVMState *s, int type, int kvm_vcpu_ioctl(CPUState *env, int type, ...); -int kvm_get_mp_state(CPUState *env); -int kvm_put_mp_state(CPUState *env); - /* Arch specific hooks */ int kvm_arch_post_run(CPUState *env, struct kvm_run *run); diff --git a/target-i386/kvm.c b/target-i386/kvm.c --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -659,6 +659,26 @@ static int kvm_get_msrs(CPUState *env) return 0; } +static int kvm_put_mp_state(CPUState *env) +{ + struct kvm_mp_state mp_state = { .mp_state = env->mp_state }; + + return kvm_vcpu_ioctl(env, KVM_SET_MP_STATE, &mp_state); +} + +static int kvm_get_mp_state(CPUState *env) +{ + struct kvm_mp_state mp_state; + int ret; + + ret = kvm_vcpu_ioctl(env, KVM_GET_MP_STATE, &mp_state); + if (ret < 0) { + return ret; + } + env->mp_state = mp_state.mp_state; + return 0; +} + int kvm_arch_put_registers(CPUState *env) { int ret;