Lines Matching refs:hyp_vcpu
26 static void flush_hyp_vcpu(struct pkvm_hyp_vcpu *hyp_vcpu) in flush_hyp_vcpu() argument
28 struct kvm_vcpu *host_vcpu = hyp_vcpu->host_vcpu; in flush_hyp_vcpu()
30 hyp_vcpu->vcpu.arch.ctxt = host_vcpu->arch.ctxt; in flush_hyp_vcpu()
32 hyp_vcpu->vcpu.arch.sve_state = kern_hyp_va(host_vcpu->arch.sve_state); in flush_hyp_vcpu()
33 hyp_vcpu->vcpu.arch.sve_max_vl = host_vcpu->arch.sve_max_vl; in flush_hyp_vcpu()
35 hyp_vcpu->vcpu.arch.hw_mmu = host_vcpu->arch.hw_mmu; in flush_hyp_vcpu()
37 hyp_vcpu->vcpu.arch.hcr_el2 = host_vcpu->arch.hcr_el2; in flush_hyp_vcpu()
38 hyp_vcpu->vcpu.arch.mdcr_el2 = host_vcpu->arch.mdcr_el2; in flush_hyp_vcpu()
39 hyp_vcpu->vcpu.arch.cptr_el2 = host_vcpu->arch.cptr_el2; in flush_hyp_vcpu()
41 hyp_vcpu->vcpu.arch.iflags = host_vcpu->arch.iflags; in flush_hyp_vcpu()
42 hyp_vcpu->vcpu.arch.fp_state = host_vcpu->arch.fp_state; in flush_hyp_vcpu()
44 hyp_vcpu->vcpu.arch.debug_ptr = kern_hyp_va(host_vcpu->arch.debug_ptr); in flush_hyp_vcpu()
45 hyp_vcpu->vcpu.arch.host_fpsimd_state = host_vcpu->arch.host_fpsimd_state; in flush_hyp_vcpu()
47 hyp_vcpu->vcpu.arch.vsesr_el2 = host_vcpu->arch.vsesr_el2; in flush_hyp_vcpu()
49 hyp_vcpu->vcpu.arch.vgic_cpu.vgic_v3 = host_vcpu->arch.vgic_cpu.vgic_v3; in flush_hyp_vcpu()
52 static void sync_hyp_vcpu(struct pkvm_hyp_vcpu *hyp_vcpu) in sync_hyp_vcpu() argument
54 struct kvm_vcpu *host_vcpu = hyp_vcpu->host_vcpu; in sync_hyp_vcpu()
55 struct vgic_v3_cpu_if *hyp_cpu_if = &hyp_vcpu->vcpu.arch.vgic_cpu.vgic_v3; in sync_hyp_vcpu()
59 host_vcpu->arch.ctxt = hyp_vcpu->vcpu.arch.ctxt; in sync_hyp_vcpu()
61 host_vcpu->arch.hcr_el2 = hyp_vcpu->vcpu.arch.hcr_el2; in sync_hyp_vcpu()
62 host_vcpu->arch.cptr_el2 = hyp_vcpu->vcpu.arch.cptr_el2; in sync_hyp_vcpu()
64 host_vcpu->arch.fault = hyp_vcpu->vcpu.arch.fault; in sync_hyp_vcpu()
66 host_vcpu->arch.iflags = hyp_vcpu->vcpu.arch.iflags; in sync_hyp_vcpu()
67 host_vcpu->arch.fp_state = hyp_vcpu->vcpu.arch.fp_state; in sync_hyp_vcpu()
82 struct pkvm_hyp_vcpu *hyp_vcpu; in handle___kvm_vcpu_run() local
86 hyp_vcpu = pkvm_load_hyp_vcpu(host_kvm->arch.pkvm.handle, in handle___kvm_vcpu_run()
88 if (!hyp_vcpu) { in handle___kvm_vcpu_run()
93 flush_hyp_vcpu(hyp_vcpu); in handle___kvm_vcpu_run()
95 ret = __kvm_vcpu_run(&hyp_vcpu->vcpu); in handle___kvm_vcpu_run()
97 sync_hyp_vcpu(hyp_vcpu); in handle___kvm_vcpu_run()
98 pkvm_put_hyp_vcpu(hyp_vcpu); in handle___kvm_vcpu_run()