From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ehrhardt Christian Date: Mon, 03 Nov 2008 17:16:40 +0000 Subject: [PATCH] kvm-userspace: move x86 specific calls introduced by device Message-Id: <2e906c6317462fb1b551.1225732600@HelionPrime> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, avi@redhat.com Cc: ehrhardt@linux.vnet.ibm.com, hollisb@us.ibm.com, muli@il.ibm.com The device asignment patches added the x86 specific ioperm in qemu-kvm. This patch moves qemu-kvm.c:kvm_do_ioperm() to qemu-kvm-x86.c:kvm_arch_do_ioperm() The patch also changes the qemu-kvm header and the includes according to that. Signed-off-by: Christian Ehrhardt --- [diffstat] qemu-kvm-x86.c | 7 +++++++ qemu-kvm.c | 11 +++-------- qemu-kvm.h | 3 +++ 3 files changed, 13 insertions(+), 8 deletions(-) [diff] diff --git a/qemu/qemu-kvm-x86.c b/qemu/qemu-kvm-x86.c --- a/qemu/qemu-kvm-x86.c +++ b/qemu/qemu-kvm-x86.c @@ -11,6 +11,7 @@ #include #include "hw/hw.h" +#include #include "qemu-kvm.h" #include @@ -717,3 +718,9 @@ } } } + +void kvm_arch_do_ioperm(void *_data) +{ + struct ioperm_data *data = _data; + ioperm(data->start_port, data->num, data->turn_on); +} diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c --- a/qemu/qemu-kvm.c +++ b/qemu/qemu-kvm.c @@ -27,7 +27,6 @@ #include #include #include -#include #define bool _Bool #define false 0 @@ -1049,14 +1048,10 @@ return kvm_unregister_coalesced_mmio(kvm_context, addr, size); } -static void kvm_do_ioperm(void *_data) -{ - struct ioperm_data *data = _data; - ioperm(data->start_port, data->num, data->turn_on); -} - +#ifdef USE_KVM_DEVICE_ASSIGNMENT void kvm_ioperm(CPUState *env, void *data) { if (kvm_enabled() && qemu_system_ready) - on_vcpu(env, kvm_do_ioperm, data); + on_vcpu(env, kvm_arch_do_ioperm, data); } +#endif diff --git a/qemu/qemu-kvm.h b/qemu/qemu-kvm.h --- a/qemu/qemu-kvm.h +++ b/qemu/qemu-kvm.h @@ -93,7 +93,10 @@ void qemu_kvm_system_reset_request(void); +#ifdef USE_KVM_DEVICE_ASSIGNMENT void kvm_ioperm(CPUState *env, void *data); +void kvm_arch_do_ioperm(void *_data); +#endif #ifdef TARGET_PPC int handle_powerpc_dcr_read(int vcpu, uint32_t dcrn, uint32_t *data); From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ehrhardt Christian Subject: [PATCH] kvm-userspace: move x86 specific calls introduced by device assignement to x86 files Date: Mon, 03 Nov 2008 18:16:40 +0100 Message-ID: <2e906c6317462fb1b551.1225732600@HelionPrime> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: ehrhardt@linux.vnet.ibm.com, hollisb@us.ibm.com, muli@il.ibm.com To: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, avi@redhat.com Return-path: Received: from mtagate2.uk.ibm.com ([194.196.100.162]:47089 "EHLO mtagate2.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751016AbYKCRQo (ORCPT ); Mon, 3 Nov 2008 12:16:44 -0500 Sender: kvm-owner@vger.kernel.org List-ID: The device asignment patches added the x86 specific ioperm in qemu-kvm. This patch moves qemu-kvm.c:kvm_do_ioperm() to qemu-kvm-x86.c:kvm_arch_do_ioperm() The patch also changes the qemu-kvm header and the includes according to that. Signed-off-by: Christian Ehrhardt --- [diffstat] qemu-kvm-x86.c | 7 +++++++ qemu-kvm.c | 11 +++-------- qemu-kvm.h | 3 +++ 3 files changed, 13 insertions(+), 8 deletions(-) [diff] diff --git a/qemu/qemu-kvm-x86.c b/qemu/qemu-kvm-x86.c --- a/qemu/qemu-kvm-x86.c +++ b/qemu/qemu-kvm-x86.c @@ -11,6 +11,7 @@ #include #include "hw/hw.h" +#include #include "qemu-kvm.h" #include @@ -717,3 +718,9 @@ } } } + +void kvm_arch_do_ioperm(void *_data) +{ + struct ioperm_data *data = _data; + ioperm(data->start_port, data->num, data->turn_on); +} diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c --- a/qemu/qemu-kvm.c +++ b/qemu/qemu-kvm.c @@ -27,7 +27,6 @@ #include #include #include -#include #define bool _Bool #define false 0 @@ -1049,14 +1048,10 @@ return kvm_unregister_coalesced_mmio(kvm_context, addr, size); } -static void kvm_do_ioperm(void *_data) -{ - struct ioperm_data *data = _data; - ioperm(data->start_port, data->num, data->turn_on); -} - +#ifdef USE_KVM_DEVICE_ASSIGNMENT void kvm_ioperm(CPUState *env, void *data) { if (kvm_enabled() && qemu_system_ready) - on_vcpu(env, kvm_do_ioperm, data); + on_vcpu(env, kvm_arch_do_ioperm, data); } +#endif diff --git a/qemu/qemu-kvm.h b/qemu/qemu-kvm.h --- a/qemu/qemu-kvm.h +++ b/qemu/qemu-kvm.h @@ -93,7 +93,10 @@ void qemu_kvm_system_reset_request(void); +#ifdef USE_KVM_DEVICE_ASSIGNMENT void kvm_ioperm(CPUState *env, void *data); +void kvm_arch_do_ioperm(void *_data); +#endif #ifdef TARGET_PPC int handle_powerpc_dcr_read(int vcpu, uint32_t dcrn, uint32_t *data);