blob: 624f1ca48657e9d0f4fafd3d1c45b63fbfd1ebe3 [file] [log] [blame]
Avi Kivity6aa8b732006-12-10 02:21:36 -08001#ifndef __KVM_SVM_H
2#define __KVM_SVM_H
3
Ahmed S. Darwish9d8f5492007-02-19 14:37:46 +02004#include <linux/kernel.h>
Avi Kivity6aa8b732006-12-10 02:21:36 -08005#include <linux/types.h>
6#include <linux/list.h>
7#include <asm/msr.h>
8
9#include "svm.h"
10#include "kvm.h"
11
12static const u32 host_save_msrs[] = {
Avi Kivity05b3e0c2006-12-13 00:33:45 -080013#ifdef CONFIG_X86_64
Avi Kivity6aa8b732006-12-10 02:21:36 -080014 MSR_STAR, MSR_LSTAR, MSR_CSTAR, MSR_SYSCALL_MASK, MSR_KERNEL_GS_BASE,
15 MSR_FS_BASE, MSR_GS_BASE,
16#endif
17 MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP,
18 MSR_IA32_DEBUGCTLMSR, /*MSR_IA32_LASTBRANCHFROMIP,
19 MSR_IA32_LASTBRANCHTOIP, MSR_IA32_LASTINTFROMIP,MSR_IA32_LASTINTTOIP,*/
20};
21
Ahmed S. Darwish9d8f5492007-02-19 14:37:46 +020022#define NR_HOST_SAVE_MSRS ARRAY_SIZE(host_save_msrs)
Avi Kivity6aa8b732006-12-10 02:21:36 -080023#define NUM_DB_REGS 4
24
25struct vcpu_svm {
26 struct vmcb *vmcb;
27 unsigned long vmcb_pa;
28 struct svm_cpu_data *svm_data;
29 uint64_t asid_generation;
30
31 unsigned long cr0;
32 unsigned long cr4;
33 unsigned long db_regs[NUM_DB_REGS];
34
35 u64 next_rip;
36
37 u64 host_msrs[NR_HOST_SAVE_MSRS];
38 unsigned long host_cr2;
39 unsigned long host_db_regs[NUM_DB_REGS];
40 unsigned long host_dr6;
41 unsigned long host_dr7;
42};
43
44#endif
45