Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 146 lines (117 sloc) 2.659 kb
68396ea @rmustacc Initial commit of d32e8d0b8d9e0ef7cf7ab2e74548982972789dfc from qemu-kvm
rmustacc authored
1 #include "config.h"
2 #include "config-host.h"
3
4 #include <string.h>
5
6 #include "hw/hw.h"
7 #include "qemu-kvm.h"
8 #include <pthread.h>
9 #include <sys/utsname.h>
10 #include <sys/io.h>
11
12
13
14 int kvm_arch_qemu_create_context(void)
15 {
16 return 0;
17 }
18
19 void kvm_arch_load_regs(CPUState *env, int level)
20 {
21 }
22
23
24 void kvm_arch_save_regs(CPUState *env)
25 {
26 }
27
28 int kvm_arch_init_vcpu(CPUState *cenv)
29 {
30 return 0;
31 }
32
33 int kvm_arch_halt(kvm_vcpu_context_t vcpu)
34 {
35 CPUState *env = cpu_single_env;
36 env->hflags |= HF_HALTED_MASK;
37 return 1;
38 }
39
40 void kvm_arch_pre_kvm_run(void *opaque, CPUState *env)
41 {
42 }
43
44 void kvm_arch_post_kvm_run(void *opaque, CPUState *env)
45 {
46 }
47
48 int kvm_arch_has_work(CPUState *env)
49 {
50 return 1;
51 }
52
53 int kvm_arch_try_push_interrupts(void *opaque)
54 {
55 return 1;
56 }
57
58 int kvm_arch_insert_sw_breakpoint(CPUState *current_env,
59 struct kvm_sw_breakpoint *bp)
60 {
61 return -EINVAL;
62 }
63
64 int kvm_arch_remove_sw_breakpoint(CPUState *current_env,
65 struct kvm_sw_breakpoint *bp)
66 {
67 return -EINVAL;
68 }
69
70 int kvm_arch_insert_hw_breakpoint(target_ulong addr,
71 target_ulong len, int type)
72 {
73 return -ENOSYS;
74 }
75
76 int kvm_arch_remove_hw_breakpoint(target_ulong addr,
77 target_ulong len, int type)
78 {
79 return -ENOSYS;
80 }
81
82 void kvm_arch_remove_all_hw_breakpoints(void)
83 {
84 }
85
86 int kvm_arch_debug(struct kvm_debug_exit_arch *arch_info)
87 {
88 return 0;
89 }
90
91 void kvm_arch_update_guest_debug(CPUState *env, struct kvm_guest_debug *dbg)
92 {
93 }
94
95 void kvm_arch_save_mpstate(CPUState *env)
96 {
97 #ifdef KVM_CAP_MP_STATE
98 int r;
99 struct kvm_mp_state mp_state;
100
101 r = kvm_get_mpstate(env->kvm_cpu_state.vcpu_ctx, &mp_state);
102 if (r < 0)
103 env->mp_state = -1;
104 else
105 env->mp_state = mp_state.mp_state;
106 #endif
107 }
108
109 void kvm_arch_load_mpstate(CPUState *env)
110 {
111 #ifdef KVM_CAP_MP_STATE
112 struct kvm_mp_state mp_state = { .mp_state = env->mp_state };
113
114 /*
115 * -1 indicates that the host did not support GET_MP_STATE ioctl,
116 * so don't touch it.
117 */
118 if (env->mp_state != -1)
119 kvm_set_mpstate(env->kvm_cpu_state.vcpu_ctx, &mp_state);
120 #endif
121 }
122
123 void kvm_arch_cpu_reset(CPUState *env)
124 {
125 if (kvm_irqchip_in_kernel(kvm_context)) {
126 #ifdef KVM_CAP_MP_STATE
127 struct kvm_mp_state mp_state = {.mp_state = KVM_MP_STATE_UNINITIALIZED
128 };
129 kvm_set_mpstate(env, &mp_state);
130 #endif
131 } else {
132 env->interrupt_request &= ~CPU_INTERRUPT_HARD;
133 env->halted = 1;
134 }
135 }
136
137 void kvm_arch_do_ioperm(void *_data)
138 {
139 struct ioperm_data *data = _data;
140 ioperm(data->start_port, data->num, data->turn_on);
141 }
142
143 void kvm_arch_process_irqchip_events(CPUState *env)
144 {
145 }
Something went wrong with that request. Please try again.