]>
Commit | Line | Data |
---|---|---|
05330448 AL |
1 | /* |
2 | * QEMU KVM support | |
3 | * | |
4 | * Copyright IBM, Corp. 2008 | |
5 | * | |
6 | * Authors: | |
7 | * Anthony Liguori <[email protected]> | |
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 | |
20 | extern int kvm_allowed; | |
21 | ||
22 | #define kvm_enabled() (kvm_allowed) | |
23 | #else | |
24 | #define kvm_enabled() (0) | |
25 | #endif | |
26 | ||
27 | struct kvm_run; | |
28 | ||
29 | /* external API */ | |
30 | ||
31 | int kvm_init(int smp_cpus); | |
32 | ||
33 | int kvm_init_vcpu(CPUState *env); | |
34 | ||
35 | int kvm_cpu_exec(CPUState *env); | |
36 | ||
37 | void kvm_set_phys_mem(target_phys_addr_t start_addr, | |
38 | ram_addr_t size, | |
39 | ram_addr_t phys_offset); | |
40 | ||
5832d1f2 AL |
41 | void kvm_physical_sync_dirty_bitmap(target_phys_addr_t start_addr, target_phys_addr_t end_addr); |
42 | ||
43 | int kvm_log_start(target_phys_addr_t phys_addr, target_phys_addr_t len); | |
44 | int kvm_log_stop(target_phys_addr_t phys_addr, target_phys_addr_t len); | |
bd322087 AL |
45 | |
46 | int kvm_has_sync_mmu(void); | |
47 | ||
f65ed4c1 AL |
48 | int kvm_coalesce_mmio_region(target_phys_addr_t start, ram_addr_t size); |
49 | int kvm_uncoalesce_mmio_region(target_phys_addr_t start, ram_addr_t size); | |
50 | ||
05330448 AL |
51 | /* internal API */ |
52 | ||
53 | struct KVMState; | |
54 | typedef struct KVMState KVMState; | |
55 | ||
984b5181 | 56 | int kvm_ioctl(KVMState *s, int type, ...); |
05330448 | 57 | |
984b5181 | 58 | int kvm_vm_ioctl(KVMState *s, int type, ...); |
05330448 | 59 | |
984b5181 | 60 | int kvm_vcpu_ioctl(CPUState *env, int type, ...); |
05330448 AL |
61 | |
62 | /* Arch specific hooks */ | |
63 | ||
64 | int kvm_arch_post_run(CPUState *env, struct kvm_run *run); | |
65 | ||
66 | int kvm_arch_handle_exit(CPUState *env, struct kvm_run *run); | |
67 | ||
68 | int kvm_arch_pre_run(CPUState *env, struct kvm_run *run); | |
69 | ||
70 | int kvm_arch_get_registers(CPUState *env); | |
71 | ||
72 | int kvm_arch_put_registers(CPUState *env); | |
73 | ||
74 | int kvm_arch_init(KVMState *s, int smp_cpus); | |
75 | ||
76 | int kvm_arch_init_vcpu(CPUState *env); | |
77 | ||
78 | #endif |