-
Notifications
You must be signed in to change notification settings - Fork 12
/
vcpu_info.h
42 lines (34 loc) · 889 Bytes
/
vcpu_info.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef __VCPU_INFO_H
#define __VCPU_INFO_H
#include <linux/list.h>
#include <linux/refcount.h>
#include <perf/cpumap.h>
#if defined(__i386__) || defined(__x86_64__)
#include <asm/pvclock.h>
#endif
struct vcpu_data {
/* from libvirtd */
int host_cpu; // vcpu -> host_cpu
int thread_id; // vcpu -> thread_id
#if defined(__i386__) || defined(__x86_64__)
bool pvclock_update;
/* from kvm */
u64 tsc_offset;
u64 tsc_scaling_ratio;
u64 tsc_scaling_ratio_frac_bits;
struct pvclock_vcpu_time_info pvti;
#endif
};
struct vcpu_info {
struct list_head vm_link;
const char *uuid;
refcount_t ref;
pid_t tgid;
int kvm_vm_fd;
int nr_vcpu;
struct perf_cpu_map **host_cpus; // vcpu -> host_cpu map
struct vcpu_data vcpu[0];
};
struct vcpu_info *vcpu_info_get(const char *uuid);
void vcpu_info_put(struct vcpu_info *vcpu);
#endif