diff options
author | Alexander Graf <agraf@suse.de> | 2009-10-30 01:47:04 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-11-05 00:49:52 -0500 |
commit | ca95150b3a9f3f3146a686296f2156a7ec6e98e9 (patch) | |
tree | 58e6907f7e56ca599c1578e33645a3054f91b914 /arch/powerpc/include/asm | |
parent | 83cd259d8e5b9878be0535f7ddd326676172279a (diff) |
Add Book3s fields to vcpu structs
We need to store more information than we currently have for vcpus
when running on Book3s.
So let's extend the internal struct definitions.
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r-- | arch/powerpc/include/asm/kvm_host.h | 73 |
1 files changed, 72 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index c9c930ed11d7..2cff5fe0cbe6 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h | |||
@@ -37,6 +37,8 @@ | |||
37 | #define KVM_NR_PAGE_SIZES 1 | 37 | #define KVM_NR_PAGE_SIZES 1 |
38 | #define KVM_PAGES_PER_HPAGE(x) (1UL<<31) | 38 | #define KVM_PAGES_PER_HPAGE(x) (1UL<<31) |
39 | 39 | ||
40 | #define HPTEG_CACHE_NUM 1024 | ||
41 | |||
40 | struct kvm; | 42 | struct kvm; |
41 | struct kvm_run; | 43 | struct kvm_run; |
42 | struct kvm_vcpu; | 44 | struct kvm_vcpu; |
@@ -63,6 +65,17 @@ struct kvm_vcpu_stat { | |||
63 | u32 dec_exits; | 65 | u32 dec_exits; |
64 | u32 ext_intr_exits; | 66 | u32 ext_intr_exits; |
65 | u32 halt_wakeup; | 67 | u32 halt_wakeup; |
68 | #ifdef CONFIG_PPC64 | ||
69 | u32 pf_storage; | ||
70 | u32 pf_instruc; | ||
71 | u32 sp_storage; | ||
72 | u32 sp_instruc; | ||
73 | u32 queue_intr; | ||
74 | u32 ld; | ||
75 | u32 ld_slow; | ||
76 | u32 st; | ||
77 | u32 st_slow; | ||
78 | #endif | ||
66 | }; | 79 | }; |
67 | 80 | ||
68 | enum kvm_exit_types { | 81 | enum kvm_exit_types { |
@@ -109,9 +122,53 @@ struct kvmppc_exit_timing { | |||
109 | struct kvm_arch { | 122 | struct kvm_arch { |
110 | }; | 123 | }; |
111 | 124 | ||
125 | struct kvmppc_pte { | ||
126 | u64 eaddr; | ||
127 | u64 vpage; | ||
128 | u64 raddr; | ||
129 | bool may_read; | ||
130 | bool may_write; | ||
131 | bool may_execute; | ||
132 | }; | ||
133 | |||
134 | struct kvmppc_mmu { | ||
135 | /* book3s_64 only */ | ||
136 | void (*slbmte)(struct kvm_vcpu *vcpu, u64 rb, u64 rs); | ||
137 | u64 (*slbmfee)(struct kvm_vcpu *vcpu, u64 slb_nr); | ||
138 | u64 (*slbmfev)(struct kvm_vcpu *vcpu, u64 slb_nr); | ||
139 | void (*slbie)(struct kvm_vcpu *vcpu, u64 slb_nr); | ||
140 | void (*slbia)(struct kvm_vcpu *vcpu); | ||
141 | /* book3s */ | ||
142 | void (*mtsrin)(struct kvm_vcpu *vcpu, u32 srnum, ulong value); | ||
143 | u32 (*mfsrin)(struct kvm_vcpu *vcpu, u32 srnum); | ||
144 | int (*xlate)(struct kvm_vcpu *vcpu, gva_t eaddr, struct kvmppc_pte *pte, bool data); | ||
145 | void (*reset_msr)(struct kvm_vcpu *vcpu); | ||
146 | void (*tlbie)(struct kvm_vcpu *vcpu, ulong addr, bool large); | ||
147 | int (*esid_to_vsid)(struct kvm_vcpu *vcpu, u64 esid, u64 *vsid); | ||
148 | u64 (*ea_to_vp)(struct kvm_vcpu *vcpu, gva_t eaddr, bool data); | ||
149 | bool (*is_dcbz32)(struct kvm_vcpu *vcpu); | ||
150 | }; | ||
151 | |||
152 | struct hpte_cache { | ||
153 | u64 host_va; | ||
154 | u64 pfn; | ||
155 | ulong slot; | ||
156 | struct kvmppc_pte pte; | ||
157 | }; | ||
158 | |||
112 | struct kvm_vcpu_arch { | 159 | struct kvm_vcpu_arch { |
113 | u32 host_stack; | 160 | ulong host_stack; |
114 | u32 host_pid; | 161 | u32 host_pid; |
162 | #ifdef CONFIG_PPC64 | ||
163 | ulong host_msr; | ||
164 | ulong host_r2; | ||
165 | void *host_retip; | ||
166 | ulong trampoline_lowmem; | ||
167 | ulong trampoline_enter; | ||
168 | ulong highmem_handler; | ||
169 | ulong host_paca_phys; | ||
170 | struct kvmppc_mmu mmu; | ||
171 | #endif | ||
115 | 172 | ||
116 | u64 fpr[32]; | 173 | u64 fpr[32]; |
117 | ulong gpr[32]; | 174 | ulong gpr[32]; |
@@ -123,6 +180,10 @@ struct kvm_vcpu_arch { | |||
123 | ulong xer; | 180 | ulong xer; |
124 | 181 | ||
125 | ulong msr; | 182 | ulong msr; |
183 | #ifdef CONFIG_PPC64 | ||
184 | ulong shadow_msr; | ||
185 | ulong hflags; | ||
186 | #endif | ||
126 | u32 mmucr; | 187 | u32 mmucr; |
127 | ulong sprg0; | 188 | ulong sprg0; |
128 | ulong sprg1; | 189 | ulong sprg1; |
@@ -149,6 +210,7 @@ struct kvm_vcpu_arch { | |||
149 | u32 ivor[64]; | 210 | u32 ivor[64]; |
150 | ulong ivpr; | 211 | ulong ivpr; |
151 | u32 pir; | 212 | u32 pir; |
213 | u32 pvr; | ||
152 | 214 | ||
153 | u32 shadow_pid; | 215 | u32 shadow_pid; |
154 | u32 pid; | 216 | u32 pid; |
@@ -174,6 +236,9 @@ struct kvm_vcpu_arch { | |||
174 | #endif | 236 | #endif |
175 | 237 | ||
176 | u32 last_inst; | 238 | u32 last_inst; |
239 | #ifdef CONFIG_PPC64 | ||
240 | ulong fault_dsisr; | ||
241 | #endif | ||
177 | ulong fault_dear; | 242 | ulong fault_dear; |
178 | ulong fault_esr; | 243 | ulong fault_esr; |
179 | gpa_t paddr_accessed; | 244 | gpa_t paddr_accessed; |
@@ -186,7 +251,13 @@ struct kvm_vcpu_arch { | |||
186 | u32 cpr0_cfgaddr; /* holds the last set cpr0_cfgaddr */ | 251 | u32 cpr0_cfgaddr; /* holds the last set cpr0_cfgaddr */ |
187 | 252 | ||
188 | struct timer_list dec_timer; | 253 | struct timer_list dec_timer; |
254 | u64 dec_jiffies; | ||
189 | unsigned long pending_exceptions; | 255 | unsigned long pending_exceptions; |
256 | |||
257 | #ifdef CONFIG_PPC64 | ||
258 | struct hpte_cache hpte_cache[HPTEG_CACHE_NUM]; | ||
259 | int hpte_cache_offset; | ||
260 | #endif | ||
190 | }; | 261 | }; |
191 | 262 | ||
192 | #endif /* __POWERPC_KVM_HOST_H__ */ | 263 | #endif /* __POWERPC_KVM_HOST_H__ */ |