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.
20 #include "libkvm-all.h"
26 int handle_dcr(kvm_vcpu_context_t vcpu
)
29 struct kvm_run
*run
= vcpu
->run
;
30 kvm_context_t kvm
= vcpu
->kvm
;
32 if (run
->dcr
.is_write
)
33 ret
= kvm
->callbacks
->powerpc_dcr_write(vcpu
,
37 ret
= kvm
->callbacks
->powerpc_dcr_read(vcpu
,
44 void kvm_show_code(kvm_vcpu_context_t vcpu
)
46 fprintf(stderr
, "%s: Operation not supported\n", __FUNCTION__
);
49 void kvm_show_regs(kvm_vcpu_context_t vcpu
)
54 if (kvm_get_regs(vcpu
, ®s
))
57 fprintf(stderr
,"guest vcpu #%d\n", vcpu
);
58 fprintf(stderr
,"pc: %016"PRIx64
" msr: %016"PRIx64
"\n",
60 fprintf(stderr
,"lr: %016"PRIx64
" ctr: %016"PRIx64
"\n",
62 fprintf(stderr
,"srr0: %016"PRIx64
" srr1: %016"PRIx64
"\n",
63 regs
.srr0
, regs
.srr1
);
66 fprintf(stderr
, "gpr%02d: %016"PRIx64
" %016"PRIx64
" %016"PRIx64
77 int kvm_arch_create(kvm_context_t kvm
, unsigned long phys_mem_bytes
,
82 r
= kvm_init_coalesced_mmio(kvm
);
89 int kvm_arch_run(kvm_vcpu_context_t vcpu
)
93 switch (vcpu
->run
->exit_reason
){
95 ret
= handle_dcr(vcpu
);