diff options
Diffstat (limited to 'drivers/kvm/kvm_svm.h')
-rw-r--r-- | drivers/kvm/kvm_svm.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/kvm/kvm_svm.h b/drivers/kvm/kvm_svm.h new file mode 100644 index 000000000000..7d7f2aa10960 --- /dev/null +++ b/drivers/kvm/kvm_svm.h | |||
@@ -0,0 +1,44 @@ | |||
1 | #ifndef __KVM_SVM_H | ||
2 | #define __KVM_SVM_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/list.h> | ||
6 | #include <asm/msr.h> | ||
7 | |||
8 | #include "svm.h" | ||
9 | #include "kvm.h" | ||
10 | |||
11 | static const u32 host_save_msrs[] = { | ||
12 | #ifdef __x86_64__ | ||
13 | MSR_STAR, MSR_LSTAR, MSR_CSTAR, MSR_SYSCALL_MASK, MSR_KERNEL_GS_BASE, | ||
14 | MSR_FS_BASE, MSR_GS_BASE, | ||
15 | #endif | ||
16 | MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP, | ||
17 | MSR_IA32_DEBUGCTLMSR, /*MSR_IA32_LASTBRANCHFROMIP, | ||
18 | MSR_IA32_LASTBRANCHTOIP, MSR_IA32_LASTINTFROMIP,MSR_IA32_LASTINTTOIP,*/ | ||
19 | }; | ||
20 | |||
21 | #define NR_HOST_SAVE_MSRS (sizeof(host_save_msrs) / sizeof(*host_save_msrs)) | ||
22 | #define NUM_DB_REGS 4 | ||
23 | |||
24 | struct vcpu_svm { | ||
25 | struct vmcb *vmcb; | ||
26 | unsigned long vmcb_pa; | ||
27 | struct svm_cpu_data *svm_data; | ||
28 | uint64_t asid_generation; | ||
29 | |||
30 | unsigned long cr0; | ||
31 | unsigned long cr4; | ||
32 | unsigned long db_regs[NUM_DB_REGS]; | ||
33 | |||
34 | u64 next_rip; | ||
35 | |||
36 | u64 host_msrs[NR_HOST_SAVE_MSRS]; | ||
37 | unsigned long host_cr2; | ||
38 | unsigned long host_db_regs[NUM_DB_REGS]; | ||
39 | unsigned long host_dr6; | ||
40 | unsigned long host_dr7; | ||
41 | }; | ||
42 | |||
43 | #endif | ||
44 | |||