Lines Matching refs:arch
32 struct kvmppc_vcore *vc = vcpu->arch.vcore; in kvmhv_save_hv_regs()
36 hr->hfscr = vcpu->arch.hfscr; in kvmhv_save_hv_regs()
38 hr->dawr0 = vcpu->arch.dawr0; in kvmhv_save_hv_regs()
39 hr->dawrx0 = vcpu->arch.dawrx0; in kvmhv_save_hv_regs()
40 hr->ciabr = vcpu->arch.ciabr; in kvmhv_save_hv_regs()
41 hr->purr = vcpu->arch.purr; in kvmhv_save_hv_regs()
42 hr->spurr = vcpu->arch.spurr; in kvmhv_save_hv_regs()
43 hr->ic = vcpu->arch.ic; in kvmhv_save_hv_regs()
45 hr->srr0 = vcpu->arch.shregs.srr0; in kvmhv_save_hv_regs()
46 hr->srr1 = vcpu->arch.shregs.srr1; in kvmhv_save_hv_regs()
47 hr->sprg[0] = vcpu->arch.shregs.sprg0; in kvmhv_save_hv_regs()
48 hr->sprg[1] = vcpu->arch.shregs.sprg1; in kvmhv_save_hv_regs()
49 hr->sprg[2] = vcpu->arch.shregs.sprg2; in kvmhv_save_hv_regs()
50 hr->sprg[3] = vcpu->arch.shregs.sprg3; in kvmhv_save_hv_regs()
51 hr->pidr = vcpu->arch.pid; in kvmhv_save_hv_regs()
52 hr->cfar = vcpu->arch.cfar; in kvmhv_save_hv_regs()
53 hr->ppr = vcpu->arch.ppr; in kvmhv_save_hv_regs()
54 hr->dawr1 = vcpu->arch.dawr1; in kvmhv_save_hv_regs()
55 hr->dawrx1 = vcpu->arch.dawrx1; in kvmhv_save_hv_regs()
106 struct kvmppc_vcore *vc = vcpu->arch.vcore; in save_hv_return_state()
109 hr->purr = vcpu->arch.purr; in save_hv_return_state()
110 hr->spurr = vcpu->arch.spurr; in save_hv_return_state()
111 hr->ic = vcpu->arch.ic; in save_hv_return_state()
113 hr->srr0 = vcpu->arch.shregs.srr0; in save_hv_return_state()
114 hr->srr1 = vcpu->arch.shregs.srr1; in save_hv_return_state()
115 hr->sprg[0] = vcpu->arch.shregs.sprg0; in save_hv_return_state()
116 hr->sprg[1] = vcpu->arch.shregs.sprg1; in save_hv_return_state()
117 hr->sprg[2] = vcpu->arch.shregs.sprg2; in save_hv_return_state()
118 hr->sprg[3] = vcpu->arch.shregs.sprg3; in save_hv_return_state()
119 hr->pidr = vcpu->arch.pid; in save_hv_return_state()
120 hr->cfar = vcpu->arch.cfar; in save_hv_return_state()
121 hr->ppr = vcpu->arch.ppr; in save_hv_return_state()
122 switch (vcpu->arch.trap) { in save_hv_return_state()
124 hr->hdar = vcpu->arch.fault_dar; in save_hv_return_state()
125 hr->hdsisr = vcpu->arch.fault_dsisr; in save_hv_return_state()
126 hr->asdr = vcpu->arch.fault_gpa; in save_hv_return_state()
129 hr->asdr = vcpu->arch.fault_gpa; in save_hv_return_state()
133 (HFSCR_INTR_CAUSE & vcpu->arch.hfscr)); in save_hv_return_state()
136 hr->heir = vcpu->arch.emul_inst; in save_hv_return_state()
143 struct kvmppc_vcore *vc = vcpu->arch.vcore; in restore_hv_regs()
147 vcpu->arch.hfscr = hr->hfscr; in restore_hv_regs()
148 vcpu->arch.dawr0 = hr->dawr0; in restore_hv_regs()
149 vcpu->arch.dawrx0 = hr->dawrx0; in restore_hv_regs()
150 vcpu->arch.ciabr = hr->ciabr; in restore_hv_regs()
151 vcpu->arch.purr = hr->purr; in restore_hv_regs()
152 vcpu->arch.spurr = hr->spurr; in restore_hv_regs()
153 vcpu->arch.ic = hr->ic; in restore_hv_regs()
155 vcpu->arch.shregs.srr0 = hr->srr0; in restore_hv_regs()
156 vcpu->arch.shregs.srr1 = hr->srr1; in restore_hv_regs()
157 vcpu->arch.shregs.sprg0 = hr->sprg[0]; in restore_hv_regs()
158 vcpu->arch.shregs.sprg1 = hr->sprg[1]; in restore_hv_regs()
159 vcpu->arch.shregs.sprg2 = hr->sprg[2]; in restore_hv_regs()
160 vcpu->arch.shregs.sprg3 = hr->sprg[3]; in restore_hv_regs()
161 vcpu->arch.pid = hr->pidr; in restore_hv_regs()
162 vcpu->arch.cfar = hr->cfar; in restore_hv_regs()
163 vcpu->arch.ppr = hr->ppr; in restore_hv_regs()
164 vcpu->arch.dawr1 = hr->dawr1; in restore_hv_regs()
165 vcpu->arch.dawrx1 = hr->dawrx1; in restore_hv_regs()
171 struct kvmppc_vcore *vc = vcpu->arch.vcore; in kvmhv_restore_hv_return_state()
174 vcpu->arch.hfscr = hr->hfscr; in kvmhv_restore_hv_return_state()
175 vcpu->arch.purr = hr->purr; in kvmhv_restore_hv_return_state()
176 vcpu->arch.spurr = hr->spurr; in kvmhv_restore_hv_return_state()
177 vcpu->arch.ic = hr->ic; in kvmhv_restore_hv_return_state()
179 vcpu->arch.fault_dar = hr->hdar; in kvmhv_restore_hv_return_state()
180 vcpu->arch.fault_dsisr = hr->hdsisr; in kvmhv_restore_hv_return_state()
181 vcpu->arch.fault_gpa = hr->asdr; in kvmhv_restore_hv_return_state()
182 vcpu->arch.emul_inst = hr->heir; in kvmhv_restore_hv_return_state()
183 vcpu->arch.shregs.srr0 = hr->srr0; in kvmhv_restore_hv_return_state()
184 vcpu->arch.shregs.srr1 = hr->srr1; in kvmhv_restore_hv_return_state()
185 vcpu->arch.shregs.sprg0 = hr->sprg[0]; in kvmhv_restore_hv_return_state()
186 vcpu->arch.shregs.sprg1 = hr->sprg[1]; in kvmhv_restore_hv_return_state()
187 vcpu->arch.shregs.sprg2 = hr->sprg[2]; in kvmhv_restore_hv_return_state()
188 vcpu->arch.shregs.sprg3 = hr->sprg[3]; in kvmhv_restore_hv_return_state()
189 vcpu->arch.pid = hr->pidr; in kvmhv_restore_hv_return_state()
190 vcpu->arch.cfar = hr->cfar; in kvmhv_restore_hv_return_state()
191 vcpu->arch.ppr = hr->ppr; in kvmhv_restore_hv_return_state()
197 vcpu->arch.trap = 0; in kvmhv_nested_mmio_needed()
205 if (((vcpu->arch.io_gpr & KVM_MMIO_REG_EXT_MASK) == KVM_MMIO_REG_GPR) in kvmhv_nested_mmio_needed()
207 vcpu->arch.nested_io_gpr = (gpa_t) regs_ptr + in kvmhv_nested_mmio_needed()
209 gpr[vcpu->arch.io_gpr]); in kvmhv_nested_mmio_needed()
210 vcpu->arch.io_gpr = KVM_MMIO_REG_NESTED_GPR; in kvmhv_nested_mmio_needed()
257 struct kvmppc_vcore *vc = vcpu->arch.vcore; 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()
286 vcpu->arch.ciabr = l2_hv->ciabr & ~CIABR_PRIV; in load_l2_hv_regs()
295 struct kvmppc_vcore *vc = vcpu->arch.vcore; in kvmhv_enter_nested_guest()
300 if (vcpu->kvm->arch.l1_ptcr == 0) in kvmhv_enter_nested_guest()
303 if (MSR_TM_TRANSACTIONAL(vcpu->arch.shregs.msr)) in kvmhv_enter_nested_guest()
333 if (MSR_TM_SUSPENDED(vcpu->arch.shregs.msr)) { in kvmhv_enter_nested_guest()
339 if (WARN_ON_ONCE(vcpu->arch.shregs.msr & MSR_TS_MASK)) in kvmhv_enter_nested_guest()
354 vcpu->arch.regs.msr = vcpu->arch.shregs.msr; in kvmhv_enter_nested_guest()
355 saved_l1_regs = vcpu->arch.regs; in kvmhv_enter_nested_guest()
361 vcpu->arch.dec_expires += l2_hv.tb_offset; in kvmhv_enter_nested_guest()
364 vcpu->arch.nested = l2; 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()
367 vcpu->arch.regs = l2_regs; in kvmhv_enter_nested_guest()
370 vcpu->arch.shregs.msr = (vcpu->arch.regs.msr | MSR_ME) & ~MSR_HV; in kvmhv_enter_nested_guest()
375 vcpu->arch.ret = RESUME_GUEST; in kvmhv_enter_nested_guest()
376 vcpu->arch.trap = 0; in kvmhv_enter_nested_guest()
382 l2_regs = vcpu->arch.regs; in kvmhv_enter_nested_guest()
383 l2_regs.msr = vcpu->arch.shregs.msr; 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()
391 vcpu->arch.nested = NULL; in kvmhv_enter_nested_guest()
392 vcpu->arch.regs = saved_l1_regs; in kvmhv_enter_nested_guest()
393 vcpu->arch.shregs.msr = saved_l1_regs.msr & ~MSR_TS_MASK; in kvmhv_enter_nested_guest()
396 vcpu->arch.shregs.msr |= MSR_TS_S; in kvmhv_enter_nested_guest()
399 vcpu->arch.dec_expires -= l2_hv.tb_offset; in kvmhv_enter_nested_guest()
401 vcpu->arch.purr += delta_purr; in kvmhv_enter_nested_guest()
402 vcpu->arch.spurr += delta_spurr; in kvmhv_enter_nested_guest()
403 vcpu->arch.ic += delta_ic; in kvmhv_enter_nested_guest()
428 return vcpu->arch.trap; in kvmhv_enter_nested_guest()
544 kvm->arch.l1_ptcr = ptcr; in kvmhv_set_partition_table()
640 ptbl_addr = (kvm->arch.l1_ptcr & PRTB_MASK) + (gp->l1_lpid << 4); in kvmhv_update_ptbl_cache()
641 if (gp->l1_lpid < (1ul << ((kvm->arch.l1_ptcr & PRTS_MASK) + 12 - 4))) { in kvmhv_update_ptbl_cache()
659 idr_init(&kvm->arch.kvm_nested_guest_idr); in kvmhv_vm_nested_init()
664 return idr_find(&kvm->arch.kvm_nested_guest_idr, lpid); in __find_nested()
669 if (idr_alloc(&kvm->arch.kvm_nested_guest_idr, in __prealloc_nested()
677 if (idr_replace(&kvm->arch.kvm_nested_guest_idr, gp, lpid)) in __add_nested()
683 idr_remove(&kvm->arch.kvm_nested_guest_idr, lpid); in __remove_nested()
771 idr_for_each_entry(&kvm->arch.kvm_nested_guest_idr, gp, lpid) { in kvmhv_release_all_nested()
778 idr_destroy(&kvm->arch.kvm_nested_guest_idr); in kvmhv_release_all_nested()
811 if (l1_lpid >= (1ul << ((kvm->arch.l1_ptcr & PRTS_MASK) + 12 - 4))) in kvmhv_get_nested()
1015 unsigned long *rmap = &memslot->arch.rmap[gfn]; in kvmhv_remove_nest_rmap_range()
1025 unsigned long rmap, *rmapp = &free->arch.rmap[page]; in kvmhv_free_memslot_nest_rmap()
1168 idr_for_each_entry(&kvm->arch.kvm_nested_guest_idr, gp, lpid) { in kvmhv_emulate_tlbie_all_lpid()
1380 vcpu->arch.fault_gpa = fault_addr; in kvmhv_translate_addr_nested()
1394 } else if (vcpu->arch.trap == BOOK3S_INTERRUPT_H_INST_STORAGE) { in kvmhv_translate_addr_nested()
1412 vcpu->arch.fault_dsisr = flags; in kvmhv_translate_addr_nested()
1413 if (vcpu->arch.trap == BOOK3S_INTERRUPT_H_INST_STORAGE) { in kvmhv_translate_addr_nested()
1414 vcpu->arch.shregs.msr &= SRR1_MSR_BITS; in kvmhv_translate_addr_nested()
1415 vcpu->arch.shregs.msr |= flags; in kvmhv_translate_addr_nested()
1441 gpte.raddr, kvm->arch.lpid); in kvmhv_handle_nested_set_rc()
1494 unsigned long dsisr = vcpu->arch.fault_dsisr; in __kvmhv_nested_page_fault()
1495 unsigned long ea = vcpu->arch.fault_dar; in __kvmhv_nested_page_fault()
1511 n_gpa = vcpu->arch.fault_gpa & ~0xF000000000000FFFULL; in __kvmhv_nested_page_fault()
1643 rmapp = &memslot->arch.rmap[gfn - memslot->base_gfn]; in __kvmhv_nested_page_fault()
1659 struct kvm_nested_guest *gp = vcpu->arch.nested; in kvmhv_nested_page_fault()
1673 if (!idr_get_next(&kvm->arch.kvm_nested_guest_idr, &ret)) in kvmhv_nested_next_lpid()