Lines Matching refs:scb_s

27 	struct kvm_s390_sie_block scb_s;	/* 0x0000 */  member
67 atomic_or(PROG_REQUEST, &vsie_page->scb_s.prog20); in prefix_unmapped()
74 if (vsie_page->scb_s.prog0c & PROG_IN_SIE) in prefix_unmapped_sync()
75 atomic_or(CPUSTAT_STOP_INT, &vsie_page->scb_s.cpuflags); in prefix_unmapped_sync()
76 while (vsie_page->scb_s.prog0c & PROG_IN_SIE) in prefix_unmapped_sync()
83 atomic_andnot(PROG_REQUEST, &vsie_page->scb_s.prog20); in prefix_mapped()
89 return !(atomic_read(&vsie_page->scb_s.prog20) & PROG_REQUEST); in prefix_is_mapped()
99 atomic_andnot(bits, &vsie_page->scb_s.cpuflags); in update_intervention_requests()
100 atomic_or(cpuflags & bits, &vsie_page->scb_s.cpuflags); in update_intervention_requests()
106 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in prepare_cpuflags() local
112 return set_validity_icpt(scb_s, 0x0001U); in prepare_cpuflags()
115 return set_validity_icpt(scb_s, 0x0001U); in prepare_cpuflags()
117 return set_validity_icpt(scb_s, 0x0007U); in prepare_cpuflags()
125 return set_validity_icpt(scb_s, 0x0001U); in prepare_cpuflags()
137 atomic_set(&scb_s->cpuflags, newflags); in prepare_cpuflags()
297 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in shadow_crycb() local
311 scb_s->crycbd = 0; in shadow_crycb()
319 return set_validity_icpt(scb_s, 0x0039U); in shadow_crycb()
324 return set_validity_icpt(scb_s, 0x003CU); in shadow_crycb()
332 scb_s->eca |= scb_o->eca & ECA_APIE; in shadow_crycb()
345 return set_validity_icpt(scb_s, 0x0035U); in shadow_crycb()
347 scb_s->ecb3 |= ecb3_flags; in shadow_crycb()
348 scb_s->ecd |= ecd_flags; in shadow_crycb()
359 return set_validity_icpt(scb_s, 0x0022U); in shadow_crycb()
361 return set_validity_icpt(scb_s, 0x0035U); in shadow_crycb()
363 return set_validity_icpt(scb_s, 0x003CU); in shadow_crycb()
365 scb_s->crycbd = (u32)virt_to_phys(&vsie_page->crycb) | CRYCB_FORMAT2; in shadow_crycb()
372 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in prepare_ibc() local
379 scb_s->ibc = 0; in prepare_ibc()
382 scb_s->ibc = new_ibc; in prepare_ibc()
384 if (scb_s->ibc < min_ibc) in prepare_ibc()
385 scb_s->ibc = min_ibc; in prepare_ibc()
387 if (scb_s->ibc > vcpu->kvm->arch.model.ibc) in prepare_ibc()
388 scb_s->ibc = vcpu->kvm->arch.model.ibc; in prepare_ibc()
395 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in unshadow_scb() local
399 scb_o->icptcode = scb_s->icptcode; in unshadow_scb()
400 scb_o->icptstatus = scb_s->icptstatus; in unshadow_scb()
401 scb_o->ipa = scb_s->ipa; in unshadow_scb()
402 scb_o->ipb = scb_s->ipb; in unshadow_scb()
403 scb_o->gbea = scb_s->gbea; in unshadow_scb()
406 scb_o->cputm = scb_s->cputm; in unshadow_scb()
407 scb_o->ckc = scb_s->ckc; in unshadow_scb()
408 scb_o->todpr = scb_s->todpr; in unshadow_scb()
411 scb_o->gpsw = scb_s->gpsw; in unshadow_scb()
412 scb_o->gg14 = scb_s->gg14; in unshadow_scb()
413 scb_o->gg15 = scb_s->gg15; in unshadow_scb()
414 memcpy(scb_o->gcr, scb_s->gcr, 128); in unshadow_scb()
415 scb_o->pp = scb_s->pp; in unshadow_scb()
420 scb_o->fpf |= scb_s->fpf & FPF_BPBC; in unshadow_scb()
424 switch (scb_s->icptcode) { in unshadow_scb()
429 (void *)((u64)scb_s + 0xc0), 0xf0 - 0xc0); in unshadow_scb()
433 if (scb_s->ihcpu != 0xffffU) in unshadow_scb()
434 scb_o->ihcpu = scb_s->ihcpu; in unshadow_scb()
447 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in shadow_scb() local
452 bool had_tx = scb_s->ecb & ECB_TE; in shadow_scb()
457 scb_s->icptcode = 0; in shadow_scb()
458 scb_s->eca = 0; in shadow_scb()
459 scb_s->ecb = 0; in shadow_scb()
460 scb_s->ecb2 = 0; in shadow_scb()
461 scb_s->ecb3 = 0; in shadow_scb()
462 scb_s->ecd = 0; in shadow_scb()
463 scb_s->fac = 0; in shadow_scb()
464 scb_s->fpf = 0; in shadow_scb()
471 scb_s->cputm = scb_o->cputm; in shadow_scb()
472 scb_s->ckc = scb_o->ckc; in shadow_scb()
473 scb_s->todpr = scb_o->todpr; in shadow_scb()
474 scb_s->epoch = scb_o->epoch; in shadow_scb()
477 scb_s->gpsw = scb_o->gpsw; in shadow_scb()
478 scb_s->gg14 = scb_o->gg14; in shadow_scb()
479 scb_s->gg15 = scb_o->gg15; in shadow_scb()
480 memcpy(scb_s->gcr, scb_o->gcr, 128); in shadow_scb()
481 scb_s->pp = scb_o->pp; in shadow_scb()
484 scb_s->gbea = scb_o->gbea; in shadow_scb()
485 scb_s->lctl = scb_o->lctl; in shadow_scb()
486 scb_s->svcc = scb_o->svcc; in shadow_scb()
487 scb_s->ictl = scb_o->ictl; in shadow_scb()
493 if (!(atomic_read(&scb_s->cpuflags) & CPUSTAT_KSS)) in shadow_scb()
494 scb_s->ictl |= ICTL_ISKE | ICTL_SSKE | ICTL_RRBE; in shadow_scb()
496 scb_s->icpua = scb_o->icpua; in shadow_scb()
498 if (!(atomic_read(&scb_s->cpuflags) & CPUSTAT_SM)) in shadow_scb()
501 if (scb_s->mso != new_mso || scb_s->prefix != new_prefix) in shadow_scb()
504 scb_s->msl = scb_o->msl & 0xfffffffffff00000UL; in shadow_scb()
505 scb_s->mso = new_mso; in shadow_scb()
506 scb_s->prefix = new_prefix; in shadow_scb()
509 if (scb_s->ihcpu != 0xffffU) in shadow_scb()
510 scb_s->ihcpu = scb_o->ihcpu; in shadow_scb()
513 scb_s->eca |= scb_o->eca & (ECA_MVPGI | ECA_PROTEXCI); in shadow_scb()
516 scb_s->ecb |= scb_o->ecb & ECB_HOSTPROTINT; in shadow_scb()
524 scb_s->ecb |= scb_o->ecb & ECB_PTF; in shadow_scb()
530 scb_s->ecb |= ECB_TE; in shadow_scb()
533 scb_s->ecb |= scb_o->ecb & ECB_SPECI; in shadow_scb()
536 scb_s->fpf |= scb_o->fpf & FPF_BPBC; in shadow_scb()
539 scb_s->eca |= scb_o->eca & ECA_VX; in shadow_scb()
540 scb_s->ecd |= scb_o->ecd & ECD_HOSTREGMGMT; in shadow_scb()
544 scb_s->ecb3 |= scb_o->ecb3 & ECB3_RI; in shadow_scb()
547 scb_s->ecb2 |= scb_o->ecb2 & ECB2_IEP; in shadow_scb()
550 scb_s->ecb |= scb_o->ecb & ECB_GS; in shadow_scb()
551 scb_s->ecd |= scb_o->ecd & ECD_HOSTREGMGMT; in shadow_scb()
554 scb_s->eca |= scb_o->eca & ECA_SII; in shadow_scb()
556 scb_s->eca |= scb_o->eca & ECA_IB; in shadow_scb()
558 scb_s->eca |= scb_o->eca & ECA_CEI; in shadow_scb()
561 scb_s->ecd |= scb_o->ecd & ECD_MEF; in shadow_scb()
562 scb_s->epdx = scb_o->epdx; in shadow_scb()
567 scb_s->ecd |= scb_o->ecd & ECD_ETOKENF; in shadow_scb()
569 scb_s->hpid = HPID_VSIE; in shadow_scb()
570 scb_s->cpnc = scb_o->cpnc; in shadow_scb()
602 prefix = cur->scb_s.prefix << GUEST_PREFIX_SHIFT; in kvm_s390_vsie_gmap_notifier()
604 prefix += cur->scb_s.mso; in kvm_s390_vsie_gmap_notifier()
624 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in map_prefix() local
625 u64 prefix = scb_s->prefix << GUEST_PREFIX_SHIFT; in map_prefix()
635 prefix += scb_s->mso; in map_prefix()
638 if (!rc && (scb_s->ecb & ECB_TE)) in map_prefix()
648 rc = set_validity_icpt(scb_s, 0x0037U); in map_prefix()
681 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in unpin_blocks() local
684 hpa = (u64) scb_s->scaoh << 32 | scb_s->scaol; in unpin_blocks()
688 scb_s->scaol = 0; in unpin_blocks()
689 scb_s->scaoh = 0; in unpin_blocks()
692 hpa = scb_s->itdba; in unpin_blocks()
696 scb_s->itdba = 0; in unpin_blocks()
699 hpa = scb_s->gvrd; in unpin_blocks()
703 scb_s->gvrd = 0; in unpin_blocks()
706 hpa = scb_s->riccbd; in unpin_blocks()
710 scb_s->riccbd = 0; in unpin_blocks()
713 hpa = scb_s->sdnxo; in unpin_blocks()
717 scb_s->sdnxo = 0; in unpin_blocks()
738 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in pin_blocks() local
748 rc = set_validity_icpt(scb_s, 0x0038U); in pin_blocks()
750 rc = set_validity_icpt(scb_s, 0x0011U); in pin_blocks()
753 rc = set_validity_icpt(scb_s, 0x003bU); in pin_blocks()
757 rc = set_validity_icpt(scb_s, 0x0034U); in pin_blocks()
762 scb_s->scaoh = (u32)((u64)hpa >> 32); in pin_blocks()
763 scb_s->scaol = (u32)(u64)hpa; in pin_blocks()
767 if (gpa && (scb_s->ecb & ECB_TE)) { in pin_blocks()
769 rc = set_validity_icpt(scb_s, 0x0080U); in pin_blocks()
775 rc = set_validity_icpt(scb_s, 0x0080U); in pin_blocks()
779 scb_s->itdba = hpa; in pin_blocks()
783 if (gpa && (scb_s->eca & ECA_VX) && !(scb_s->ecd & ECD_HOSTREGMGMT)) { in pin_blocks()
785 rc = set_validity_icpt(scb_s, 0x1310U); in pin_blocks()
794 rc = set_validity_icpt(scb_s, 0x1310U); in pin_blocks()
798 scb_s->gvrd = hpa; in pin_blocks()
802 if (gpa && (scb_s->ecb3 & ECB3_RI)) { in pin_blocks()
804 rc = set_validity_icpt(scb_s, 0x0043U); in pin_blocks()
810 rc = set_validity_icpt(scb_s, 0x0043U); in pin_blocks()
815 scb_s->riccbd = hpa; in pin_blocks()
817 if (((scb_s->ecb & ECB_GS) && !(scb_s->ecd & ECD_HOSTREGMGMT)) || in pin_blocks()
818 (scb_s->ecd & ECD_ETOKENF)) { in pin_blocks()
824 rc = set_validity_icpt(scb_s, 0x10b0U); in pin_blocks()
828 rc = set_validity_icpt(scb_s, 0x10b1U); in pin_blocks()
832 rc = set_validity_icpt(scb_s, 0x10b2U); in pin_blocks()
840 rc = set_validity_icpt(scb_s, 0x10b0U); in pin_blocks()
844 scb_s->sdnxo = hpa | sdnxc; in pin_blocks()
959 vsie_page->scb_s.icptcode = 0; in clear_vsie_icpt()
965 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in retry_vsie_icpt() local
966 int ilen = insn_length(scb_s->ipa >> 8); in retry_vsie_icpt()
969 if (scb_s->icptstatus & 1) { in retry_vsie_icpt()
970 ilen = (scb_s->icptstatus >> 4) & 0x6; in retry_vsie_icpt()
974 scb_s->gpsw.addr = __rewind_psw(scb_s->gpsw, ilen); in retry_vsie_icpt()
987 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in handle_stfle() local
1008 return set_validity_icpt(scb_s, 0x1090U); in handle_stfle()
1009 scb_s->fac = (u32)virt_to_phys(&vsie_page->fac); in handle_stfle()
1027 return vsie_page->scb_s.gg15; in vsie_get_register()
1029 return vsie_page->scb_s.gg14; in vsie_get_register()
1037 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in vsie_handle_mvpg() local
1045 mask = _kvm_s390_logical_to_effective(&scb_s->gpsw, PAGE_MASK); in vsie_handle_mvpg()
1046 prefix = scb_s->prefix << GUEST_PREFIX_SHIFT; in vsie_handle_mvpg()
1048 dest = vsie_get_register(vcpu, vsie_page, scb_s->ipb >> 20) & mask; in vsie_handle_mvpg()
1049 dest = _kvm_s390_real_to_abs(prefix, dest) + scb_s->mso; in vsie_handle_mvpg()
1050 src = vsie_get_register(vcpu, vsie_page, scb_s->ipb >> 16) & mask; in vsie_handle_mvpg()
1051 src = _kvm_s390_real_to_abs(prefix, src) + scb_s->mso; in vsie_handle_mvpg()
1118 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in do_vsie_run() local
1153 rc = sie64a(scb_s, vcpu->run->s.regs.gprs, gmap_get_enabled()->asce); in do_vsie_run()
1178 switch (scb_s->icptcode) { in do_vsie_run()
1180 if (scb_s->ipa == 0xb2b0) in do_vsie_run()
1189 if ((scb_s->ipa & 0xf000) != 0xf000) in do_vsie_run()
1190 scb_s->ipa += 0x1000; in do_vsie_run()
1193 if (scb_s->ipa == 0xb254) in do_vsie_run()
1247 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in register_shadow_scb() local
1249 WRITE_ONCE(vcpu->arch.vsie_block, &vsie_page->scb_s); in register_shadow_scb()
1260 scb_s->epoch += vcpu->kvm->arch.epoch; in register_shadow_scb()
1262 if (scb_s->ecd & ECD_MEF) { in register_shadow_scb()
1263 scb_s->epdx += vcpu->kvm->arch.epdx; in register_shadow_scb()
1264 if (scb_s->epoch < vcpu->kvm->arch.epoch) in register_shadow_scb()
1265 scb_s->epdx += 1; in register_shadow_scb()
1290 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in vsie_run() local
1303 atomic_andnot(PROG_BLOCK_SIE, &scb_s->prog20); in vsie_run()
1311 if (rc || scb_s->icptcode) in vsie_run()
1339 scb_s->icptcode = ICPT_PROGI; in vsie_run()
1340 scb_s->iprcc = PGM_ADDRESSING; in vsie_run()
1341 scb_s->pgmilc = 4; in vsie_run()
1342 scb_s->gpsw.addr = __rewind_psw(scb_s->gpsw, 4); in vsie_run()
1408 memset(&vsie_page->scb_s, 0, sizeof(struct kvm_s390_sie_block)); in get_vsie_page()
1411 vsie_page->scb_s.ihcpu = 0xffffU; in get_vsie_page()