blob: 82e5d77acbba43bc1a4388ef77177730109b9dc9 [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
Anthony Liguori94dfbdb2007-04-29 11:56:06 +030012static const u32 host_save_user_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,
Anthony Liguori94dfbdb2007-04-29 11:56:06 +030015 MSR_FS_BASE,
Avi Kivity6aa8b732006-12-10 02:21:36 -080016#endif
17 MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP,
Avi Kivity6aa8b732006-12-10 02:21:36 -080018};
19
Anthony Liguori94dfbdb2007-04-29 11:56:06 +030020#define NR_HOST_SAVE_USER_MSRS ARRAY_SIZE(host_save_user_msrs)
Avi Kivity6aa8b732006-12-10 02:21:36 -080021#define NUM_DB_REGS 4
22
Gregory Haskinsa2fa3e92007-07-27 08:13:10 -040023struct kvm_vcpu;
24
Avi Kivity6aa8b732006-12-10 02:21:36 -080025struct vcpu_svm {
Gregory Haskinsa2fa3e92007-07-27 08:13:10 -040026 struct kvm_vcpu *vcpu;
Avi Kivity6aa8b732006-12-10 02:21:36 -080027 struct vmcb *vmcb;
28 unsigned long vmcb_pa;
29 struct svm_cpu_data *svm_data;
30 uint64_t asid_generation;
31
Avi Kivity6aa8b732006-12-10 02:21:36 -080032 unsigned long db_regs[NUM_DB_REGS];
33
34 u64 next_rip;
35
Anthony Liguori94dfbdb2007-04-29 11:56:06 +030036 u64 host_user_msrs[NR_HOST_SAVE_USER_MSRS];
37 u64 host_gs_base;
Avi Kivity6aa8b732006-12-10 02:21:36 -080038 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