root / target-arm / kvm.c @ 15bfe8b6
History | View | Annotate | Download (9.4 kB)
1 | 494b00c7 | Christoffer Dall | /*
|
---|---|---|---|
2 | 494b00c7 | Christoffer Dall | * ARM implementation of KVM hooks
|
3 | 494b00c7 | Christoffer Dall | *
|
4 | 494b00c7 | Christoffer Dall | * Copyright Christoffer Dall 2009-2010
|
5 | 494b00c7 | Christoffer Dall | *
|
6 | 494b00c7 | Christoffer Dall | * This work is licensed under the terms of the GNU GPL, version 2 or later.
|
7 | 494b00c7 | Christoffer Dall | * See the COPYING file in the top-level directory.
|
8 | 494b00c7 | Christoffer Dall | *
|
9 | 494b00c7 | Christoffer Dall | */
|
10 | 494b00c7 | Christoffer Dall | |
11 | 494b00c7 | Christoffer Dall | #include <stdio.h> |
12 | 494b00c7 | Christoffer Dall | #include <sys/types.h> |
13 | 494b00c7 | Christoffer Dall | #include <sys/ioctl.h> |
14 | 494b00c7 | Christoffer Dall | #include <sys/mman.h> |
15 | 494b00c7 | Christoffer Dall | |
16 | 494b00c7 | Christoffer Dall | #include <linux/kvm.h> |
17 | 494b00c7 | Christoffer Dall | |
18 | 494b00c7 | Christoffer Dall | #include "qemu-common.h" |
19 | 494b00c7 | Christoffer Dall | #include "qemu/timer.h" |
20 | 494b00c7 | Christoffer Dall | #include "sysemu/sysemu.h" |
21 | 494b00c7 | Christoffer Dall | #include "sysemu/kvm.h" |
22 | eb035b48 | Peter Maydell | #include "kvm_arm.h" |
23 | 494b00c7 | Christoffer Dall | #include "cpu.h" |
24 | bd2be150 | Peter Maydell | #include "hw/arm/arm.h" |
25 | 494b00c7 | Christoffer Dall | |
26 | 494b00c7 | Christoffer Dall | const KVMCapabilityInfo kvm_arch_required_capabilities[] = {
|
27 | 494b00c7 | Christoffer Dall | KVM_CAP_LAST_INFO |
28 | 494b00c7 | Christoffer Dall | }; |
29 | 494b00c7 | Christoffer Dall | |
30 | a96c0514 | Peter Maydell | bool kvm_arm_create_scratch_host_vcpu(const uint32_t *cpus_to_try, |
31 | a96c0514 | Peter Maydell | int *fdarray,
|
32 | a96c0514 | Peter Maydell | struct kvm_vcpu_init *init)
|
33 | a96c0514 | Peter Maydell | { |
34 | a96c0514 | Peter Maydell | int ret, kvmfd = -1, vmfd = -1, cpufd = -1; |
35 | a96c0514 | Peter Maydell | |
36 | a96c0514 | Peter Maydell | kvmfd = qemu_open("/dev/kvm", O_RDWR);
|
37 | a96c0514 | Peter Maydell | if (kvmfd < 0) { |
38 | a96c0514 | Peter Maydell | goto err;
|
39 | a96c0514 | Peter Maydell | } |
40 | a96c0514 | Peter Maydell | vmfd = ioctl(kvmfd, KVM_CREATE_VM, 0);
|
41 | a96c0514 | Peter Maydell | if (vmfd < 0) { |
42 | a96c0514 | Peter Maydell | goto err;
|
43 | a96c0514 | Peter Maydell | } |
44 | a96c0514 | Peter Maydell | cpufd = ioctl(vmfd, KVM_CREATE_VCPU, 0);
|
45 | a96c0514 | Peter Maydell | if (cpufd < 0) { |
46 | a96c0514 | Peter Maydell | goto err;
|
47 | a96c0514 | Peter Maydell | } |
48 | a96c0514 | Peter Maydell | |
49 | a96c0514 | Peter Maydell | ret = ioctl(vmfd, KVM_ARM_PREFERRED_TARGET, init); |
50 | a96c0514 | Peter Maydell | if (ret >= 0) { |
51 | a96c0514 | Peter Maydell | ret = ioctl(cpufd, KVM_ARM_VCPU_INIT, init); |
52 | a96c0514 | Peter Maydell | if (ret < 0) { |
53 | a96c0514 | Peter Maydell | goto err;
|
54 | a96c0514 | Peter Maydell | } |
55 | a96c0514 | Peter Maydell | } else {
|
56 | a96c0514 | Peter Maydell | /* Old kernel which doesn't know about the
|
57 | a96c0514 | Peter Maydell | * PREFERRED_TARGET ioctl: we know it will only support
|
58 | a96c0514 | Peter Maydell | * creating one kind of guest CPU which is its preferred
|
59 | a96c0514 | Peter Maydell | * CPU type.
|
60 | a96c0514 | Peter Maydell | */
|
61 | a96c0514 | Peter Maydell | while (*cpus_to_try != QEMU_KVM_ARM_TARGET_NONE) {
|
62 | a96c0514 | Peter Maydell | init->target = *cpus_to_try++; |
63 | a96c0514 | Peter Maydell | memset(init->features, 0, sizeof(init->features)); |
64 | a96c0514 | Peter Maydell | ret = ioctl(cpufd, KVM_ARM_VCPU_INIT, init); |
65 | a96c0514 | Peter Maydell | if (ret >= 0) { |
66 | a96c0514 | Peter Maydell | break;
|
67 | a96c0514 | Peter Maydell | } |
68 | a96c0514 | Peter Maydell | } |
69 | a96c0514 | Peter Maydell | if (ret < 0) { |
70 | a96c0514 | Peter Maydell | goto err;
|
71 | a96c0514 | Peter Maydell | } |
72 | a96c0514 | Peter Maydell | } |
73 | a96c0514 | Peter Maydell | |
74 | a96c0514 | Peter Maydell | fdarray[0] = kvmfd;
|
75 | a96c0514 | Peter Maydell | fdarray[1] = vmfd;
|
76 | a96c0514 | Peter Maydell | fdarray[2] = cpufd;
|
77 | a96c0514 | Peter Maydell | |
78 | a96c0514 | Peter Maydell | return true; |
79 | a96c0514 | Peter Maydell | |
80 | a96c0514 | Peter Maydell | err:
|
81 | a96c0514 | Peter Maydell | if (cpufd >= 0) { |
82 | a96c0514 | Peter Maydell | close(cpufd); |
83 | a96c0514 | Peter Maydell | } |
84 | a96c0514 | Peter Maydell | if (vmfd >= 0) { |
85 | a96c0514 | Peter Maydell | close(vmfd); |
86 | a96c0514 | Peter Maydell | } |
87 | a96c0514 | Peter Maydell | if (kvmfd >= 0) { |
88 | a96c0514 | Peter Maydell | close(kvmfd); |
89 | a96c0514 | Peter Maydell | } |
90 | a96c0514 | Peter Maydell | |
91 | a96c0514 | Peter Maydell | return false; |
92 | a96c0514 | Peter Maydell | } |
93 | a96c0514 | Peter Maydell | |
94 | a96c0514 | Peter Maydell | void kvm_arm_destroy_scratch_host_vcpu(int *fdarray) |
95 | a96c0514 | Peter Maydell | { |
96 | a96c0514 | Peter Maydell | int i;
|
97 | a96c0514 | Peter Maydell | |
98 | a96c0514 | Peter Maydell | for (i = 2; i >= 0; i--) { |
99 | a96c0514 | Peter Maydell | close(fdarray[i]); |
100 | a96c0514 | Peter Maydell | } |
101 | a96c0514 | Peter Maydell | } |
102 | a96c0514 | Peter Maydell | |
103 | a96c0514 | Peter Maydell | static void kvm_arm_host_cpu_class_init(ObjectClass *oc, void *data) |
104 | a96c0514 | Peter Maydell | { |
105 | a96c0514 | Peter Maydell | ARMHostCPUClass *ahcc = ARM_HOST_CPU_CLASS(oc); |
106 | a96c0514 | Peter Maydell | |
107 | a96c0514 | Peter Maydell | /* All we really need to set up for the 'host' CPU
|
108 | a96c0514 | Peter Maydell | * is the feature bits -- we rely on the fact that the
|
109 | a96c0514 | Peter Maydell | * various ID register values in ARMCPU are only used for
|
110 | a96c0514 | Peter Maydell | * TCG CPUs.
|
111 | a96c0514 | Peter Maydell | */
|
112 | a96c0514 | Peter Maydell | if (!kvm_arm_get_host_cpu_features(ahcc)) {
|
113 | a96c0514 | Peter Maydell | fprintf(stderr, "Failed to retrieve host CPU features!\n");
|
114 | a96c0514 | Peter Maydell | abort(); |
115 | a96c0514 | Peter Maydell | } |
116 | a96c0514 | Peter Maydell | } |
117 | a96c0514 | Peter Maydell | |
118 | a96c0514 | Peter Maydell | static void kvm_arm_host_cpu_initfn(Object *obj) |
119 | a96c0514 | Peter Maydell | { |
120 | a96c0514 | Peter Maydell | ARMHostCPUClass *ahcc = ARM_HOST_CPU_GET_CLASS(obj); |
121 | a96c0514 | Peter Maydell | ARMCPU *cpu = ARM_CPU(obj); |
122 | a96c0514 | Peter Maydell | CPUARMState *env = &cpu->env; |
123 | a96c0514 | Peter Maydell | |
124 | a96c0514 | Peter Maydell | cpu->kvm_target = ahcc->target; |
125 | a96c0514 | Peter Maydell | cpu->dtb_compatible = ahcc->dtb_compatible; |
126 | a96c0514 | Peter Maydell | env->features = ahcc->features; |
127 | a96c0514 | Peter Maydell | } |
128 | a96c0514 | Peter Maydell | |
129 | a96c0514 | Peter Maydell | static const TypeInfo host_arm_cpu_type_info = { |
130 | a96c0514 | Peter Maydell | .name = TYPE_ARM_HOST_CPU, |
131 | 26861c7c | Mian M. Hamayun | #ifdef TARGET_AARCH64
|
132 | 26861c7c | Mian M. Hamayun | .parent = TYPE_AARCH64_CPU, |
133 | 26861c7c | Mian M. Hamayun | #else
|
134 | a96c0514 | Peter Maydell | .parent = TYPE_ARM_CPU, |
135 | 26861c7c | Mian M. Hamayun | #endif
|
136 | a96c0514 | Peter Maydell | .instance_init = kvm_arm_host_cpu_initfn, |
137 | a96c0514 | Peter Maydell | .class_init = kvm_arm_host_cpu_class_init, |
138 | a96c0514 | Peter Maydell | .class_size = sizeof(ARMHostCPUClass),
|
139 | a96c0514 | Peter Maydell | }; |
140 | a96c0514 | Peter Maydell | |
141 | 494b00c7 | Christoffer Dall | int kvm_arch_init(KVMState *s)
|
142 | 494b00c7 | Christoffer Dall | { |
143 | 494b00c7 | Christoffer Dall | /* For ARM interrupt delivery is always asynchronous,
|
144 | 494b00c7 | Christoffer Dall | * whether we are using an in-kernel VGIC or not.
|
145 | 494b00c7 | Christoffer Dall | */
|
146 | 494b00c7 | Christoffer Dall | kvm_async_interrupts_allowed = true;
|
147 | a96c0514 | Peter Maydell | |
148 | a96c0514 | Peter Maydell | type_register_static(&host_arm_cpu_type_info); |
149 | a96c0514 | Peter Maydell | |
150 | 494b00c7 | Christoffer Dall | return 0; |
151 | 494b00c7 | Christoffer Dall | } |
152 | 494b00c7 | Christoffer Dall | |
153 | 494b00c7 | Christoffer Dall | unsigned long kvm_arch_vcpu_id(CPUState *cpu) |
154 | 494b00c7 | Christoffer Dall | { |
155 | 494b00c7 | Christoffer Dall | return cpu->cpu_index;
|
156 | 494b00c7 | Christoffer Dall | } |
157 | 494b00c7 | Christoffer Dall | |
158 | eb035b48 | Peter Maydell | /* We track all the KVM devices which need their memory addresses
|
159 | eb035b48 | Peter Maydell | * passing to the kernel in a list of these structures.
|
160 | eb035b48 | Peter Maydell | * When board init is complete we run through the list and
|
161 | eb035b48 | Peter Maydell | * tell the kernel the base addresses of the memory regions.
|
162 | eb035b48 | Peter Maydell | * We use a MemoryListener to track mapping and unmapping of
|
163 | eb035b48 | Peter Maydell | * the regions during board creation, so the board models don't
|
164 | eb035b48 | Peter Maydell | * need to do anything special for the KVM case.
|
165 | eb035b48 | Peter Maydell | */
|
166 | eb035b48 | Peter Maydell | typedef struct KVMDevice { |
167 | eb035b48 | Peter Maydell | struct kvm_arm_device_addr kda;
|
168 | eb035b48 | Peter Maydell | MemoryRegion *mr; |
169 | eb035b48 | Peter Maydell | QSLIST_ENTRY(KVMDevice) entries; |
170 | eb035b48 | Peter Maydell | } KVMDevice; |
171 | eb035b48 | Peter Maydell | |
172 | eb035b48 | Peter Maydell | static QSLIST_HEAD(kvm_devices_head, KVMDevice) kvm_devices_head;
|
173 | eb035b48 | Peter Maydell | |
174 | eb035b48 | Peter Maydell | static void kvm_arm_devlistener_add(MemoryListener *listener, |
175 | eb035b48 | Peter Maydell | MemoryRegionSection *section) |
176 | eb035b48 | Peter Maydell | { |
177 | eb035b48 | Peter Maydell | KVMDevice *kd; |
178 | eb035b48 | Peter Maydell | |
179 | eb035b48 | Peter Maydell | QSLIST_FOREACH(kd, &kvm_devices_head, entries) { |
180 | eb035b48 | Peter Maydell | if (section->mr == kd->mr) {
|
181 | eb035b48 | Peter Maydell | kd->kda.addr = section->offset_within_address_space; |
182 | eb035b48 | Peter Maydell | } |
183 | eb035b48 | Peter Maydell | } |
184 | eb035b48 | Peter Maydell | } |
185 | eb035b48 | Peter Maydell | |
186 | eb035b48 | Peter Maydell | static void kvm_arm_devlistener_del(MemoryListener *listener, |
187 | eb035b48 | Peter Maydell | MemoryRegionSection *section) |
188 | eb035b48 | Peter Maydell | { |
189 | eb035b48 | Peter Maydell | KVMDevice *kd; |
190 | eb035b48 | Peter Maydell | |
191 | eb035b48 | Peter Maydell | QSLIST_FOREACH(kd, &kvm_devices_head, entries) { |
192 | eb035b48 | Peter Maydell | if (section->mr == kd->mr) {
|
193 | eb035b48 | Peter Maydell | kd->kda.addr = -1;
|
194 | eb035b48 | Peter Maydell | } |
195 | eb035b48 | Peter Maydell | } |
196 | eb035b48 | Peter Maydell | } |
197 | eb035b48 | Peter Maydell | |
198 | eb035b48 | Peter Maydell | static MemoryListener devlistener = {
|
199 | eb035b48 | Peter Maydell | .region_add = kvm_arm_devlistener_add, |
200 | eb035b48 | Peter Maydell | .region_del = kvm_arm_devlistener_del, |
201 | eb035b48 | Peter Maydell | }; |
202 | eb035b48 | Peter Maydell | |
203 | eb035b48 | Peter Maydell | static void kvm_arm_machine_init_done(Notifier *notifier, void *data) |
204 | eb035b48 | Peter Maydell | { |
205 | eb035b48 | Peter Maydell | KVMDevice *kd, *tkd; |
206 | eb035b48 | Peter Maydell | |
207 | eb035b48 | Peter Maydell | memory_listener_unregister(&devlistener); |
208 | eb035b48 | Peter Maydell | QSLIST_FOREACH_SAFE(kd, &kvm_devices_head, entries, tkd) { |
209 | eb035b48 | Peter Maydell | if (kd->kda.addr != -1) { |
210 | eb035b48 | Peter Maydell | if (kvm_vm_ioctl(kvm_state, KVM_ARM_SET_DEVICE_ADDR,
|
211 | eb035b48 | Peter Maydell | &kd->kda) < 0) {
|
212 | eb035b48 | Peter Maydell | fprintf(stderr, "KVM_ARM_SET_DEVICE_ADDRESS failed: %s\n",
|
213 | eb035b48 | Peter Maydell | strerror(errno)); |
214 | eb035b48 | Peter Maydell | abort(); |
215 | eb035b48 | Peter Maydell | } |
216 | eb035b48 | Peter Maydell | } |
217 | dfde4e6e | Paolo Bonzini | memory_region_unref(kd->mr); |
218 | eb035b48 | Peter Maydell | g_free(kd); |
219 | eb035b48 | Peter Maydell | } |
220 | eb035b48 | Peter Maydell | } |
221 | eb035b48 | Peter Maydell | |
222 | eb035b48 | Peter Maydell | static Notifier notify = {
|
223 | eb035b48 | Peter Maydell | .notify = kvm_arm_machine_init_done, |
224 | eb035b48 | Peter Maydell | }; |
225 | eb035b48 | Peter Maydell | |
226 | eb035b48 | Peter Maydell | void kvm_arm_register_device(MemoryRegion *mr, uint64_t devid)
|
227 | eb035b48 | Peter Maydell | { |
228 | eb035b48 | Peter Maydell | KVMDevice *kd; |
229 | eb035b48 | Peter Maydell | |
230 | eb035b48 | Peter Maydell | if (!kvm_irqchip_in_kernel()) {
|
231 | eb035b48 | Peter Maydell | return;
|
232 | eb035b48 | Peter Maydell | } |
233 | eb035b48 | Peter Maydell | |
234 | eb035b48 | Peter Maydell | if (QSLIST_EMPTY(&kvm_devices_head)) {
|
235 | eb035b48 | Peter Maydell | memory_listener_register(&devlistener, NULL);
|
236 | eb035b48 | Peter Maydell | qemu_add_machine_init_done_notifier(¬ify); |
237 | eb035b48 | Peter Maydell | } |
238 | eb035b48 | Peter Maydell | kd = g_new0(KVMDevice, 1);
|
239 | eb035b48 | Peter Maydell | kd->mr = mr; |
240 | eb035b48 | Peter Maydell | kd->kda.id = devid; |
241 | eb035b48 | Peter Maydell | kd->kda.addr = -1;
|
242 | eb035b48 | Peter Maydell | QSLIST_INSERT_HEAD(&kvm_devices_head, kd, entries); |
243 | dfde4e6e | Paolo Bonzini | memory_region_ref(kd->mr); |
244 | eb035b48 | Peter Maydell | } |
245 | eb035b48 | Peter Maydell | |
246 | ff047453 | Peter Maydell | bool write_kvmstate_to_list(ARMCPU *cpu)
|
247 | ff047453 | Peter Maydell | { |
248 | ff047453 | Peter Maydell | CPUState *cs = CPU(cpu); |
249 | ff047453 | Peter Maydell | int i;
|
250 | ff047453 | Peter Maydell | bool ok = true; |
251 | ff047453 | Peter Maydell | |
252 | ff047453 | Peter Maydell | for (i = 0; i < cpu->cpreg_array_len; i++) { |
253 | ff047453 | Peter Maydell | struct kvm_one_reg r;
|
254 | ff047453 | Peter Maydell | uint64_t regidx = cpu->cpreg_indexes[i]; |
255 | ff047453 | Peter Maydell | uint32_t v32; |
256 | ff047453 | Peter Maydell | int ret;
|
257 | ff047453 | Peter Maydell | |
258 | ff047453 | Peter Maydell | r.id = regidx; |
259 | ff047453 | Peter Maydell | |
260 | ff047453 | Peter Maydell | switch (regidx & KVM_REG_SIZE_MASK) {
|
261 | ff047453 | Peter Maydell | case KVM_REG_SIZE_U32:
|
262 | ff047453 | Peter Maydell | r.addr = (uintptr_t)&v32; |
263 | ff047453 | Peter Maydell | ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &r); |
264 | ff047453 | Peter Maydell | if (!ret) {
|
265 | ff047453 | Peter Maydell | cpu->cpreg_values[i] = v32; |
266 | ff047453 | Peter Maydell | } |
267 | ff047453 | Peter Maydell | break;
|
268 | ff047453 | Peter Maydell | case KVM_REG_SIZE_U64:
|
269 | ff047453 | Peter Maydell | r.addr = (uintptr_t)(cpu->cpreg_values + i); |
270 | ff047453 | Peter Maydell | ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &r); |
271 | ff047453 | Peter Maydell | break;
|
272 | ff047453 | Peter Maydell | default:
|
273 | ff047453 | Peter Maydell | abort(); |
274 | ff047453 | Peter Maydell | } |
275 | ff047453 | Peter Maydell | if (ret) {
|
276 | ff047453 | Peter Maydell | ok = false;
|
277 | ff047453 | Peter Maydell | } |
278 | ff047453 | Peter Maydell | } |
279 | ff047453 | Peter Maydell | return ok;
|
280 | ff047453 | Peter Maydell | } |
281 | ff047453 | Peter Maydell | |
282 | ff047453 | Peter Maydell | bool write_list_to_kvmstate(ARMCPU *cpu)
|
283 | ff047453 | Peter Maydell | { |
284 | ff047453 | Peter Maydell | CPUState *cs = CPU(cpu); |
285 | ff047453 | Peter Maydell | int i;
|
286 | ff047453 | Peter Maydell | bool ok = true; |
287 | ff047453 | Peter Maydell | |
288 | ff047453 | Peter Maydell | for (i = 0; i < cpu->cpreg_array_len; i++) { |
289 | ff047453 | Peter Maydell | struct kvm_one_reg r;
|
290 | ff047453 | Peter Maydell | uint64_t regidx = cpu->cpreg_indexes[i]; |
291 | ff047453 | Peter Maydell | uint32_t v32; |
292 | ff047453 | Peter Maydell | int ret;
|
293 | ff047453 | Peter Maydell | |
294 | ff047453 | Peter Maydell | r.id = regidx; |
295 | ff047453 | Peter Maydell | switch (regidx & KVM_REG_SIZE_MASK) {
|
296 | ff047453 | Peter Maydell | case KVM_REG_SIZE_U32:
|
297 | ff047453 | Peter Maydell | v32 = cpu->cpreg_values[i]; |
298 | ff047453 | Peter Maydell | r.addr = (uintptr_t)&v32; |
299 | ff047453 | Peter Maydell | break;
|
300 | ff047453 | Peter Maydell | case KVM_REG_SIZE_U64:
|
301 | ff047453 | Peter Maydell | r.addr = (uintptr_t)(cpu->cpreg_values + i); |
302 | ff047453 | Peter Maydell | break;
|
303 | ff047453 | Peter Maydell | default:
|
304 | ff047453 | Peter Maydell | abort(); |
305 | ff047453 | Peter Maydell | } |
306 | ff047453 | Peter Maydell | ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &r); |
307 | ff047453 | Peter Maydell | if (ret) {
|
308 | ff047453 | Peter Maydell | /* We might fail for "unknown register" and also for
|
309 | ff047453 | Peter Maydell | * "you tried to set a register which is constant with
|
310 | ff047453 | Peter Maydell | * a different value from what it actually contains".
|
311 | ff047453 | Peter Maydell | */
|
312 | ff047453 | Peter Maydell | ok = false;
|
313 | ff047453 | Peter Maydell | } |
314 | ff047453 | Peter Maydell | } |
315 | ff047453 | Peter Maydell | return ok;
|
316 | ff047453 | Peter Maydell | } |
317 | ff047453 | Peter Maydell | |
318 | 494b00c7 | Christoffer Dall | void kvm_arch_pre_run(CPUState *cs, struct kvm_run *run) |
319 | 494b00c7 | Christoffer Dall | { |
320 | 494b00c7 | Christoffer Dall | } |
321 | 494b00c7 | Christoffer Dall | |
322 | 494b00c7 | Christoffer Dall | void kvm_arch_post_run(CPUState *cs, struct kvm_run *run) |
323 | 494b00c7 | Christoffer Dall | { |
324 | 494b00c7 | Christoffer Dall | } |
325 | 494b00c7 | Christoffer Dall | |
326 | 494b00c7 | Christoffer Dall | int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) |
327 | 494b00c7 | Christoffer Dall | { |
328 | 494b00c7 | Christoffer Dall | return 0; |
329 | 494b00c7 | Christoffer Dall | } |
330 | 494b00c7 | Christoffer Dall | |
331 | 494b00c7 | Christoffer Dall | bool kvm_arch_stop_on_emulation_error(CPUState *cs)
|
332 | 494b00c7 | Christoffer Dall | { |
333 | 494b00c7 | Christoffer Dall | return true; |
334 | 494b00c7 | Christoffer Dall | } |
335 | 494b00c7 | Christoffer Dall | |
336 | 494b00c7 | Christoffer Dall | int kvm_arch_process_async_events(CPUState *cs)
|
337 | 494b00c7 | Christoffer Dall | { |
338 | 494b00c7 | Christoffer Dall | return 0; |
339 | 494b00c7 | Christoffer Dall | } |
340 | 494b00c7 | Christoffer Dall | |
341 | 494b00c7 | Christoffer Dall | int kvm_arch_on_sigbus_vcpu(CPUState *cs, int code, void *addr) |
342 | 494b00c7 | Christoffer Dall | { |
343 | 494b00c7 | Christoffer Dall | return 1; |
344 | 494b00c7 | Christoffer Dall | } |
345 | 494b00c7 | Christoffer Dall | |
346 | 494b00c7 | Christoffer Dall | int kvm_arch_on_sigbus(int code, void *addr) |
347 | 494b00c7 | Christoffer Dall | { |
348 | 494b00c7 | Christoffer Dall | return 1; |
349 | 494b00c7 | Christoffer Dall | } |
350 | 494b00c7 | Christoffer Dall | |
351 | 494b00c7 | Christoffer Dall | void kvm_arch_update_guest_debug(CPUState *cs, struct kvm_guest_debug *dbg) |
352 | 494b00c7 | Christoffer Dall | { |
353 | 494b00c7 | Christoffer Dall | qemu_log_mask(LOG_UNIMP, "%s: not implemented\n", __func__);
|
354 | 494b00c7 | Christoffer Dall | } |
355 | 494b00c7 | Christoffer Dall | |
356 | 494b00c7 | Christoffer Dall | int kvm_arch_insert_sw_breakpoint(CPUState *cs,
|
357 | 494b00c7 | Christoffer Dall | struct kvm_sw_breakpoint *bp)
|
358 | 494b00c7 | Christoffer Dall | { |
359 | 494b00c7 | Christoffer Dall | qemu_log_mask(LOG_UNIMP, "%s: not implemented\n", __func__);
|
360 | 494b00c7 | Christoffer Dall | return -EINVAL;
|
361 | 494b00c7 | Christoffer Dall | } |
362 | 494b00c7 | Christoffer Dall | |
363 | 494b00c7 | Christoffer Dall | int kvm_arch_insert_hw_breakpoint(target_ulong addr,
|
364 | 494b00c7 | Christoffer Dall | target_ulong len, int type)
|
365 | 494b00c7 | Christoffer Dall | { |
366 | 494b00c7 | Christoffer Dall | qemu_log_mask(LOG_UNIMP, "%s: not implemented\n", __func__);
|
367 | 494b00c7 | Christoffer Dall | return -EINVAL;
|
368 | 494b00c7 | Christoffer Dall | } |
369 | 494b00c7 | Christoffer Dall | |
370 | 494b00c7 | Christoffer Dall | int kvm_arch_remove_hw_breakpoint(target_ulong addr,
|
371 | 494b00c7 | Christoffer Dall | target_ulong len, int type)
|
372 | 494b00c7 | Christoffer Dall | { |
373 | 494b00c7 | Christoffer Dall | qemu_log_mask(LOG_UNIMP, "%s: not implemented\n", __func__);
|
374 | 494b00c7 | Christoffer Dall | return -EINVAL;
|
375 | 494b00c7 | Christoffer Dall | } |
376 | 494b00c7 | Christoffer Dall | |
377 | 494b00c7 | Christoffer Dall | int kvm_arch_remove_sw_breakpoint(CPUState *cs,
|
378 | 494b00c7 | Christoffer Dall | struct kvm_sw_breakpoint *bp)
|
379 | 494b00c7 | Christoffer Dall | { |
380 | 494b00c7 | Christoffer Dall | qemu_log_mask(LOG_UNIMP, "%s: not implemented\n", __func__);
|
381 | 494b00c7 | Christoffer Dall | return -EINVAL;
|
382 | 494b00c7 | Christoffer Dall | } |
383 | 494b00c7 | Christoffer Dall | |
384 | 494b00c7 | Christoffer Dall | void kvm_arch_remove_all_hw_breakpoints(void) |
385 | 494b00c7 | Christoffer Dall | { |
386 | 494b00c7 | Christoffer Dall | qemu_log_mask(LOG_UNIMP, "%s: not implemented\n", __func__);
|
387 | 494b00c7 | Christoffer Dall | } |
388 | b3a1c626 | Alexey Kardashevskiy | |
389 | b3a1c626 | Alexey Kardashevskiy | void kvm_arch_init_irq_routing(KVMState *s)
|
390 | b3a1c626 | Alexey Kardashevskiy | { |
391 | b3a1c626 | Alexey Kardashevskiy | } |