xref: /kvmtool/include/kvm/kvm-cpu.h (revision 43835ac90fb7c14c3946772d778da4b62a0bfd7c)
1 #ifndef KVM__KVM_CPU_H
2 #define KVM__KVM_CPU_H
3 
4 #include <linux/kvm.h>	/* for struct kvm_regs */
5 
6 #include <pthread.h>
7 
8 struct kvm;
9 
10 struct kvm_cpu {
11 	pthread_t		thread;		/* VCPU thread */
12 
13 	unsigned long		cpu_id;
14 
15 	struct kvm		*kvm;		/* parent KVM */
16 	int			vcpu_fd;	/* For VCPU ioctls() */
17 	struct kvm_run		*kvm_run;
18 
19 	struct kvm_regs		regs;
20 	struct kvm_sregs	sregs;
21 	struct kvm_fpu		fpu;
22 
23 	struct kvm_msrs		*msrs;		/* dynamically allocated */
24 };
25 
26 struct kvm_cpu *kvm_cpu__init(struct kvm *kvm, unsigned long cpu_id);
27 void kvm_cpu__delete(struct kvm_cpu *vcpu);
28 void kvm_cpu__reset_vcpu(struct kvm_cpu *vcpu);
29 void kvm_cpu__setup_cpuid(struct kvm_cpu *vcpu);
30 void kvm_cpu__enable_singlestep(struct kvm_cpu *vcpu);
31 void kvm_cpu__run(struct kvm_cpu *vcpu);
32 int kvm_cpu__start(struct kvm_cpu *cpu);
33 
34 void kvm_cpu__show_code(struct kvm_cpu *vcpu);
35 void kvm_cpu__show_registers(struct kvm_cpu *vcpu);
36 void kvm_cpu__show_page_tables(struct kvm_cpu *vcpu);
37 
38 #endif /* KVM__KVM_CPU_H */
39