Lines Matching full:vcpu
137 struct kvm_vcpu *vcpu; in gs_msg_ops_vcpu_fill_info() local
143 vcpu = gsm->data; in gs_msg_ops_vcpu_fill_info()
155 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.dscr); in gs_msg_ops_vcpu_fill_info()
158 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.mmcra); in gs_msg_ops_vcpu_fill_info()
161 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.hfscr); in gs_msg_ops_vcpu_fill_info()
164 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.purr); in gs_msg_ops_vcpu_fill_info()
167 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.spurr); in gs_msg_ops_vcpu_fill_info()
170 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.amr); in gs_msg_ops_vcpu_fill_info()
173 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.uamor); in gs_msg_ops_vcpu_fill_info()
176 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.siar); in gs_msg_ops_vcpu_fill_info()
179 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.sdar); in gs_msg_ops_vcpu_fill_info()
182 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.iamr); in gs_msg_ops_vcpu_fill_info()
185 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.dawr0); in gs_msg_ops_vcpu_fill_info()
188 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.dawr1); in gs_msg_ops_vcpu_fill_info()
191 rc = kvmppc_gse_put_u32(gsb, iden, vcpu->arch.dawrx0); in gs_msg_ops_vcpu_fill_info()
194 rc = kvmppc_gse_put_u32(gsb, iden, vcpu->arch.dawrx1); in gs_msg_ops_vcpu_fill_info()
197 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.dexcr); in gs_msg_ops_vcpu_fill_info()
200 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.hashkeyr); in gs_msg_ops_vcpu_fill_info()
203 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.hashpkeyr); in gs_msg_ops_vcpu_fill_info()
206 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.ciabr); in gs_msg_ops_vcpu_fill_info()
209 rc = kvmppc_gse_put_u32(gsb, iden, vcpu->arch.wort); in gs_msg_ops_vcpu_fill_info()
212 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.ppr); in gs_msg_ops_vcpu_fill_info()
215 rc = kvmppc_gse_put_u32(gsb, iden, vcpu->arch.pspb); in gs_msg_ops_vcpu_fill_info()
218 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.tar); in gs_msg_ops_vcpu_fill_info()
221 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.fscr); in gs_msg_ops_vcpu_fill_info()
224 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.ebbhr); in gs_msg_ops_vcpu_fill_info()
227 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.ebbrr); in gs_msg_ops_vcpu_fill_info()
230 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.bescr); in gs_msg_ops_vcpu_fill_info()
233 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.ic); in gs_msg_ops_vcpu_fill_info()
236 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.ctrl); in gs_msg_ops_vcpu_fill_info()
239 rc = kvmppc_gse_put_u32(gsb, iden, vcpu->arch.pid); in gs_msg_ops_vcpu_fill_info()
248 rc = kvmppc_gse_put_u32(gsb, iden, vcpu->arch.vrsave); in gs_msg_ops_vcpu_fill_info()
252 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.mmcr[i]); in gs_msg_ops_vcpu_fill_info()
256 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.sier[i]); in gs_msg_ops_vcpu_fill_info()
260 rc = kvmppc_gse_put_u32(gsb, iden, vcpu->arch.pmc[i]); in gs_msg_ops_vcpu_fill_info()
265 vcpu->arch.regs.gpr[i]); in gs_msg_ops_vcpu_fill_info()
268 rc = kvmppc_gse_put_u32(gsb, iden, vcpu->arch.regs.ccr); in gs_msg_ops_vcpu_fill_info()
271 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.regs.xer); in gs_msg_ops_vcpu_fill_info()
274 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.regs.ctr); in gs_msg_ops_vcpu_fill_info()
278 vcpu->arch.regs.link); in gs_msg_ops_vcpu_fill_info()
281 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.regs.nip); in gs_msg_ops_vcpu_fill_info()
285 vcpu->arch.shregs.srr0); in gs_msg_ops_vcpu_fill_info()
289 vcpu->arch.shregs.srr1); in gs_msg_ops_vcpu_fill_info()
293 vcpu->arch.shregs.sprg0); in gs_msg_ops_vcpu_fill_info()
297 vcpu->arch.shregs.sprg1); in gs_msg_ops_vcpu_fill_info()
301 vcpu->arch.shregs.sprg2); in gs_msg_ops_vcpu_fill_info()
305 vcpu->arch.shregs.sprg3); in gs_msg_ops_vcpu_fill_info()
309 vcpu->arch.shregs.dar); in gs_msg_ops_vcpu_fill_info()
313 vcpu->arch.shregs.dsisr); in gs_msg_ops_vcpu_fill_info()
317 vcpu->arch.shregs.msr); in gs_msg_ops_vcpu_fill_info()
321 vcpu->arch.vcore->vtb); in gs_msg_ops_vcpu_fill_info()
325 vcpu->arch.vcore->dpdes); in gs_msg_ops_vcpu_fill_info()
329 vcpu->arch.vcore->lpcr); in gs_msg_ops_vcpu_fill_info()
333 vcpu->arch.vcore->tb_offset); in gs_msg_ops_vcpu_fill_info()
336 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.fp.fpscr); in gs_msg_ops_vcpu_fill_info()
340 memcpy(&v, &vcpu->arch.fp.fpr[i], in gs_msg_ops_vcpu_fill_info()
341 sizeof(vcpu->arch.fp.fpr[i])); in gs_msg_ops_vcpu_fill_info()
347 vcpu->arch.vr.vscr.u[3]); in gs_msg_ops_vcpu_fill_info()
352 &vcpu->arch.vr.vr[i]); in gs_msg_ops_vcpu_fill_info()
358 dw = vcpu->arch.dec_expires - in gs_msg_ops_vcpu_fill_info()
359 vcpu->arch.vcore->tb_offset; in gs_msg_ops_vcpu_fill_info()
372 if (!vcpu->arch.vcore->arch_compat) { in gs_msg_ops_vcpu_fill_info()
378 arch_compat = vcpu->arch.vcore->arch_compat; in gs_msg_ops_vcpu_fill_info()
397 struct kvm_vcpu *vcpu; in gs_msg_ops_vcpu_refresh_info() local
403 vcpu = gsm->data; in gs_msg_ops_vcpu_refresh_info()
409 io = &vcpu->arch.nestedv2_io; in gs_msg_ops_vcpu_refresh_info()
416 vcpu->arch.dscr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
419 vcpu->arch.mmcra = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
422 vcpu->arch.hfscr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
425 vcpu->arch.purr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
428 vcpu->arch.spurr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
431 vcpu->arch.amr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
434 vcpu->arch.uamor = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
437 vcpu->arch.siar = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
440 vcpu->arch.sdar = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
443 vcpu->arch.iamr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
446 vcpu->arch.dawr0 = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
449 vcpu->arch.dawr1 = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
452 vcpu->arch.dawrx0 = kvmppc_gse_get_u32(gse); in gs_msg_ops_vcpu_refresh_info()
455 vcpu->arch.dawrx1 = kvmppc_gse_get_u32(gse); in gs_msg_ops_vcpu_refresh_info()
458 vcpu->arch.dexcr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
461 vcpu->arch.hashkeyr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
464 vcpu->arch.hashpkeyr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
467 vcpu->arch.ciabr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
470 vcpu->arch.wort = kvmppc_gse_get_u32(gse); in gs_msg_ops_vcpu_refresh_info()
473 vcpu->arch.ppr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
476 vcpu->arch.pspb = kvmppc_gse_get_u32(gse); in gs_msg_ops_vcpu_refresh_info()
479 vcpu->arch.tar = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
482 vcpu->arch.fscr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
485 vcpu->arch.ebbhr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
488 vcpu->arch.ebbrr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
491 vcpu->arch.bescr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
494 vcpu->arch.ic = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
497 vcpu->arch.ctrl = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
500 vcpu->arch.pid = kvmppc_gse_get_u32(gse); in gs_msg_ops_vcpu_refresh_info()
505 vcpu->arch.vrsave = kvmppc_gse_get_u32(gse); in gs_msg_ops_vcpu_refresh_info()
509 vcpu->arch.mmcr[i] = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
513 vcpu->arch.sier[i] = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
517 vcpu->arch.pmc[i] = kvmppc_gse_get_u32(gse); in gs_msg_ops_vcpu_refresh_info()
521 vcpu->arch.regs.gpr[i] = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
524 vcpu->arch.regs.ccr = kvmppc_gse_get_u32(gse); in gs_msg_ops_vcpu_refresh_info()
527 vcpu->arch.regs.xer = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
530 vcpu->arch.regs.ctr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
533 vcpu->arch.regs.link = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
536 vcpu->arch.regs.nip = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
539 vcpu->arch.shregs.srr0 = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
542 vcpu->arch.shregs.srr1 = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
545 vcpu->arch.shregs.sprg0 = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
548 vcpu->arch.shregs.sprg1 = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
551 vcpu->arch.shregs.sprg2 = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
554 vcpu->arch.shregs.sprg3 = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
557 vcpu->arch.shregs.dar = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
560 vcpu->arch.shregs.dsisr = kvmppc_gse_get_u32(gse); in gs_msg_ops_vcpu_refresh_info()
563 vcpu->arch.shregs.msr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
566 vcpu->arch.vcore->vtb = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
569 vcpu->arch.vcore->dpdes = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
572 vcpu->arch.vcore->lpcr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
575 vcpu->arch.vcore->tb_offset = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
578 vcpu->arch.fp.fpscr = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
583 memcpy(&vcpu->arch.fp.fpr[i], &v, in gs_msg_ops_vcpu_refresh_info()
584 sizeof(vcpu->arch.fp.fpr[i])); in gs_msg_ops_vcpu_refresh_info()
588 vcpu->arch.vr.vscr.u[3] = kvmppc_gse_get_u32(gse); in gs_msg_ops_vcpu_refresh_info()
592 kvmppc_gse_get_vector128(gse, &vcpu->arch.vr.vr[i]); in gs_msg_ops_vcpu_refresh_info()
596 vcpu->arch.fault_dar = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
599 vcpu->arch.fault_dsisr = kvmppc_gse_get_u32(gse); in gs_msg_ops_vcpu_refresh_info()
602 vcpu->arch.fault_gpa = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
605 vcpu->arch.emul_inst = kvmppc_gse_get_u64(gse); in gs_msg_ops_vcpu_refresh_info()
611 vcpu->arch.dec_expires = in gs_msg_ops_vcpu_refresh_info()
612 dw + vcpu->arch.vcore->tb_offset; in gs_msg_ops_vcpu_refresh_info()
616 vcpu->arch.vcore->arch_compat = kvmppc_gse_get_u32(gse); in gs_msg_ops_vcpu_refresh_info()
633 static int kvmhv_nestedv2_host_create(struct kvm_vcpu *vcpu, in kvmhv_nestedv2_host_create() argument
643 guest_id = vcpu->kvm->arch.lpid; in kvmhv_nestedv2_host_create()
644 vcpu_id = vcpu->vcpu_id; in kvmhv_nestedv2_host_create()
663 pr_err("KVM-NESTEDv2: couldn't get vcpu run output buffer minimum size\n"); in kvmhv_nestedv2_host_create()
681 pr_err("KVM-NESTEDv2: couldn't set vcpu run output buffer\n"); in kvmhv_nestedv2_host_create()
685 vcpu_message = kvmppc_gsm_new(&vcpu_message_ops, vcpu, 0, GFP_KERNEL); in kvmhv_nestedv2_host_create()
706 pr_err("KVM-NESTEDv2: couldn't set vcpu run input buffer\n"); in kvmhv_nestedv2_host_create()
710 vcore_message = kvmppc_gsm_new(&vcpu_message_ops, vcpu, in kvmhv_nestedv2_host_create()
742 * @vcpu: vcpu
748 int __kvmhv_nestedv2_mark_dirty(struct kvm_vcpu *vcpu, u16 iden) in __kvmhv_nestedv2_mark_dirty() argument
757 io = &vcpu->arch.nestedv2_io; in __kvmhv_nestedv2_mark_dirty()
770 * @vcpu: vcpu
776 int __kvmhv_nestedv2_cached_reload(struct kvm_vcpu *vcpu, u16 iden) in __kvmhv_nestedv2_cached_reload() argument
787 io = &vcpu->arch.nestedv2_io; in __kvmhv_nestedv2_cached_reload()
793 kvmppc_gsm_init(&gsm, &vcpu_message_ops, vcpu, kvmppc_gsid_flags(iden)); in __kvmhv_nestedv2_cached_reload()
805 * @vcpu: vcpu
814 int kvmhv_nestedv2_flush_vcpu(struct kvm_vcpu *vcpu, u64 time_limit) in kvmhv_nestedv2_flush_vcpu() argument
821 io = &vcpu->arch.nestedv2_io; in kvmhv_nestedv2_flush_vcpu()
834 pr_err("KVM-NESTEDv2: couldn't fill vcpu run input buffer\n"); in kvmhv_nestedv2_flush_vcpu()
901 * @vcpu: vcpu
904 int kvmhv_nestedv2_set_vpa(struct kvm_vcpu *vcpu, unsigned long vpa) in kvmhv_nestedv2_set_vpa() argument
910 io = &vcpu->arch.nestedv2_io; in kvmhv_nestedv2_set_vpa()
930 * @vcpu: vcpu
932 * Parse the output buffer from H_GUEST_RUN_VCPU to update vcpu.
934 int kvmhv_nestedv2_parse_output(struct kvm_vcpu *vcpu) in kvmhv_nestedv2_parse_output() argument
940 io = &vcpu->arch.nestedv2_io; in kvmhv_nestedv2_parse_output()
943 vcpu->arch.fault_dar = 0; in kvmhv_nestedv2_parse_output()
944 vcpu->arch.fault_dsisr = 0; in kvmhv_nestedv2_parse_output()
945 vcpu->arch.fault_gpa = 0; in kvmhv_nestedv2_parse_output()
946 vcpu->arch.emul_inst = KVM_INST_FETCH_FAILED; in kvmhv_nestedv2_parse_output()
948 kvmppc_gsm_init(&gsm, &vcpu_message_ops, vcpu, 0); in kvmhv_nestedv2_parse_output()
953 static void kvmhv_nestedv2_host_free(struct kvm_vcpu *vcpu, in kvmhv_nestedv2_host_free() argument
962 int __kvmhv_nestedv2_reload_ptregs(struct kvm_vcpu *vcpu, struct pt_regs *regs) in __kvmhv_nestedv2_reload_ptregs() argument
971 io = &vcpu->arch.nestedv2_io; in __kvmhv_nestedv2_reload_ptregs()
975 kvmppc_gsm_init(&gsm, &vcpu_message_ops, vcpu, 0); in __kvmhv_nestedv2_reload_ptregs()
1005 int __kvmhv_nestedv2_mark_dirty_ptregs(struct kvm_vcpu *vcpu, in __kvmhv_nestedv2_mark_dirty_ptregs() argument
1009 kvmhv_nestedv2_mark_dirty(vcpu, KVMPPC_GSID_GPR(i)); in __kvmhv_nestedv2_mark_dirty_ptregs()
1011 kvmhv_nestedv2_mark_dirty(vcpu, KVMPPC_GSID_CR); in __kvmhv_nestedv2_mark_dirty_ptregs()
1012 kvmhv_nestedv2_mark_dirty(vcpu, KVMPPC_GSID_XER); in __kvmhv_nestedv2_mark_dirty_ptregs()
1013 kvmhv_nestedv2_mark_dirty(vcpu, KVMPPC_GSID_CTR); in __kvmhv_nestedv2_mark_dirty_ptregs()
1014 kvmhv_nestedv2_mark_dirty(vcpu, KVMPPC_GSID_LR); in __kvmhv_nestedv2_mark_dirty_ptregs()
1015 kvmhv_nestedv2_mark_dirty(vcpu, KVMPPC_GSID_NIA); in __kvmhv_nestedv2_mark_dirty_ptregs()
1022 * kvmhv_nestedv2_vcpu_create() - create nested vcpu for the NESTEDv2 API
1023 * @vcpu: vcpu
1026 * Parse the output buffer from H_GUEST_RUN_VCPU to update vcpu.
1028 int kvmhv_nestedv2_vcpu_create(struct kvm_vcpu *vcpu, in kvmhv_nestedv2_vcpu_create() argument
1033 rc = plpar_guest_create_vcpu(0, vcpu->kvm->arch.lpid, vcpu->vcpu_id); in kvmhv_nestedv2_vcpu_create()
1036 pr_err("KVM: Create Guest vcpu hcall failed, rc=%ld\n", rc); in kvmhv_nestedv2_vcpu_create()
1048 rc = kvmhv_nestedv2_host_create(vcpu, io); in kvmhv_nestedv2_vcpu_create()
1056 * @vcpu: vcpu
1059 void kvmhv_nestedv2_vcpu_free(struct kvm_vcpu *vcpu, in kvmhv_nestedv2_vcpu_free() argument
1062 kvmhv_nestedv2_host_free(vcpu, io); in kvmhv_nestedv2_vcpu_free()