Lines Matching full:vpa

521 static void init_vpa(struct kvm_vcpu *vcpu, struct lppaca *vpa)  in init_vpa()  argument
523 vpa->__old_status |= LPPACA_OLD_SHARED_PROC; in init_vpa()
524 vpa->yield_count = cpu_to_be32(1); in init_vpa()
561 unsigned long vcpuid, unsigned long vpa) in do_h_register_vpa() argument
579 if ((vpa & (L1_CACHE_BYTES - 1)) || !vpa) in do_h_register_vpa()
583 va = kvmppc_pin_guest_page(kvm, vpa, &nb); in do_h_register_vpa()
590 kvmppc_unpin_guest_page(kvm, va, vpa, false); in do_h_register_vpa()
596 vpa = 0; in do_h_register_vpa()
605 case H_VPA_REG_VPA: /* register VPA */ in do_h_register_vpa()
615 vpap = &tvcpu->arch.vpa; in do_h_register_vpa()
624 /* Check that they have previously registered a VPA */ in do_h_register_vpa()
626 if (!vpa_is_registered(&tvcpu->arch.vpa)) in do_h_register_vpa()
634 /* Check that they have previously registered a VPA */ in do_h_register_vpa()
636 if (!vpa_is_registered(&tvcpu->arch.vpa)) in do_h_register_vpa()
643 case H_VPA_DEREG_VPA: /* deregister VPA */ in do_h_register_vpa()
650 vpap = &tvcpu->arch.vpa; in do_h_register_vpa()
666 vpap->next_gpa = vpa; in do_h_register_vpa()
731 if (!(vcpu->arch.vpa.update_pending || in kvmppc_update_vpas()
737 if (vcpu->arch.vpa.update_pending) { in kvmppc_update_vpas()
738 kvmppc_update_vpa(vcpu, &vcpu->arch.vpa, &old_vpa); in kvmppc_update_vpas()
745 if (vcpu->arch.vpa.pinned_addr) { in kvmppc_update_vpas()
746 init_vpa(vcpu, vcpu->arch.vpa.pinned_addr); in kvmppc_update_vpas()
748 kvmhv_nestedv2_set_vpa(vcpu, __pa(vcpu->arch.vpa.pinned_addr)); in kvmppc_update_vpas()
790 struct lppaca *vpa, in __kvmppc_create_dtl_entry() argument
816 /* order writing *dt vs. writing vpa->dtl_idx */ in __kvmppc_create_dtl_entry()
818 vpa->dtl_idx = cpu_to_be64(++vcpu->arch.dtl_index); in __kvmppc_create_dtl_entry()
826 struct lppaca *vpa; in kvmppc_update_vpa_dispatch() local
832 vpa = vcpu->arch.vpa.pinned_addr; in kvmppc_update_vpa_dispatch()
833 if (!vpa) in kvmppc_update_vpa_dispatch()
846 vpa->enqueue_dispatch_tb = cpu_to_be64(be64_to_cpu(vpa->enqueue_dispatch_tb) + stolen); in kvmppc_update_vpa_dispatch()
848 __kvmppc_create_dtl_entry(vcpu, vpa, vc->pcpu, now + kvmppc_get_tb_offset(vcpu), stolen); in kvmppc_update_vpa_dispatch()
850 vcpu->arch.vpa.dirty = true; in kvmppc_update_vpa_dispatch()
857 struct lppaca *vpa; in kvmppc_update_vpa_dispatch_p9() local
861 vpa = vcpu->arch.vpa.pinned_addr; in kvmppc_update_vpa_dispatch_p9()
862 if (!vpa) in kvmppc_update_vpa_dispatch_p9()
869 vpa->enqueue_dispatch_tb = cpu_to_be64(stolen); in kvmppc_update_vpa_dispatch_p9()
871 __kvmppc_create_dtl_entry(vcpu, vpa, vc->pcpu, now, stolen_delta); in kvmppc_update_vpa_dispatch_p9()
873 vcpu->arch.vpa.dirty = true; in kvmppc_update_vpa_dispatch_p9()
1073 lppaca = (struct lppaca *)vcpu->arch.vpa.pinned_addr; in kvmppc_get_yield_count()
2398 *val = get_reg_val(id, vcpu->arch.vpa.next_gpa); in kvmppc_get_one_reg_hv()
2657 r = set_vpa(vcpu, &vcpu->arch.vpa, addr, sizeof(struct lppaca)); in kvmppc_set_one_reg_hv()
2663 if (addr && !vcpu->arch.vpa.next_gpa) in kvmppc_set_one_reg_hv()
2672 !vcpu->arch.vpa.next_gpa)) in kvmppc_set_one_reg_hv()
3157 static void unpin_vpa(struct kvm *kvm, struct kvmppc_vpa *vpa) in unpin_vpa() argument
3159 if (vpa->pinned_addr) in unpin_vpa()
3160 kvmppc_unpin_guest_page(kvm, vpa->pinned_addr, vpa->gpa, in unpin_vpa()
3161 vpa->dirty); in unpin_vpa()
3169 unpin_vpa(vcpu->kvm, &vcpu->arch.vpa); in kvmppc_core_vcpu_free_hv()
3613 else if (vcpu->arch.vpa.update_pending || in prepare_threads()
3824 * or need a VPA update done in kvmppc_run_core()
4127 struct lppaca *lp = vcpu->arch.vpa.pinned_addr; in vcpu_vpa_increment_dispatch()
4131 vcpu->arch.vpa.dirty = 1; in vcpu_vpa_increment_dispatch()
4135 /* Helper functions for reading L2's stats from L1's VPA */
5258 /* Harvest dirty bits from VPA and DTL updates */ in kvm_vm_ioctl_get_dirty_log_hv()
5262 kvmppc_harvest_vpa_dirty(&vcpu->arch.vpa, memslot, buf); in kvm_vm_ioctl_get_dirty_log_hv()
6325 static void unpin_vpa_reset(struct kvm *kvm, struct kvmppc_vpa *vpa) in unpin_vpa_reset() argument
6327 unpin_vpa(kvm, vpa); in unpin_vpa_reset()
6328 vpa->gpa = 0; in unpin_vpa_reset()
6329 vpa->pinned_addr = NULL; in unpin_vpa_reset()
6330 vpa->dirty = false; in unpin_vpa_reset()
6331 vpa->update_pending = 0; in unpin_vpa_reset()
6354 * - Unpin the VPA pages.
6406 * chance to run and unpin their VPA pages. Unpinning of all in kvmhv_svm_off()
6407 * VPA pages is done here explicitly so that VPA pages in kvmhv_svm_off()
6417 unpin_vpa_reset(kvm, &vcpu->arch.vpa); in kvmhv_svm_off()