00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef QEMU_KVM_H
00015 #define QEMU_KVM_H
00016
00017 #include "config.h"
00018
00019 #ifdef CONFIG_KVM
00020 extern int kvm_allowed;
00021
00022 #define kvm_enabled() (kvm_allowed)
00023 #else
00024 #define kvm_enabled() (0)
00025 #endif
00026
00027 struct kvm_run;
00028
00029
00030
00031 int kvm_init(int smp_cpus);
00032
00033 int kvm_init_vcpu(CPUState *env);
00034 int kvm_sync_vcpus(void);
00035
00036 int kvm_cpu_exec(CPUState *env);
00037
00038 void kvm_set_phys_mem(target_phys_addr_t start_addr,
00039 ram_addr_t size,
00040 ram_addr_t phys_offset);
00041
00042 void kvm_physical_sync_dirty_bitmap(target_phys_addr_t start_addr, target_phys_addr_t end_addr);
00043
00044 int kvm_log_start(target_phys_addr_t phys_addr, target_phys_addr_t len);
00045 int kvm_log_stop(target_phys_addr_t phys_addr, target_phys_addr_t len);
00046
00047 int kvm_has_sync_mmu(void);
00048
00049 void kvm_setup_guest_memory(void *start, size_t size);
00050
00051 int kvm_coalesce_mmio_region(target_phys_addr_t start, ram_addr_t size);
00052 int kvm_uncoalesce_mmio_region(target_phys_addr_t start, ram_addr_t size);
00053
00054
00055
00056 struct KVMState;
00057 typedef struct KVMState KVMState;
00058
00059 int kvm_ioctl(KVMState *s, int type, ...);
00060
00061 int kvm_vm_ioctl(KVMState *s, int type, ...);
00062
00063 int kvm_vcpu_ioctl(CPUState *env, int type, ...);
00064
00065
00066
00067 int kvm_arch_post_run(CPUState *env, struct kvm_run *run);
00068
00069 int kvm_arch_handle_exit(CPUState *env, struct kvm_run *run);
00070
00071 int kvm_arch_pre_run(CPUState *env, struct kvm_run *run);
00072
00073 int kvm_arch_get_registers(CPUState *env);
00074
00075 int kvm_arch_put_registers(CPUState *env);
00076
00077 int kvm_arch_init(KVMState *s, int smp_cpus);
00078
00079 int kvm_arch_init_vcpu(CPUState *env);
00080
00081 int kvm_check_extension(KVMState *s, unsigned int extension);
00082
00083 uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function,
00084 int reg);
00085 #endif