Lines Matching refs:arch

31 	struct kvmppc_vcore *vc = vcpu->arch.vcore;  in kvmhv_save_hv_regs()
35 hr->hfscr = vcpu->arch.hfscr; in kvmhv_save_hv_regs()
37 hr->dawr0 = vcpu->arch.dawr0; in kvmhv_save_hv_regs()
38 hr->dawrx0 = vcpu->arch.dawrx0; in kvmhv_save_hv_regs()
39 hr->ciabr = vcpu->arch.ciabr; in kvmhv_save_hv_regs()
40 hr->purr = vcpu->arch.purr; in kvmhv_save_hv_regs()
41 hr->spurr = vcpu->arch.spurr; in kvmhv_save_hv_regs()
42 hr->ic = vcpu->arch.ic; in kvmhv_save_hv_regs()
44 hr->srr0 = vcpu->arch.shregs.srr0; in kvmhv_save_hv_regs()
45 hr->srr1 = vcpu->arch.shregs.srr1; in kvmhv_save_hv_regs()
46 hr->sprg[0] = vcpu->arch.shregs.sprg0; in kvmhv_save_hv_regs()
47 hr->sprg[1] = vcpu->arch.shregs.sprg1; in kvmhv_save_hv_regs()
48 hr->sprg[2] = vcpu->arch.shregs.sprg2; in kvmhv_save_hv_regs()
49 hr->sprg[3] = vcpu->arch.shregs.sprg3; in kvmhv_save_hv_regs()
50 hr->pidr = vcpu->arch.pid; in kvmhv_save_hv_regs()
51 hr->cfar = vcpu->arch.cfar; in kvmhv_save_hv_regs()
52 hr->ppr = vcpu->arch.ppr; in kvmhv_save_hv_regs()
53 hr->dawr1 = vcpu->arch.dawr1; in kvmhv_save_hv_regs()
54 hr->dawrx1 = vcpu->arch.dawrx1; in kvmhv_save_hv_regs()
105 struct kvmppc_vcore *vc = vcpu->arch.vcore; in save_hv_return_state()
108 hr->purr = vcpu->arch.purr; in save_hv_return_state()
109 hr->spurr = vcpu->arch.spurr; in save_hv_return_state()
110 hr->ic = vcpu->arch.ic; in save_hv_return_state()
112 hr->srr0 = vcpu->arch.shregs.srr0; in save_hv_return_state()
113 hr->srr1 = vcpu->arch.shregs.srr1; in save_hv_return_state()
114 hr->sprg[0] = vcpu->arch.shregs.sprg0; in save_hv_return_state()
115 hr->sprg[1] = vcpu->arch.shregs.sprg1; in save_hv_return_state()
116 hr->sprg[2] = vcpu->arch.shregs.sprg2; in save_hv_return_state()
117 hr->sprg[3] = vcpu->arch.shregs.sprg3; in save_hv_return_state()
118 hr->pidr = vcpu->arch.pid; in save_hv_return_state()
119 hr->cfar = vcpu->arch.cfar; in save_hv_return_state()
120 hr->ppr = vcpu->arch.ppr; in save_hv_return_state()
121 switch (vcpu->arch.trap) { in save_hv_return_state()
123 hr->hdar = vcpu->arch.fault_dar; in save_hv_return_state()
124 hr->hdsisr = vcpu->arch.fault_dsisr; in save_hv_return_state()
125 hr->asdr = vcpu->arch.fault_gpa; in save_hv_return_state()
128 hr->asdr = vcpu->arch.fault_gpa; in save_hv_return_state()
132 (HFSCR_INTR_CAUSE & vcpu->arch.hfscr)); in save_hv_return_state()
135 hr->heir = vcpu->arch.emul_inst; in save_hv_return_state()
142 struct kvmppc_vcore *vc = vcpu->arch.vcore; in restore_hv_regs()
146 vcpu->arch.hfscr = hr->hfscr; in restore_hv_regs()
147 vcpu->arch.dawr0 = hr->dawr0; in restore_hv_regs()
148 vcpu->arch.dawrx0 = hr->dawrx0; in restore_hv_regs()
149 vcpu->arch.ciabr = hr->ciabr; in restore_hv_regs()
150 vcpu->arch.purr = hr->purr; in restore_hv_regs()
151 vcpu->arch.spurr = hr->spurr; in restore_hv_regs()
152 vcpu->arch.ic = hr->ic; in restore_hv_regs()
154 vcpu->arch.shregs.srr0 = hr->srr0; in restore_hv_regs()
155 vcpu->arch.shregs.srr1 = hr->srr1; in restore_hv_regs()
156 vcpu->arch.shregs.sprg0 = hr->sprg[0]; in restore_hv_regs()
157 vcpu->arch.shregs.sprg1 = hr->sprg[1]; in restore_hv_regs()
158 vcpu->arch.shregs.sprg2 = hr->sprg[2]; in restore_hv_regs()
159 vcpu->arch.shregs.sprg3 = hr->sprg[3]; in restore_hv_regs()
160 vcpu->arch.pid = hr->pidr; in restore_hv_regs()
161 vcpu->arch.cfar = hr->cfar; in restore_hv_regs()
162 vcpu->arch.ppr = hr->ppr; in restore_hv_regs()
163 vcpu->arch.dawr1 = hr->dawr1; in restore_hv_regs()
164 vcpu->arch.dawrx1 = hr->dawrx1; in restore_hv_regs()
170 struct kvmppc_vcore *vc = vcpu->arch.vcore; in kvmhv_restore_hv_return_state()
173 vcpu->arch.hfscr = hr->hfscr; in kvmhv_restore_hv_return_state()
174 vcpu->arch.purr = hr->purr; in kvmhv_restore_hv_return_state()
175 vcpu->arch.spurr = hr->spurr; in kvmhv_restore_hv_return_state()
176 vcpu->arch.ic = hr->ic; in kvmhv_restore_hv_return_state()
178 vcpu->arch.fault_dar = hr->hdar; in kvmhv_restore_hv_return_state()
179 vcpu->arch.fault_dsisr = hr->hdsisr; in kvmhv_restore_hv_return_state()
180 vcpu->arch.fault_gpa = hr->asdr; in kvmhv_restore_hv_return_state()
181 vcpu->arch.emul_inst = hr->heir; in kvmhv_restore_hv_return_state()
182 vcpu->arch.shregs.srr0 = hr->srr0; in kvmhv_restore_hv_return_state()
183 vcpu->arch.shregs.srr1 = hr->srr1; in kvmhv_restore_hv_return_state()
184 vcpu->arch.shregs.sprg0 = hr->sprg[0]; in kvmhv_restore_hv_return_state()
185 vcpu->arch.shregs.sprg1 = hr->sprg[1]; in kvmhv_restore_hv_return_state()
186 vcpu->arch.shregs.sprg2 = hr->sprg[2]; in kvmhv_restore_hv_return_state()
187 vcpu->arch.shregs.sprg3 = hr->sprg[3]; in kvmhv_restore_hv_return_state()
188 vcpu->arch.pid = hr->pidr; in kvmhv_restore_hv_return_state()
189 vcpu->arch.cfar = hr->cfar; in kvmhv_restore_hv_return_state()
190 vcpu->arch.ppr = hr->ppr; in kvmhv_restore_hv_return_state()
196 vcpu->arch.trap = 0; in kvmhv_nested_mmio_needed()
204 if (((vcpu->arch.io_gpr & KVM_MMIO_REG_EXT_MASK) == KVM_MMIO_REG_GPR) in kvmhv_nested_mmio_needed()
206 vcpu->arch.nested_io_gpr = (gpa_t) regs_ptr + in kvmhv_nested_mmio_needed()
208 gpr[vcpu->arch.io_gpr]); in kvmhv_nested_mmio_needed()
209 vcpu->arch.io_gpr = KVM_MMIO_REG_NESTED_GPR; in kvmhv_nested_mmio_needed()
256 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()
363 vcpu->arch.nested = l2; in kvmhv_enter_nested_guest()
364 vcpu->arch.nested_vcpu_id = l2_hv.vcpu_token; in kvmhv_enter_nested_guest()
366 vcpu->arch.regs = l2_regs; in kvmhv_enter_nested_guest()
369 vcpu->arch.shregs.msr = (vcpu->arch.regs.msr | MSR_ME) & ~MSR_HV; in kvmhv_enter_nested_guest()
374 vcpu->arch.ret = RESUME_GUEST; in kvmhv_enter_nested_guest()
375 vcpu->arch.trap = 0; in kvmhv_enter_nested_guest()
378 vcpu->arch.trap = BOOK3S_INTERRUPT_HV_DECREMENTER; in kvmhv_enter_nested_guest()
386 l2_regs = vcpu->arch.regs; in kvmhv_enter_nested_guest()
387 l2_regs.msr = vcpu->arch.shregs.msr; in kvmhv_enter_nested_guest()
388 delta_purr = vcpu->arch.purr - l2_hv.purr; in kvmhv_enter_nested_guest()
389 delta_spurr = vcpu->arch.spurr - l2_hv.spurr; in kvmhv_enter_nested_guest()
390 delta_ic = vcpu->arch.ic - l2_hv.ic; in kvmhv_enter_nested_guest()
395 vcpu->arch.nested = NULL; in kvmhv_enter_nested_guest()
396 vcpu->arch.regs = saved_l1_regs; in kvmhv_enter_nested_guest()
397 vcpu->arch.shregs.msr = saved_l1_regs.msr & ~MSR_TS_MASK; in kvmhv_enter_nested_guest()
400 vcpu->arch.shregs.msr |= MSR_TS_S; in kvmhv_enter_nested_guest()
403 vcpu->arch.purr += delta_purr; in kvmhv_enter_nested_guest()
404 vcpu->arch.spurr += delta_spurr; in kvmhv_enter_nested_guest()
405 vcpu->arch.ic += delta_ic; in kvmhv_enter_nested_guest()
430 return vcpu->arch.trap; in kvmhv_enter_nested_guest()
528 kvm->arch.max_nested_lpid = -1; in kvmhv_vm_nested_init()
553 kvm->arch.l1_ptcr = ptcr; in kvmhv_set_partition_table()
648 ptbl_addr = (kvm->arch.l1_ptcr & PRTB_MASK) + (gp->l1_lpid << 4); in kvmhv_update_ptbl_cache()
649 if (gp->l1_lpid < (1ul << ((kvm->arch.l1_ptcr & PRTS_MASK) + 8))) { in kvmhv_update_ptbl_cache()
725 if (gp == kvm->arch.nested_guests[lpid]) { in kvmhv_remove_nested()
726 kvm->arch.nested_guests[lpid] = NULL; in kvmhv_remove_nested()
727 if (lpid == kvm->arch.max_nested_lpid) { in kvmhv_remove_nested()
728 while (--lpid >= 0 && !kvm->arch.nested_guests[lpid]) in kvmhv_remove_nested()
730 kvm->arch.max_nested_lpid = lpid; in kvmhv_remove_nested()
755 for (i = 0; i <= kvm->arch.max_nested_lpid; i++) { in kvmhv_release_all_nested()
756 gp = kvm->arch.nested_guests[i]; in kvmhv_release_all_nested()
759 kvm->arch.nested_guests[i] = NULL; in kvmhv_release_all_nested()
765 kvm->arch.max_nested_lpid = -1; in kvmhv_release_all_nested()
798 l1_lpid >= (1ul << ((kvm->arch.l1_ptcr & PRTS_MASK) + 12 - 4))) in kvmhv_get_nested()
802 gp = kvm->arch.nested_guests[l1_lpid]; in kvmhv_get_nested()
814 if (kvm->arch.nested_guests[l1_lpid]) { in kvmhv_get_nested()
816 gp = kvm->arch.nested_guests[l1_lpid]; in kvmhv_get_nested()
818 kvm->arch.nested_guests[l1_lpid] = newgp; in kvmhv_get_nested()
822 if (l1_lpid > kvm->arch.max_nested_lpid) in kvmhv_get_nested()
823 kvm->arch.max_nested_lpid = l1_lpid; in kvmhv_get_nested()
848 if (lpid > kvm->arch.max_nested_lpid) in kvmhv_find_nested()
850 return kvm->arch.nested_guests[lpid]; in kvmhv_find_nested()
1007 unsigned long *rmap = &memslot->arch.rmap[gfn]; in kvmhv_remove_nest_rmap_range()
1017 unsigned long rmap, *rmapp = &free->arch.rmap[page]; in kvmhv_free_memslot_nest_rmap()
1160 for (i = 0; i <= kvm->arch.max_nested_lpid; i++) { in kvmhv_emulate_tlbie_all_lpid()
1161 gp = kvm->arch.nested_guests[i]; in kvmhv_emulate_tlbie_all_lpid()
1375 vcpu->arch.fault_gpa = fault_addr; in kvmhv_translate_addr_nested()
1389 } else if (vcpu->arch.trap == BOOK3S_INTERRUPT_H_INST_STORAGE) { in kvmhv_translate_addr_nested()
1407 vcpu->arch.fault_dsisr = flags; in kvmhv_translate_addr_nested()
1408 if (vcpu->arch.trap == BOOK3S_INTERRUPT_H_INST_STORAGE) { in kvmhv_translate_addr_nested()
1409 vcpu->arch.shregs.msr &= SRR1_MSR_BITS; in kvmhv_translate_addr_nested()
1410 vcpu->arch.shregs.msr |= flags; in kvmhv_translate_addr_nested()
1436 gpte.raddr, kvm->arch.lpid); in kvmhv_handle_nested_set_rc()
1489 unsigned long dsisr = vcpu->arch.fault_dsisr; in __kvmhv_nested_page_fault()
1490 unsigned long ea = vcpu->arch.fault_dar; in __kvmhv_nested_page_fault()
1506 n_gpa = vcpu->arch.fault_gpa & ~0xF000000000000FFFULL; in __kvmhv_nested_page_fault()
1635 rmapp = &memslot->arch.rmap[gfn - memslot->base_gfn]; in __kvmhv_nested_page_fault()
1651 struct kvm_nested_guest *gp = vcpu->arch.nested; in kvmhv_nested_page_fault()
1665 while (++lpid <= kvm->arch.max_nested_lpid) { in kvmhv_nested_next_lpid()
1666 if (kvm->arch.nested_guests[lpid]) { in kvmhv_nested_next_lpid()