blob: ec0083f7e8b1657abeba1454116d8dc79d4a4d82 [file] [log] [blame]
aliguori05330442008-11-05 16:29:27 +00001/*
2 * QEMU KVM support
3 *
4 * Copyright IBM, Corp. 2008
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
11 *
12 */
13
14#ifndef QEMU_KVM_H
15#define QEMU_KVM_H
16
17#include "config.h"
18
19#ifdef CONFIG_KVM
20extern int kvm_allowed;
21
22#define kvm_enabled() (kvm_allowed)
23#else
24#define kvm_enabled() (0)
25#endif
26
27struct kvm_run;
28
29/* external API */
30
31int kvm_init(int smp_cpus);
32
33int kvm_init_vcpu(CPUState *env);
34
35int kvm_cpu_exec(CPUState *env);
36
37void kvm_set_phys_mem(target_phys_addr_t start_addr,
38 ram_addr_t size,
39 ram_addr_t phys_offset);
40
aliguori5832d1f2008-11-24 19:36:26 +000041void kvm_physical_sync_dirty_bitmap(target_phys_addr_t start_addr, target_phys_addr_t end_addr);
42
43int kvm_log_start(target_phys_addr_t phys_addr, target_phys_addr_t len);
44int kvm_log_stop(target_phys_addr_t phys_addr, target_phys_addr_t len);
aliguoribd322082008-12-04 20:33:06 +000045
46int kvm_has_sync_mmu(void);
47
aliguori05330442008-11-05 16:29:27 +000048/* internal API */
49
50struct KVMState;
51typedef struct KVMState KVMState;
52
aliguori984b5182008-11-13 19:21:00 +000053int kvm_ioctl(KVMState *s, int type, ...);
aliguori05330442008-11-05 16:29:27 +000054
aliguori984b5182008-11-13 19:21:00 +000055int kvm_vm_ioctl(KVMState *s, int type, ...);
aliguori05330442008-11-05 16:29:27 +000056
aliguori984b5182008-11-13 19:21:00 +000057int kvm_vcpu_ioctl(CPUState *env, int type, ...);
aliguori05330442008-11-05 16:29:27 +000058
59/* Arch specific hooks */
60
61int kvm_arch_post_run(CPUState *env, struct kvm_run *run);
62
63int kvm_arch_handle_exit(CPUState *env, struct kvm_run *run);
64
65int kvm_arch_pre_run(CPUState *env, struct kvm_run *run);
66
67int kvm_arch_get_registers(CPUState *env);
68
69int kvm_arch_put_registers(CPUState *env);
70
71int kvm_arch_init(KVMState *s, int smp_cpus);
72
73int kvm_arch_init_vcpu(CPUState *env);
74
75#endif