blob: ed66e4c078dc64229d5684d5bcf0ed5373098d7b [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>
Avi Kivityedf88412007-12-16 11:02:48 +02007#include <linux/kvm_host.h>
Avi Kivity6aa8b732006-12-10 02:21:36 -08008#include <asm/msr.h>
9
Eduardo Habkostc2cedf72008-11-17 19:03:14 -020010#include <asm/svm.h>
Avi Kivity6aa8b732006-12-10 02:21:36 -080011
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
Gregory Haskinsa2fa3e92007-07-27 08:13:10 -040022struct kvm_vcpu;
23
Avi Kivity6aa8b732006-12-10 02:21:36 -080024struct vcpu_svm {
Rusty Russellfb3f0f52007-07-27 17:16:56 +100025 struct kvm_vcpu vcpu;
Avi Kivity6aa8b732006-12-10 02:21:36 -080026 struct vmcb *vmcb;
27 unsigned long vmcb_pa;
28 struct svm_cpu_data *svm_data;
29 uint64_t asid_generation;
30
Avi Kivity6aa8b732006-12-10 02:21:36 -080031 u64 next_rip;
32
Anthony Liguori94dfbdb2007-04-29 11:56:06 +030033 u64 host_user_msrs[NR_HOST_SAVE_USER_MSRS];
34 u64 host_gs_base;
Avi Kivity6aa8b732006-12-10 02:21:36 -080035 unsigned long host_cr2;
Joerg Roedelf65c2292008-02-13 18:58:46 +010036
37 u32 *msrpm;
Alexander Grafb286d5d2008-11-25 20:17:05 +010038 struct vmcb *hsave;
39 u64 hsave_msr;
Alexander Graf3d6368e2008-11-25 20:17:07 +010040
41 u64 nested_vmcb;
42
43 /* These are the merged vectors */
44 u32 *nested_msrpm;
45
46 /* gpa pointers to the real vectors */
47 u64 nested_vmcb_msrpm;
Avi Kivity6aa8b732006-12-10 02:21:36 -080048};
49
50#endif
51