Merge commit '5f87762742923e42114ed49c96251a245f109147' into upstream-merge
[qemu-kvm/fedora.git] / qemu-kvm-ia64.c
blob582113f1a2c64f7e89a7a76851a0c49791ab98ec
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-all.h"
9 #include <pthread.h>
10 #include <sys/utsname.h>
11 #include <sys/io.h>
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, kvm_vcpu_context_t vcpu)
36 CPUState *env = cpu_single_env;
37 env->hflags |= HF_HALTED_MASK;
38 return 1;
41 void kvm_arch_pre_kvm_run(void *opaque, CPUState *env)
45 void kvm_arch_post_kvm_run(void *opaque, CPUState *env)
49 int kvm_arch_has_work(CPUState *env)
51 return 1;
54 int kvm_arch_try_push_interrupts(void *opaque)
56 return 1;
59 void kvm_arch_update_regs_for_sipi(CPUState *env)
63 int kvm_arch_insert_sw_breakpoint(CPUState *current_env,
64 struct kvm_sw_breakpoint *bp)
66 return -EINVAL;
69 int kvm_arch_remove_sw_breakpoint(CPUState *current_env,
70 struct kvm_sw_breakpoint *bp)
72 return -EINVAL;
75 int kvm_arch_insert_hw_breakpoint(target_ulong addr,
76 target_ulong len, int type)
78 return -ENOSYS;
81 int kvm_arch_remove_hw_breakpoint(target_ulong addr,
82 target_ulong len, int type)
84 return -ENOSYS;
87 void kvm_arch_remove_all_hw_breakpoints(void)
91 int kvm_arch_debug(struct kvm_debug_exit_arch *arch_info)
93 return 0;
96 void kvm_arch_update_guest_debug(CPUState *env, struct kvm_guest_debug *dbg)
100 void kvm_arch_save_mpstate(CPUState *env)
102 #ifdef KVM_CAP_MP_STATE
103 int r;
104 struct kvm_mp_state mp_state;
106 r = kvm_get_mpstate(env->kvm_cpu_state.vcpu_ctx, &mp_state);
107 if (r < 0)
108 env->mp_state = -1;
109 else
110 env->mp_state = mp_state.mp_state;
111 #endif
114 void kvm_arch_load_mpstate(CPUState *env)
116 #ifdef KVM_CAP_MP_STATE
117 struct kvm_mp_state mp_state = { .mp_state = env->mp_state };
120 * -1 indicates that the host did not support GET_MP_STATE ioctl,
121 * so don't touch it.
123 if (env->mp_state != -1)
124 kvm_set_mpstate(env->kvm_cpu_state.vcpu_ctx, &mp_state);
125 #endif
128 void kvm_arch_cpu_reset(CPUState *env)
130 if (kvm_irqchip_in_kernel(kvm_context)) {
131 #ifdef KVM_CAP_MP_STATE
132 kvm_reset_mpstate(env->kvm_cpu_state.vcpu_ctx);
133 #endif
134 } else {
135 env->interrupt_request &= ~CPU_INTERRUPT_HARD;
136 env->halted = 1;
140 void kvm_arch_do_ioperm(void *_data)
142 struct ioperm_data *data = _data;
143 ioperm(data->start_port, data->num, data->turn_on);
146 void kvm_arch_process_irqchip_events(CPUState *env)