Ppc: fix build after qemu upstream changes
[qemu-kvm/fedora.git] / qemu-kvm-ia64.c
bloba6b17afc604774a84b5e606a333e4843977cab94
1 #include "config.h"
2 #include "config-host.h"
4 #include <string.h>
6 #include "hw/hw.h"
7 #include "qemu-kvm.h"
8 #include <libkvm.h>
9 #include <pthread.h>
10 #include <sys/utsname.h>
13 extern kvm_context_t kvm_context;
15 int kvm_arch_qemu_create_context(void)
17 return 0;
20 void kvm_arch_load_regs(CPUState *env)
25 void kvm_arch_save_regs(CPUState *env)
29 int kvm_arch_qemu_init_env(CPUState *cenv)
31 return 0;
34 int kvm_arch_halt(void *opaque, int vcpu)
36 CPUState *env = cpu_single_env;
37 env->hflags |= HF_HALTED_MASK;
38 env->exception_index = EXCP_HLT;
39 return 1;
42 void kvm_arch_pre_kvm_run(void *opaque, CPUState *env)
46 void kvm_arch_post_kvm_run(void *opaque, CPUState *env)
50 int kvm_arch_has_work(CPUState *env)
52 return 1;
55 int kvm_arch_try_push_interrupts(void *opaque)
57 return 1;
60 void kvm_arch_push_nmi(void *opaque)
64 void kvm_arch_update_regs_for_sipi(CPUState *env)
68 void kvm_save_mpstate(CPUState *env)
70 #ifdef KVM_CAP_MP_STATE
71 int r;
72 struct kvm_mp_state mp_state;
74 r = kvm_get_mpstate(kvm_context, env->cpu_index, &mp_state);
75 if (r < 0)
76 env->mp_state = -1;
77 else
78 env->mp_state = mp_state.mp_state;
79 #endif
82 void kvm_load_mpstate(CPUState *env)
84 #ifdef KVM_CAP_MP_STATE
85 struct kvm_mp_state mp_state = { .mp_state = env->mp_state };
88 * -1 indicates that the host did not support GET_MP_STATE ioctl,
89 * so don't touch it.
91 if (env->mp_state != -1)
92 kvm_set_mpstate(kvm_context, env->cpu_index, &mp_state);
93 #endif
96 void kvm_arch_cpu_reset(CPUState *env)
98 if (kvm_irqchip_in_kernel(kvm_context)) {
99 #ifdef KVM_CAP_MP_STATE
100 kvm_reset_mpstate(kvm_context, env->cpu_index);
101 #endif
102 } else {
103 env->interrupt_request &= ~CPU_INTERRUPT_HARD;
104 env->halted = 1;
105 env->exception_index = EXCP_HLT;
109 void kvm_arch_do_ioperm(void *_data)
111 struct ioperm_data *data = _data;
112 ioperm(data->start_port, data->num, data->turn_on);