2 * This file contains the powerpc specific implementation for the
3 * architecture dependent functions defined in kvm-common.h and
6 * Copyright (C) 2006 Qumranet, Inc.
9 * Avi Kivity <avi@qumranet.com>
10 * Yaniv Kamay <yaniv@qumranet.com>
12 * Copyright IBM Corp. 2007,2008
14 * Jerone Young <jyoung5@us.ibm.com>
15 * Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
17 * This work is licensed under the GNU LGPL license, version 2.
21 #include "kvm-powerpc.h"
26 int handle_dcr(struct kvm_run
*run
, kvm_context_t kvm
, int vcpu
)
30 if (run
->dcr
.is_write
)
31 ret
= kvm
->callbacks
->powerpc_dcr_write(vcpu
,
35 ret
= kvm
->callbacks
->powerpc_dcr_read(vcpu
,
42 void kvm_show_code(kvm_context_t kvm
, int vcpu
)
44 fprintf(stderr
, "%s: Operation not supported\n", __FUNCTION__
);
47 void kvm_show_regs(kvm_context_t kvm
, int vcpu
)
52 if (kvm_get_regs(kvm
, vcpu
, ®s
))
55 fprintf(stderr
,"guest vcpu #%d\n", vcpu
);
56 fprintf(stderr
,"pc: %016"PRIx64
" msr: %016"PRIx64
"\n",
58 fprintf(stderr
,"lr: %016"PRIx64
" ctr: %016"PRIx64
"\n",
60 fprintf(stderr
,"srr0: %016"PRIx64
" srr1: %016"PRIx64
"\n",
61 regs
.srr0
, regs
.srr1
);
64 fprintf(stderr
, "gpr%02d: %016"PRIx64
" %016"PRIx64
" %016"PRIx64
75 int kvm_arch_create(kvm_context_t kvm
, unsigned long phys_mem_bytes
,
80 r
= kvm_init_coalesced_mmio(kvm
);
87 int kvm_arch_run(struct kvm_run
*run
, kvm_context_t kvm
, int vcpu
)
91 switch (run
->exit_reason
){
93 ret
= handle_dcr(run
, kvm
, vcpu
);