aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/booke.c
diff options
context:
space:
mode:
authorHollis Blanchard <hollisb@us.ibm.com>2008-12-02 16:51:58 -0500
committerAvi Kivity <avi@redhat.com>2008-12-31 09:55:41 -0500
commit7b7015914b30ad8d9136d41412c5129b9bc9af70 (patch)
treec0764fff834b784d933126f30ef5562aef0dc55c /arch/powerpc/kvm/booke.c
parent73e75b416ffcfa3a84952d8e389a0eca080f00e1 (diff)
KVM: ppc: mostly cosmetic updates to the exit timing accounting code
The only significant changes were to kvmppc_exit_timing_write() and kvmppc_exit_timing_show(), both of which were dramatically simplified. Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/booke.c')
-rw-r--r--arch/powerpc/kvm/booke.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 0f171248e450..35485dd6927e 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -202,7 +202,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
202 break; 202 break;
203 203
204 case BOOKE_INTERRUPT_EXTERNAL: 204 case BOOKE_INTERRUPT_EXTERNAL:
205 account_exit(vcpu, EXT_INTR_EXITS); 205 kvmppc_account_exit(vcpu, EXT_INTR_EXITS);
206 if (need_resched()) 206 if (need_resched())
207 cond_resched(); 207 cond_resched();
208 r = RESUME_GUEST; 208 r = RESUME_GUEST;
@@ -212,7 +212,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
212 /* Since we switched IVPR back to the host's value, the host 212 /* Since we switched IVPR back to the host's value, the host
213 * handled this interrupt the moment we enabled interrupts. 213 * handled this interrupt the moment we enabled interrupts.
214 * Now we just offer it a chance to reschedule the guest. */ 214 * Now we just offer it a chance to reschedule the guest. */
215 account_exit(vcpu, DEC_EXITS); 215 kvmppc_account_exit(vcpu, DEC_EXITS);
216 if (need_resched()) 216 if (need_resched())
217 cond_resched(); 217 cond_resched();
218 r = RESUME_GUEST; 218 r = RESUME_GUEST;
@@ -225,7 +225,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
225 vcpu->arch.esr = vcpu->arch.fault_esr; 225 vcpu->arch.esr = vcpu->arch.fault_esr;
226 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_PROGRAM); 226 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_PROGRAM);
227 r = RESUME_GUEST; 227 r = RESUME_GUEST;
228 account_exit(vcpu, USR_PR_INST); 228 kvmppc_account_exit(vcpu, USR_PR_INST);
229 break; 229 break;
230 } 230 }
231 231
@@ -233,7 +233,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
233 switch (er) { 233 switch (er) {
234 case EMULATE_DONE: 234 case EMULATE_DONE:
235 /* don't overwrite subtypes, just account kvm_stats */ 235 /* don't overwrite subtypes, just account kvm_stats */
236 account_exit_stat(vcpu, EMULATED_INST_EXITS); 236 kvmppc_account_exit_stat(vcpu, EMULATED_INST_EXITS);
237 /* Future optimization: only reload non-volatiles if 237 /* Future optimization: only reload non-volatiles if
238 * they were actually modified by emulation. */ 238 * they were actually modified by emulation. */
239 r = RESUME_GUEST_NV; 239 r = RESUME_GUEST_NV;
@@ -259,7 +259,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
259 259
260 case BOOKE_INTERRUPT_FP_UNAVAIL: 260 case BOOKE_INTERRUPT_FP_UNAVAIL:
261 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_FP_UNAVAIL); 261 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_FP_UNAVAIL);
262 account_exit(vcpu, FP_UNAVAIL); 262 kvmppc_account_exit(vcpu, FP_UNAVAIL);
263 r = RESUME_GUEST; 263 r = RESUME_GUEST;
264 break; 264 break;
265 265
@@ -267,20 +267,20 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
267 vcpu->arch.dear = vcpu->arch.fault_dear; 267 vcpu->arch.dear = vcpu->arch.fault_dear;
268 vcpu->arch.esr = vcpu->arch.fault_esr; 268 vcpu->arch.esr = vcpu->arch.fault_esr;
269 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DATA_STORAGE); 269 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DATA_STORAGE);
270 account_exit(vcpu, DSI_EXITS); 270 kvmppc_account_exit(vcpu, DSI_EXITS);
271 r = RESUME_GUEST; 271 r = RESUME_GUEST;
272 break; 272 break;
273 273
274 case BOOKE_INTERRUPT_INST_STORAGE: 274 case BOOKE_INTERRUPT_INST_STORAGE:
275 vcpu->arch.esr = vcpu->arch.fault_esr; 275 vcpu->arch.esr = vcpu->arch.fault_esr;
276 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_INST_STORAGE); 276 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_INST_STORAGE);
277 account_exit(vcpu, ISI_EXITS); 277 kvmppc_account_exit(vcpu, ISI_EXITS);
278 r = RESUME_GUEST; 278 r = RESUME_GUEST;
279 break; 279 break;
280 280
281 case BOOKE_INTERRUPT_SYSCALL: 281 case BOOKE_INTERRUPT_SYSCALL:
282 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_SYSCALL); 282 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_SYSCALL);
283 account_exit(vcpu, SYSCALL_EXITS); 283 kvmppc_account_exit(vcpu, SYSCALL_EXITS);
284 r = RESUME_GUEST; 284 r = RESUME_GUEST;
285 break; 285 break;
286 286
@@ -299,7 +299,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
299 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DTLB_MISS); 299 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DTLB_MISS);
300 vcpu->arch.dear = vcpu->arch.fault_dear; 300 vcpu->arch.dear = vcpu->arch.fault_dear;
301 vcpu->arch.esr = vcpu->arch.fault_esr; 301 vcpu->arch.esr = vcpu->arch.fault_esr;
302 account_exit(vcpu, DTLB_REAL_MISS_EXITS); 302 kvmppc_account_exit(vcpu, DTLB_REAL_MISS_EXITS);
303 r = RESUME_GUEST; 303 r = RESUME_GUEST;
304 break; 304 break;
305 } 305 }
@@ -317,13 +317,13 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
317 * invoking the guest. */ 317 * invoking the guest. */
318 kvmppc_mmu_map(vcpu, eaddr, vcpu->arch.paddr_accessed, gtlbe->tid, 318 kvmppc_mmu_map(vcpu, eaddr, vcpu->arch.paddr_accessed, gtlbe->tid,
319 gtlbe->word2, get_tlb_bytes(gtlbe), gtlb_index); 319 gtlbe->word2, get_tlb_bytes(gtlbe), gtlb_index);
320 account_exit(vcpu, DTLB_VIRT_MISS_EXITS); 320 kvmppc_account_exit(vcpu, DTLB_VIRT_MISS_EXITS);
321 r = RESUME_GUEST; 321 r = RESUME_GUEST;
322 } else { 322 } else {
323 /* Guest has mapped and accessed a page which is not 323 /* Guest has mapped and accessed a page which is not
324 * actually RAM. */ 324 * actually RAM. */
325 r = kvmppc_emulate_mmio(run, vcpu); 325 r = kvmppc_emulate_mmio(run, vcpu);
326 account_exit(vcpu, MMIO_EXITS); 326 kvmppc_account_exit(vcpu, MMIO_EXITS);
327 } 327 }
328 328
329 break; 329 break;
@@ -345,11 +345,11 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
345 if (gtlb_index < 0) { 345 if (gtlb_index < 0) {
346 /* The guest didn't have a mapping for it. */ 346 /* The guest didn't have a mapping for it. */
347 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_ITLB_MISS); 347 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_ITLB_MISS);
348 account_exit(vcpu, ITLB_REAL_MISS_EXITS); 348 kvmppc_account_exit(vcpu, ITLB_REAL_MISS_EXITS);
349 break; 349 break;
350 } 350 }
351 351
352 account_exit(vcpu, ITLB_VIRT_MISS_EXITS); 352 kvmppc_account_exit(vcpu, ITLB_VIRT_MISS_EXITS);
353 353
354 gtlbe = &vcpu_44x->guest_tlb[gtlb_index]; 354 gtlbe = &vcpu_44x->guest_tlb[gtlb_index];
355 gpaddr = tlb_xlate(gtlbe, eaddr); 355 gpaddr = tlb_xlate(gtlbe, eaddr);
@@ -383,7 +383,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
383 mtspr(SPRN_DBSR, dbsr); 383 mtspr(SPRN_DBSR, dbsr);
384 384
385 run->exit_reason = KVM_EXIT_DEBUG; 385 run->exit_reason = KVM_EXIT_DEBUG;
386 account_exit(vcpu, DEBUG_EXITS); 386 kvmppc_account_exit(vcpu, DEBUG_EXITS);
387 r = RESUME_HOST; 387 r = RESUME_HOST;
388 break; 388 break;
389 } 389 }
@@ -404,7 +404,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
404 if (signal_pending(current)) { 404 if (signal_pending(current)) {
405 run->exit_reason = KVM_EXIT_INTR; 405 run->exit_reason = KVM_EXIT_INTR;
406 r = (-EINTR << 2) | RESUME_HOST | (r & RESUME_FLAG_NV); 406 r = (-EINTR << 2) | RESUME_HOST | (r & RESUME_FLAG_NV);
407 account_exit(vcpu, SIGNAL_EXITS); 407 kvmppc_account_exit(vcpu, SIGNAL_EXITS);
408 } 408 }
409 } 409 }
410 410