diff options
author | Avi Kivity <avi@redhat.com> | 2009-05-31 11:15:37 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-09-10 01:32:44 -0400 |
commit | 6c8166a77c98f473eb91e96a61c3cf78ac617278 (patch) | |
tree | 89395728e590fa21da4d8274186a365df8ae7a0b | |
parent | b188d2d365702cfc660a56d66f4bf77ebf14a5c2 (diff) |
KVM: SVM: Fold kvm_svm.h info svm.c
kvm_svm.h is only included from svm.c, so fold it in.
Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r-- | arch/x86/kvm/kvm_svm.h | 53 | ||||
-rw-r--r-- | arch/x86/kvm/svm.c | 41 |
2 files changed, 40 insertions, 54 deletions
diff --git a/arch/x86/kvm/kvm_svm.h b/arch/x86/kvm/kvm_svm.h deleted file mode 100644 index 6f275b4cf628..000000000000 --- a/arch/x86/kvm/kvm_svm.h +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | #ifndef __KVM_SVM_H | ||
2 | #define __KVM_SVM_H | ||
3 | |||
4 | #include <linux/kernel.h> | ||
5 | #include <linux/types.h> | ||
6 | #include <linux/list.h> | ||
7 | #include <linux/kvm_host.h> | ||
8 | #include <asm/msr.h> | ||
9 | |||
10 | #include <asm/svm.h> | ||
11 | |||
12 | static const u32 host_save_user_msrs[] = { | ||
13 | #ifdef CONFIG_X86_64 | ||
14 | MSR_STAR, MSR_LSTAR, MSR_CSTAR, MSR_SYSCALL_MASK, MSR_KERNEL_GS_BASE, | ||
15 | MSR_FS_BASE, | ||
16 | #endif | ||
17 | MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP, | ||
18 | }; | ||
19 | |||
20 | #define NR_HOST_SAVE_USER_MSRS ARRAY_SIZE(host_save_user_msrs) | ||
21 | |||
22 | struct kvm_vcpu; | ||
23 | |||
24 | struct vcpu_svm { | ||
25 | struct kvm_vcpu vcpu; | ||
26 | struct vmcb *vmcb; | ||
27 | unsigned long vmcb_pa; | ||
28 | struct svm_cpu_data *svm_data; | ||
29 | uint64_t asid_generation; | ||
30 | uint64_t sysenter_esp; | ||
31 | uint64_t sysenter_eip; | ||
32 | |||
33 | u64 next_rip; | ||
34 | |||
35 | u64 host_user_msrs[NR_HOST_SAVE_USER_MSRS]; | ||
36 | u64 host_gs_base; | ||
37 | unsigned long host_cr2; | ||
38 | |||
39 | u32 *msrpm; | ||
40 | struct vmcb *hsave; | ||
41 | u64 hsave_msr; | ||
42 | |||
43 | u64 nested_vmcb; | ||
44 | |||
45 | /* These are the merged vectors */ | ||
46 | u32 *nested_msrpm; | ||
47 | |||
48 | /* gpa pointers to the real vectors */ | ||
49 | u64 nested_vmcb_msrpm; | ||
50 | }; | ||
51 | |||
52 | #endif | ||
53 | |||
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index e3e7edca35d1..522e69597a16 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -15,7 +15,6 @@ | |||
15 | */ | 15 | */ |
16 | #include <linux/kvm_host.h> | 16 | #include <linux/kvm_host.h> |
17 | 17 | ||
18 | #include "kvm_svm.h" | ||
19 | #include "irq.h" | 18 | #include "irq.h" |
20 | #include "mmu.h" | 19 | #include "mmu.h" |
21 | #include "kvm_cache_regs.h" | 20 | #include "kvm_cache_regs.h" |
@@ -57,6 +56,46 @@ MODULE_LICENSE("GPL"); | |||
57 | #define nsvm_printk(fmt, args...) do {} while(0) | 56 | #define nsvm_printk(fmt, args...) do {} while(0) |
58 | #endif | 57 | #endif |
59 | 58 | ||
59 | static const u32 host_save_user_msrs[] = { | ||
60 | #ifdef CONFIG_X86_64 | ||
61 | MSR_STAR, MSR_LSTAR, MSR_CSTAR, MSR_SYSCALL_MASK, MSR_KERNEL_GS_BASE, | ||
62 | MSR_FS_BASE, | ||
63 | #endif | ||
64 | MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP, | ||
65 | }; | ||
66 | |||
67 | #define NR_HOST_SAVE_USER_MSRS ARRAY_SIZE(host_save_user_msrs) | ||
68 | |||
69 | struct kvm_vcpu; | ||
70 | |||
71 | struct vcpu_svm { | ||
72 | struct kvm_vcpu vcpu; | ||
73 | struct vmcb *vmcb; | ||
74 | unsigned long vmcb_pa; | ||
75 | struct svm_cpu_data *svm_data; | ||
76 | uint64_t asid_generation; | ||
77 | uint64_t sysenter_esp; | ||
78 | uint64_t sysenter_eip; | ||
79 | |||
80 | u64 next_rip; | ||
81 | |||
82 | u64 host_user_msrs[NR_HOST_SAVE_USER_MSRS]; | ||
83 | u64 host_gs_base; | ||
84 | unsigned long host_cr2; | ||
85 | |||
86 | u32 *msrpm; | ||
87 | struct vmcb *hsave; | ||
88 | u64 hsave_msr; | ||
89 | |||
90 | u64 nested_vmcb; | ||
91 | |||
92 | /* These are the merged vectors */ | ||
93 | u32 *nested_msrpm; | ||
94 | |||
95 | /* gpa pointers to the real vectors */ | ||
96 | u64 nested_vmcb_msrpm; | ||
97 | }; | ||
98 | |||
60 | /* enable NPT for AMD64 and X86 with PAE */ | 99 | /* enable NPT for AMD64 and X86 with PAE */ |
61 | #if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE) | 100 | #if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE) |
62 | static bool npt_enabled = true; | 101 | static bool npt_enabled = true; |