Avi Kivity | 6aa8b73 | 2006-12-10 02:21:36 -0800 | [diff] [blame] | 1 | #ifndef __KVM_SVM_H |
| 2 | #define __KVM_SVM_H |
| 3 | |
Ahmed S. Darwish | 9d8f549 | 2007-02-19 14:37:46 +0200 | [diff] [blame] | 4 | #include <linux/kernel.h> |
Avi Kivity | 6aa8b73 | 2006-12-10 02:21:36 -0800 | [diff] [blame] | 5 | #include <linux/types.h> |
| 6 | #include <linux/list.h> |
Avi Kivity | edf8841 | 2007-12-16 11:02:48 +0200 | [diff] [blame^] | 7 | #include <linux/kvm_host.h> |
Avi Kivity | 6aa8b73 | 2006-12-10 02:21:36 -0800 | [diff] [blame] | 8 | #include <asm/msr.h> |
| 9 | |
| 10 | #include "svm.h" |
Avi Kivity | 6aa8b73 | 2006-12-10 02:21:36 -0800 | [diff] [blame] | 11 | |
Anthony Liguori | 94dfbdb | 2007-04-29 11:56:06 +0300 | [diff] [blame] | 12 | static const u32 host_save_user_msrs[] = { |
Avi Kivity | 05b3e0c | 2006-12-13 00:33:45 -0800 | [diff] [blame] | 13 | #ifdef CONFIG_X86_64 |
Avi Kivity | 6aa8b73 | 2006-12-10 02:21:36 -0800 | [diff] [blame] | 14 | MSR_STAR, MSR_LSTAR, MSR_CSTAR, MSR_SYSCALL_MASK, MSR_KERNEL_GS_BASE, |
Anthony Liguori | 94dfbdb | 2007-04-29 11:56:06 +0300 | [diff] [blame] | 15 | MSR_FS_BASE, |
Avi Kivity | 6aa8b73 | 2006-12-10 02:21:36 -0800 | [diff] [blame] | 16 | #endif |
| 17 | MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP, |
Avi Kivity | 6aa8b73 | 2006-12-10 02:21:36 -0800 | [diff] [blame] | 18 | }; |
| 19 | |
Anthony Liguori | 94dfbdb | 2007-04-29 11:56:06 +0300 | [diff] [blame] | 20 | #define NR_HOST_SAVE_USER_MSRS ARRAY_SIZE(host_save_user_msrs) |
Avi Kivity | 6aa8b73 | 2006-12-10 02:21:36 -0800 | [diff] [blame] | 21 | #define NUM_DB_REGS 4 |
| 22 | |
Gregory Haskins | a2fa3e9 | 2007-07-27 08:13:10 -0400 | [diff] [blame] | 23 | struct kvm_vcpu; |
| 24 | |
Avi Kivity | 6aa8b73 | 2006-12-10 02:21:36 -0800 | [diff] [blame] | 25 | struct vcpu_svm { |
Rusty Russell | fb3f0f5 | 2007-07-27 17:16:56 +1000 | [diff] [blame] | 26 | struct kvm_vcpu vcpu; |
Avi Kivity | 6aa8b73 | 2006-12-10 02:21:36 -0800 | [diff] [blame] | 27 | struct vmcb *vmcb; |
| 28 | unsigned long vmcb_pa; |
| 29 | struct svm_cpu_data *svm_data; |
| 30 | uint64_t asid_generation; |
| 31 | |
Avi Kivity | 6aa8b73 | 2006-12-10 02:21:36 -0800 | [diff] [blame] | 32 | unsigned long db_regs[NUM_DB_REGS]; |
| 33 | |
| 34 | u64 next_rip; |
| 35 | |
Anthony Liguori | 94dfbdb | 2007-04-29 11:56:06 +0300 | [diff] [blame] | 36 | u64 host_user_msrs[NR_HOST_SAVE_USER_MSRS]; |
| 37 | u64 host_gs_base; |
Avi Kivity | 6aa8b73 | 2006-12-10 02:21:36 -0800 | [diff] [blame] | 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 | |