2 * This header is for functions & variables that will ONLY be
3 * used inside libkvm for x86.
4 * THESE ARE NOT EXPOSED TO THE USER AND ARE ONLY FOR USE
7 * derived from libkvm.c
9 * Copyright (C) 2006 Qumranet, Inc.
12 * Avi Kivity <avi@qumranet.com>
13 * Yaniv Kamay <yaniv@qumranet.com>
15 * Copyright 2007 IBM Corporation.
17 * Jerone Young <jyoung5@us.ibm.com>
18 * Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
21 * This work is licensed under the GNU LGPL license, version 2.
25 #include "kvm-powerpc.h"
30 int handle_dcr(struct kvm_run
*run
, kvm_context_t kvm
, int vcpu
)
34 if (run
->dcr
.is_write
)
35 ret
= kvm
->callbacks
->powerpc_dcr_write(vcpu
,
39 ret
= kvm
->callbacks
->powerpc_dcr_read(vcpu
,
46 void kvm_show_code(kvm_context_t kvm
, int vcpu
)
48 fprintf(stderr
, "%s: Operation not supported\n", __FUNCTION__
);
51 void kvm_show_regs(kvm_context_t kvm
, int vcpu
)
56 if (kvm_get_regs(kvm
, vcpu
, ®s
))
59 fprintf(stderr
,"guest vcpu #%d\n", vcpu
);
60 fprintf(stderr
,"pc: %016"PRIx64
" msr: %016"PRIx64
"\n",
62 fprintf(stderr
,"lr: %016"PRIx64
" ctr: %016"PRIx64
"\n",
64 fprintf(stderr
,"srr0: %016"PRIx64
" srr1: %016"PRIx64
"\n",
65 regs
.srr0
, regs
.srr1
);
68 fprintf(stderr
, "gpr%02d: %016"PRIx64
" %016"PRIx64
" %016"PRIx64
79 int kvm_arch_create(kvm_context_t kvm
, unsigned long phys_mem_bytes
,
84 r
= kvm_init_coalesced_mmio(kvm
);
91 int kvm_arch_run(struct kvm_run
*run
, kvm_context_t kvm
, int vcpu
)
95 switch (run
->exit_reason
){
97 ret
= handle_dcr(run
, kvm
, vcpu
);