Lines Matching refs:l2_hv

215 					   struct hv_guest_state *l2_hv,  in kvmhv_read_guest_state_and_regs()  argument
221 if (kvm_vcpu_read_guest(vcpu, hv_ptr, &l2_hv->version, in kvmhv_read_guest_state_and_regs()
222 sizeof(l2_hv->version))) in kvmhv_read_guest_state_and_regs()
226 l2_hv->version = swab64(l2_hv->version); in kvmhv_read_guest_state_and_regs()
228 size = hv_guest_state_size(l2_hv->version); in kvmhv_read_guest_state_and_regs()
232 return kvm_vcpu_read_guest(vcpu, hv_ptr, l2_hv, size) || in kvmhv_read_guest_state_and_regs()
238 struct hv_guest_state *l2_hv, in kvmhv_write_guest_state_and_regs() argument
244 size = hv_guest_state_size(l2_hv->version); in kvmhv_write_guest_state_and_regs()
248 return kvm_vcpu_write_guest(vcpu, hv_ptr, l2_hv, size) || in kvmhv_write_guest_state_and_regs()
254 const struct hv_guest_state *l2_hv, in load_l2_hv_regs() argument
260 restore_hv_regs(vcpu, l2_hv); in load_l2_hv_regs()
278 vcpu->arch.hfscr = l2_hv->hfscr & (HFSCR_INTR_CAUSE | vcpu->arch.hfscr_permitted); in load_l2_hv_regs()
281 vcpu->arch.dawrx0 = l2_hv->dawrx0 & ~DAWRX_HYP; in load_l2_hv_regs()
282 vcpu->arch.dawrx1 = l2_hv->dawrx1 & ~DAWRX_HYP; in load_l2_hv_regs()
285 if ((l2_hv->ciabr & CIABR_PRIV) == CIABR_PRIV_HYPER) in load_l2_hv_regs()
286 vcpu->arch.ciabr = l2_hv->ciabr & ~CIABR_PRIV; in load_l2_hv_regs()
294 struct hv_guest_state l2_hv = {0}, saved_l1_hv; in kvmhv_enter_nested_guest() local
310 err = kvmhv_read_guest_state_and_regs(vcpu, &l2_hv, &l2_regs, in kvmhv_enter_nested_guest()
317 byteswap_hv_regs(&l2_hv); in kvmhv_enter_nested_guest()
318 if (l2_hv.version > HV_GUEST_STATE_VERSION) in kvmhv_enter_nested_guest()
323 if (l2_hv.vcpu_token >= NR_CPUS) in kvmhv_enter_nested_guest()
344 l2 = kvmhv_get_nested(vcpu->kvm, l2_hv.lpid, true); in kvmhv_enter_nested_guest()
359 hdec_exp = l2_hv.hdec_expiry - vc->tb_offset; in kvmhv_enter_nested_guest()
360 vc->tb_offset += l2_hv.tb_offset; in kvmhv_enter_nested_guest()
361 vcpu->arch.dec_expires += l2_hv.tb_offset; in kvmhv_enter_nested_guest()
365 vcpu->arch.nested_vcpu_id = l2_hv.vcpu_token; in kvmhv_enter_nested_guest()
366 vcpu->arch.nested_hfscr = l2_hv.hfscr; in kvmhv_enter_nested_guest()
372 lpcr = l2_hv.lpcr; in kvmhv_enter_nested_guest()
373 load_l2_hv_regs(vcpu, &l2_hv, &saved_l1_hv, &lpcr); in kvmhv_enter_nested_guest()
384 delta_purr = vcpu->arch.purr - l2_hv.purr; in kvmhv_enter_nested_guest()
385 delta_spurr = vcpu->arch.spurr - l2_hv.spurr; in kvmhv_enter_nested_guest()
386 delta_ic = vcpu->arch.ic - l2_hv.ic; in kvmhv_enter_nested_guest()
387 delta_vtb = vc->vtb - l2_hv.vtb; in kvmhv_enter_nested_guest()
388 save_hv_return_state(vcpu, &l2_hv); in kvmhv_enter_nested_guest()
399 vcpu->arch.dec_expires -= l2_hv.tb_offset; in kvmhv_enter_nested_guest()
410 byteswap_hv_regs(&l2_hv); in kvmhv_enter_nested_guest()
414 err = kvmhv_write_guest_state_and_regs(vcpu, &l2_hv, &l2_regs, in kvmhv_enter_nested_guest()