From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Ehrhardt Subject: [PATCH] fill kvm_callback with arch specific dcr_read/dcr_write callbacks Date: Fri, 11 Jan 2008 10:35:38 +0100 Message-ID: <1200044138381-git-send-email-ehrhardt@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Christian Ehrhardt , "Avi Kivity ; Hollis Blanchard ; Jerone Young" To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Subject: [PATCH] fill kvm_callback with arch specific dcr_read/dcr_write callbacks From: Christian Ehrhardt This Patch adds the callback assignment and handlers for powerpc_dcr_read and ppc_dcr_write which are called from libkvm. This is the part of the patch that changes already submitted code while the implementation will follow as one when kvm-userspace for ppc is finished, but appyling this now will reduce the changes to non-ppc files later in the big patch. Signed-off-by: Christian Ehrhardt libkvm/libkvm-powerpc.c | 8 ++++---- libkvm/libkvm.h | 4 ++-- qemu/qemu-kvm.c | 4 ++++ qemu/qemu-kvm.h | 5 +++++ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/libkvm/libkvm-powerpc.c b/libkvm/libkvm-powerpc.c --- a/libkvm/libkvm-powerpc.c +++ b/libkvm/libkvm-powerpc.c @@ -31,11 +31,11 @@ int handle_dcr(struct kvm_run *run, kvm int ret = 0; if (run->dcr.is_write) - ret = kvm->callbacks->powerpc_dcr_write(kvm, - run->dcr.dcrn,run->dcr.data); + ret = kvm->callbacks->powerpc_dcr_write(run->dcr.dcrn, + run->dcr.data); else - ret = kvm->callbacks->powerpc_dcr_read(kvm, - run->dcr.dcrn, &(run->dcr.data)); + ret = kvm->callbacks->powerpc_dcr_read(run->dcr.dcrn, + &(run->dcr.data)); return ret; } diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h --- a/libkvm/libkvm.h +++ b/libkvm/libkvm.h @@ -66,8 +66,8 @@ struct kvm_callbacks { int (*pre_kvm_run)(void *opaque, int vcpu); int (*tpr_access)(void *opaque, int vcpu, uint64_t rip, int is_write); #if defined(__powerpc__) - int (*powerpc_dcr_read)(kvm_context_t kvm, uint32_t dcrn, uint32_t *data); - int (*powerpc_dcr_write)(kvm_context_t kvm, uint32_t dcrn, uint32_t data); + int (*powerpc_dcr_read)(uint32_t dcrn, uint32_t *data); + int (*powerpc_dcr_write)(uint32_t dcrn, uint32_t data); #endif }; diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c --- a/qemu/qemu-kvm.c +++ b/qemu/qemu-kvm.c @@ -533,6 +533,10 @@ static struct kvm_callbacks qemu_kvm_ops #ifdef TARGET_I386 .tpr_access = handle_tpr_access, #endif +#ifdef TARGET_PPC + .powerpc_dcr_read = handle_powerpc_dcr_read, + .powerpc_dcr_write = handle_powerpc_dcr_write, +#endif }; int kvm_qemu_init() diff --git a/qemu/qemu-kvm.h b/qemu/qemu-kvm.h --- a/qemu/qemu-kvm.h +++ b/qemu/qemu-kvm.h @@ -48,6 +48,11 @@ int handle_tpr_access(void *opaque, int int handle_tpr_access(void *opaque, int vcpu, uint64_t rip, int is_write); +#ifdef TARGET_PPC +int handle_powerpc_dcr_read(uint32_t dcrn, uint32_t *data); +int handle_powerpc_dcr_write(uint32_t dcrn, uint32_t data); +#endif + #define ALIGN(x, y) (((x)+(y)-1) & ~((y)-1)) #define BITMAP_SIZE(m) (ALIGN(((m)>>TARGET_PAGE_BITS), HOST_LONG_BITS) / 8) ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace