root / kvm.h @ 651721b2
History | View | Annotate | Download (1.7 kB)
1 | 05330448 | aliguori | /*
|
---|---|---|---|
2 | 05330448 | aliguori | * QEMU KVM support
|
3 | 05330448 | aliguori | *
|
4 | 05330448 | aliguori | * Copyright IBM, Corp. 2008
|
5 | 05330448 | aliguori | *
|
6 | 05330448 | aliguori | * Authors:
|
7 | 05330448 | aliguori | * Anthony Liguori <aliguori@us.ibm.com>
|
8 | 05330448 | aliguori | *
|
9 | 05330448 | aliguori | * This work is licensed under the terms of the GNU GPL, version 2 or later.
|
10 | 05330448 | aliguori | * See the COPYING file in the top-level directory.
|
11 | 05330448 | aliguori | *
|
12 | 05330448 | aliguori | */
|
13 | 05330448 | aliguori | |
14 | 05330448 | aliguori | #ifndef QEMU_KVM_H
|
15 | 05330448 | aliguori | #define QEMU_KVM_H
|
16 | 05330448 | aliguori | |
17 | 05330448 | aliguori | #include "config.h" |
18 | 05330448 | aliguori | |
19 | 05330448 | aliguori | #ifdef CONFIG_KVM
|
20 | 05330448 | aliguori | extern int kvm_allowed; |
21 | 05330448 | aliguori | |
22 | 05330448 | aliguori | #define kvm_enabled() (kvm_allowed)
|
23 | 05330448 | aliguori | #else
|
24 | 05330448 | aliguori | #define kvm_enabled() (0) |
25 | 05330448 | aliguori | #endif
|
26 | 05330448 | aliguori | |
27 | 05330448 | aliguori | struct kvm_run;
|
28 | 05330448 | aliguori | |
29 | 05330448 | aliguori | /* external API */
|
30 | 05330448 | aliguori | |
31 | 05330448 | aliguori | int kvm_init(int smp_cpus); |
32 | 05330448 | aliguori | |
33 | 05330448 | aliguori | int kvm_init_vcpu(CPUState *env);
|
34 | f5d6f51b | aliguori | int kvm_sync_vcpus(void); |
35 | 05330448 | aliguori | |
36 | 05330448 | aliguori | int kvm_cpu_exec(CPUState *env);
|
37 | 05330448 | aliguori | |
38 | 05330448 | aliguori | void kvm_set_phys_mem(target_phys_addr_t start_addr,
|
39 | 05330448 | aliguori | ram_addr_t size, |
40 | 05330448 | aliguori | ram_addr_t phys_offset); |
41 | 05330448 | aliguori | |
42 | 5832d1f2 | aliguori | void kvm_physical_sync_dirty_bitmap(target_phys_addr_t start_addr, target_phys_addr_t end_addr);
|
43 | 5832d1f2 | aliguori | |
44 | 5832d1f2 | aliguori | int kvm_log_start(target_phys_addr_t phys_addr, target_phys_addr_t len);
|
45 | 5832d1f2 | aliguori | int kvm_log_stop(target_phys_addr_t phys_addr, target_phys_addr_t len);
|
46 | bd322087 | aliguori | |
47 | bd322087 | aliguori | int kvm_has_sync_mmu(void); |
48 | bd322087 | aliguori | |
49 | f65ed4c1 | aliguori | int kvm_coalesce_mmio_region(target_phys_addr_t start, ram_addr_t size);
|
50 | f65ed4c1 | aliguori | int kvm_uncoalesce_mmio_region(target_phys_addr_t start, ram_addr_t size);
|
51 | f65ed4c1 | aliguori | |
52 | 05330448 | aliguori | /* internal API */
|
53 | 05330448 | aliguori | |
54 | 05330448 | aliguori | struct KVMState;
|
55 | 05330448 | aliguori | typedef struct KVMState KVMState; |
56 | 05330448 | aliguori | |
57 | 984b5181 | aliguori | int kvm_ioctl(KVMState *s, int type, ...); |
58 | 05330448 | aliguori | |
59 | 984b5181 | aliguori | int kvm_vm_ioctl(KVMState *s, int type, ...); |
60 | 05330448 | aliguori | |
61 | 984b5181 | aliguori | int kvm_vcpu_ioctl(CPUState *env, int type, ...); |
62 | 05330448 | aliguori | |
63 | 05330448 | aliguori | /* Arch specific hooks */
|
64 | 05330448 | aliguori | |
65 | 05330448 | aliguori | int kvm_arch_post_run(CPUState *env, struct kvm_run *run); |
66 | 05330448 | aliguori | |
67 | 05330448 | aliguori | int kvm_arch_handle_exit(CPUState *env, struct kvm_run *run); |
68 | 05330448 | aliguori | |
69 | 05330448 | aliguori | int kvm_arch_pre_run(CPUState *env, struct kvm_run *run); |
70 | 05330448 | aliguori | |
71 | 05330448 | aliguori | int kvm_arch_get_registers(CPUState *env);
|
72 | 05330448 | aliguori | |
73 | 05330448 | aliguori | int kvm_arch_put_registers(CPUState *env);
|
74 | 05330448 | aliguori | |
75 | 05330448 | aliguori | int kvm_arch_init(KVMState *s, int smp_cpus); |
76 | 05330448 | aliguori | |
77 | 05330448 | aliguori | int kvm_arch_init_vcpu(CPUState *env);
|
78 | 05330448 | aliguori | |
79 | 05330448 | aliguori | #endif |