kvm: libkvm: start removing kernel memory functions
[qemu-kvm/fedora.git] / qemu-kvm-ia64.c
blob042c7ed193002f96f929a78a5164e0c58a3ad40c
2 #include "config.h"
3 #include "config-host.h"
5 #include <string.h>
7 #include "hw/hw.h"
8 #include "qemu-kvm.h"
9 #include <libkvm.h>
10 #include <pthread.h>
11 #include <sys/utsname.h>
14 extern kvm_context_t kvm_context;
16 int kvm_arch_qemu_create_context(void)
18 return 0;
21 void kvm_arch_load_regs(CPUState *env)
26 void kvm_arch_save_regs(CPUState *env)
30 int kvm_arch_qemu_init_env(CPUState *cenv)
32 return 0;
35 int kvm_arch_halt(void *opaque, int vcpu)
37 CPUState *env = cpu_single_env;
38 env->hflags |= HF_HALTED_MASK;
39 env->exception_index = EXCP_HLT;
40 return 1;
43 void kvm_arch_pre_kvm_run(void *opaque, int vcpu)
47 void kvm_arch_post_kvm_run(void *opaque, int vcpu)
51 int kvm_arch_has_work(CPUState *env)
53 return 1;
56 int kvm_arch_try_push_interrupts(void *opaque)
58 return 1;
61 void kvm_arch_update_regs_for_sipi(CPUState *env)
65 void kvm_save_mpstate(CPUState *env)
67 #ifdef KVM_CAP_MP_STATE
68 int r;
69 struct kvm_mp_state mp_state;
71 r = kvm_get_mpstate(kvm_context, env->cpu_index, &mp_state);
72 if (r < 0)
73 env->mp_state = -1;
74 else
75 env->mp_state = mp_state.mp_state;
76 #endif
79 void kvm_load_mpstate(CPUState *env)
81 #ifdef KVM_CAP_MP_STATE
82 struct kvm_mp_state mp_state = { .mp_state = env->mp_state };
85 * -1 indicates that the host did not support GET_MP_STATE ioctl,
86 * so don't touch it.
88 if (env->mp_state != -1)
89 kvm_set_mpstate(kvm_context, env->cpu_index, &mp_state);
90 #endif
93 void kvm_arch_cpu_reset(CPUState *env)
95 if (kvm_irqchip_in_kernel(kvm_context)) {
96 #ifdef KVM_CAP_MP_STATE
97 kvm_reset_mpstate(kvm_context, env->cpu_index);
98 #endif
99 } else {
100 env->interrupt_request &= ~CPU_INTERRUPT_HARD;
101 env->halted = 1;
102 env->exception_index = EXCP_HLT;