• Home
  • Raw
  • Download

Lines Matching refs:vcpu

24 static void kvmppc_emul_rfi(struct kvm_vcpu *vcpu)  in kvmppc_emul_rfi()  argument
26 vcpu->arch.regs.nip = vcpu->arch.shared->srr0; in kvmppc_emul_rfi()
27 kvmppc_set_msr(vcpu, vcpu->arch.shared->srr1); in kvmppc_emul_rfi()
30 static void kvmppc_emul_rfdi(struct kvm_vcpu *vcpu) in kvmppc_emul_rfdi() argument
32 vcpu->arch.regs.nip = vcpu->arch.dsrr0; in kvmppc_emul_rfdi()
33 kvmppc_set_msr(vcpu, vcpu->arch.dsrr1); in kvmppc_emul_rfdi()
36 static void kvmppc_emul_rfci(struct kvm_vcpu *vcpu) in kvmppc_emul_rfci() argument
38 vcpu->arch.regs.nip = vcpu->arch.csrr0; in kvmppc_emul_rfci()
39 kvmppc_set_msr(vcpu, vcpu->arch.csrr1); in kvmppc_emul_rfci()
42 int kvmppc_booke_emulate_op(struct kvm_vcpu *vcpu, in kvmppc_booke_emulate_op() argument
53 kvmppc_emul_rfi(vcpu); in kvmppc_booke_emulate_op()
54 kvmppc_set_exit_type(vcpu, EMULATED_RFI_EXITS); in kvmppc_booke_emulate_op()
59 kvmppc_emul_rfci(vcpu); in kvmppc_booke_emulate_op()
60 kvmppc_set_exit_type(vcpu, EMULATED_RFCI_EXITS); in kvmppc_booke_emulate_op()
65 kvmppc_emul_rfdi(vcpu); in kvmppc_booke_emulate_op()
66 kvmppc_set_exit_type(vcpu, EMULATED_RFDI_EXITS); in kvmppc_booke_emulate_op()
80 kvmppc_set_gpr(vcpu, rt, vcpu->arch.shared->msr); in kvmppc_booke_emulate_op()
81 kvmppc_set_exit_type(vcpu, EMULATED_MFMSR_EXITS); in kvmppc_booke_emulate_op()
85 kvmppc_set_exit_type(vcpu, EMULATED_MTMSR_EXITS); in kvmppc_booke_emulate_op()
86 kvmppc_set_msr(vcpu, kvmppc_get_gpr(vcpu, rs)); in kvmppc_booke_emulate_op()
90 vcpu->arch.shared->msr = (vcpu->arch.shared->msr & ~MSR_EE) in kvmppc_booke_emulate_op()
91 | (kvmppc_get_gpr(vcpu, rs) & MSR_EE); in kvmppc_booke_emulate_op()
92 kvmppc_set_exit_type(vcpu, EMULATED_WRTEE_EXITS); in kvmppc_booke_emulate_op()
96 vcpu->arch.shared->msr = (vcpu->arch.shared->msr & ~MSR_EE) in kvmppc_booke_emulate_op()
98 kvmppc_set_exit_type(vcpu, EMULATED_WRTEE_EXITS); in kvmppc_booke_emulate_op()
120 int kvmppc_booke_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, ulong spr_val) in kvmppc_booke_emulate_mtspr() argument
127 vcpu->arch.shared->dar = spr_val; in kvmppc_booke_emulate_mtspr()
130 vcpu->arch.shared->esr = spr_val; in kvmppc_booke_emulate_mtspr()
133 vcpu->arch.csrr0 = spr_val; in kvmppc_booke_emulate_mtspr()
136 vcpu->arch.csrr1 = spr_val; in kvmppc_booke_emulate_mtspr()
139 vcpu->arch.dsrr0 = spr_val; in kvmppc_booke_emulate_mtspr()
142 vcpu->arch.dsrr1 = spr_val; in kvmppc_booke_emulate_mtspr()
149 if (vcpu->guest_debug) in kvmppc_booke_emulate_mtspr()
153 vcpu->arch.dbg_reg.iac1 = spr_val; in kvmppc_booke_emulate_mtspr()
160 if (vcpu->guest_debug) in kvmppc_booke_emulate_mtspr()
164 vcpu->arch.dbg_reg.iac2 = spr_val; in kvmppc_booke_emulate_mtspr()
172 if (vcpu->guest_debug) in kvmppc_booke_emulate_mtspr()
176 vcpu->arch.dbg_reg.iac3 = spr_val; in kvmppc_booke_emulate_mtspr()
183 if (vcpu->guest_debug) in kvmppc_booke_emulate_mtspr()
187 vcpu->arch.dbg_reg.iac4 = spr_val; in kvmppc_booke_emulate_mtspr()
195 if (vcpu->guest_debug) in kvmppc_booke_emulate_mtspr()
199 vcpu->arch.dbg_reg.dac1 = spr_val; in kvmppc_booke_emulate_mtspr()
206 if (vcpu->guest_debug) in kvmppc_booke_emulate_mtspr()
210 vcpu->arch.dbg_reg.dac2 = spr_val; in kvmppc_booke_emulate_mtspr()
217 if (vcpu->guest_debug) in kvmppc_booke_emulate_mtspr()
225 vcpu->arch.dbg_reg.dbcr0 = spr_val; in kvmppc_booke_emulate_mtspr()
232 if (vcpu->guest_debug) in kvmppc_booke_emulate_mtspr()
236 vcpu->arch.dbg_reg.dbcr1 = spr_val; in kvmppc_booke_emulate_mtspr()
243 if (vcpu->guest_debug) in kvmppc_booke_emulate_mtspr()
247 vcpu->arch.dbg_reg.dbcr2 = spr_val; in kvmppc_booke_emulate_mtspr()
254 if (vcpu->guest_debug) in kvmppc_booke_emulate_mtspr()
257 vcpu->arch.dbsr &= ~spr_val; in kvmppc_booke_emulate_mtspr()
258 if (!(vcpu->arch.dbsr & ~DBSR_IDE)) in kvmppc_booke_emulate_mtspr()
259 kvmppc_core_dequeue_debug(vcpu); in kvmppc_booke_emulate_mtspr()
262 kvmppc_clr_tsr_bits(vcpu, spr_val); in kvmppc_booke_emulate_mtspr()
269 if (vcpu->arch.tcr & TCR_WRC_MASK) { in kvmppc_booke_emulate_mtspr()
271 spr_val |= vcpu->arch.tcr & TCR_WRC_MASK; in kvmppc_booke_emulate_mtspr()
273 kvmppc_set_tcr(vcpu, spr_val); in kvmppc_booke_emulate_mtspr()
277 vcpu->arch.decar = spr_val; in kvmppc_booke_emulate_mtspr()
285 kvmppc_set_sprg4(vcpu, spr_val); in kvmppc_booke_emulate_mtspr()
288 kvmppc_set_sprg5(vcpu, spr_val); in kvmppc_booke_emulate_mtspr()
291 kvmppc_set_sprg6(vcpu, spr_val); in kvmppc_booke_emulate_mtspr()
294 kvmppc_set_sprg7(vcpu, spr_val); in kvmppc_booke_emulate_mtspr()
298 vcpu->arch.ivpr = spr_val; in kvmppc_booke_emulate_mtspr()
304 vcpu->arch.ivor[BOOKE_IRQPRIO_CRITICAL] = spr_val; in kvmppc_booke_emulate_mtspr()
307 vcpu->arch.ivor[BOOKE_IRQPRIO_MACHINE_CHECK] = spr_val; in kvmppc_booke_emulate_mtspr()
310 vcpu->arch.ivor[BOOKE_IRQPRIO_DATA_STORAGE] = spr_val; in kvmppc_booke_emulate_mtspr()
316 vcpu->arch.ivor[BOOKE_IRQPRIO_INST_STORAGE] = spr_val; in kvmppc_booke_emulate_mtspr()
319 vcpu->arch.ivor[BOOKE_IRQPRIO_EXTERNAL] = spr_val; in kvmppc_booke_emulate_mtspr()
322 vcpu->arch.ivor[BOOKE_IRQPRIO_ALIGNMENT] = spr_val; in kvmppc_booke_emulate_mtspr()
325 vcpu->arch.ivor[BOOKE_IRQPRIO_PROGRAM] = spr_val; in kvmppc_booke_emulate_mtspr()
328 vcpu->arch.ivor[BOOKE_IRQPRIO_FP_UNAVAIL] = spr_val; in kvmppc_booke_emulate_mtspr()
331 vcpu->arch.ivor[BOOKE_IRQPRIO_SYSCALL] = spr_val; in kvmppc_booke_emulate_mtspr()
337 vcpu->arch.ivor[BOOKE_IRQPRIO_AP_UNAVAIL] = spr_val; in kvmppc_booke_emulate_mtspr()
340 vcpu->arch.ivor[BOOKE_IRQPRIO_DECREMENTER] = spr_val; in kvmppc_booke_emulate_mtspr()
343 vcpu->arch.ivor[BOOKE_IRQPRIO_FIT] = spr_val; in kvmppc_booke_emulate_mtspr()
346 vcpu->arch.ivor[BOOKE_IRQPRIO_WATCHDOG] = spr_val; in kvmppc_booke_emulate_mtspr()
349 vcpu->arch.ivor[BOOKE_IRQPRIO_DTLB_MISS] = spr_val; in kvmppc_booke_emulate_mtspr()
352 vcpu->arch.ivor[BOOKE_IRQPRIO_ITLB_MISS] = spr_val; in kvmppc_booke_emulate_mtspr()
355 vcpu->arch.ivor[BOOKE_IRQPRIO_DEBUG] = spr_val; in kvmppc_booke_emulate_mtspr()
358 vcpu->arch.mcsr &= ~spr_val; in kvmppc_booke_emulate_mtspr()
362 kvmppc_set_epcr(vcpu, spr_val); in kvmppc_booke_emulate_mtspr()
364 mtspr(SPRN_EPCR, vcpu->arch.shadow_epcr); in kvmppc_booke_emulate_mtspr()
373 current->thread.debug = vcpu->arch.dbg_reg; in kvmppc_booke_emulate_mtspr()
374 switch_booke_debug_regs(&vcpu->arch.dbg_reg); in kvmppc_booke_emulate_mtspr()
379 int kvmppc_booke_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, ulong *spr_val) in kvmppc_booke_emulate_mfspr() argument
385 *spr_val = vcpu->arch.ivpr; in kvmppc_booke_emulate_mfspr()
388 *spr_val = vcpu->arch.shared->dar; in kvmppc_booke_emulate_mfspr()
391 *spr_val = vcpu->arch.shared->esr; in kvmppc_booke_emulate_mfspr()
394 *spr_val = vcpu->arch.epr; in kvmppc_booke_emulate_mfspr()
397 *spr_val = vcpu->arch.csrr0; in kvmppc_booke_emulate_mfspr()
400 *spr_val = vcpu->arch.csrr1; in kvmppc_booke_emulate_mfspr()
403 *spr_val = vcpu->arch.dsrr0; in kvmppc_booke_emulate_mfspr()
406 *spr_val = vcpu->arch.dsrr1; in kvmppc_booke_emulate_mfspr()
409 *spr_val = vcpu->arch.dbg_reg.iac1; in kvmppc_booke_emulate_mfspr()
412 *spr_val = vcpu->arch.dbg_reg.iac2; in kvmppc_booke_emulate_mfspr()
416 *spr_val = vcpu->arch.dbg_reg.iac3; in kvmppc_booke_emulate_mfspr()
419 *spr_val = vcpu->arch.dbg_reg.iac4; in kvmppc_booke_emulate_mfspr()
423 *spr_val = vcpu->arch.dbg_reg.dac1; in kvmppc_booke_emulate_mfspr()
426 *spr_val = vcpu->arch.dbg_reg.dac2; in kvmppc_booke_emulate_mfspr()
429 *spr_val = vcpu->arch.dbg_reg.dbcr0; in kvmppc_booke_emulate_mfspr()
430 if (vcpu->guest_debug) in kvmppc_booke_emulate_mfspr()
434 *spr_val = vcpu->arch.dbg_reg.dbcr1; in kvmppc_booke_emulate_mfspr()
437 *spr_val = vcpu->arch.dbg_reg.dbcr2; in kvmppc_booke_emulate_mfspr()
440 *spr_val = vcpu->arch.dbsr; in kvmppc_booke_emulate_mfspr()
443 *spr_val = vcpu->arch.tsr; in kvmppc_booke_emulate_mfspr()
446 *spr_val = vcpu->arch.tcr; in kvmppc_booke_emulate_mfspr()
450 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_CRITICAL]; in kvmppc_booke_emulate_mfspr()
453 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_MACHINE_CHECK]; in kvmppc_booke_emulate_mfspr()
456 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_DATA_STORAGE]; in kvmppc_booke_emulate_mfspr()
459 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_INST_STORAGE]; in kvmppc_booke_emulate_mfspr()
462 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_EXTERNAL]; in kvmppc_booke_emulate_mfspr()
465 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_ALIGNMENT]; in kvmppc_booke_emulate_mfspr()
468 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_PROGRAM]; in kvmppc_booke_emulate_mfspr()
471 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_FP_UNAVAIL]; in kvmppc_booke_emulate_mfspr()
474 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_SYSCALL]; in kvmppc_booke_emulate_mfspr()
477 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_AP_UNAVAIL]; in kvmppc_booke_emulate_mfspr()
480 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_DECREMENTER]; in kvmppc_booke_emulate_mfspr()
483 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_FIT]; in kvmppc_booke_emulate_mfspr()
486 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_WATCHDOG]; in kvmppc_booke_emulate_mfspr()
489 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_DTLB_MISS]; in kvmppc_booke_emulate_mfspr()
492 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_ITLB_MISS]; in kvmppc_booke_emulate_mfspr()
495 *spr_val = vcpu->arch.ivor[BOOKE_IRQPRIO_DEBUG]; in kvmppc_booke_emulate_mfspr()
498 *spr_val = vcpu->arch.mcsr; in kvmppc_booke_emulate_mfspr()
502 *spr_val = vcpu->arch.epcr; in kvmppc_booke_emulate_mfspr()