Lines Matching refs:scb_s

26 	struct kvm_s390_sie_block scb_s;	/* 0x0000 */  member
66 atomic_or(PROG_REQUEST, &vsie_page->scb_s.prog20); in prefix_unmapped()
73 if (vsie_page->scb_s.prog0c & PROG_IN_SIE) in prefix_unmapped_sync()
74 atomic_or(CPUSTAT_STOP_INT, &vsie_page->scb_s.cpuflags); in prefix_unmapped_sync()
75 while (vsie_page->scb_s.prog0c & PROG_IN_SIE) in prefix_unmapped_sync()
82 atomic_andnot(PROG_REQUEST, &vsie_page->scb_s.prog20); in prefix_mapped()
88 return !(atomic_read(&vsie_page->scb_s.prog20) & PROG_REQUEST); in prefix_is_mapped()
98 atomic_andnot(bits, &vsie_page->scb_s.cpuflags); in update_intervention_requests()
99 atomic_or(cpuflags & bits, &vsie_page->scb_s.cpuflags); in update_intervention_requests()
105 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in prepare_cpuflags() local
111 return set_validity_icpt(scb_s, 0x0001U); in prepare_cpuflags()
114 return set_validity_icpt(scb_s, 0x0001U); in prepare_cpuflags()
116 return set_validity_icpt(scb_s, 0x0007U); in prepare_cpuflags()
124 return set_validity_icpt(scb_s, 0x0001U); in prepare_cpuflags()
136 atomic_set(&scb_s->cpuflags, newflags); in prepare_cpuflags()
286 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in shadow_crycb() local
300 scb_s->crycbd = 0; in shadow_crycb()
308 return set_validity_icpt(scb_s, 0x0039U); in shadow_crycb()
313 return set_validity_icpt(scb_s, 0x003CU); in shadow_crycb()
321 scb_s->eca |= scb_o->eca & ECA_APIE; in shadow_crycb()
334 return set_validity_icpt(scb_s, 0x0035U); in shadow_crycb()
336 scb_s->ecb3 |= ecb3_flags; in shadow_crycb()
337 scb_s->ecd |= ecd_flags; in shadow_crycb()
348 return set_validity_icpt(scb_s, 0x0022U); in shadow_crycb()
350 return set_validity_icpt(scb_s, 0x0035U); in shadow_crycb()
352 return set_validity_icpt(scb_s, 0x003CU); in shadow_crycb()
354 scb_s->crycbd = ((__u32)(__u64) &vsie_page->crycb) | CRYCB_FORMAT2; in shadow_crycb()
361 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in prepare_ibc() local
368 scb_s->ibc = 0; in prepare_ibc()
371 scb_s->ibc = new_ibc; in prepare_ibc()
373 if (scb_s->ibc < min_ibc) in prepare_ibc()
374 scb_s->ibc = min_ibc; in prepare_ibc()
376 if (scb_s->ibc > vcpu->kvm->arch.model.ibc) in prepare_ibc()
377 scb_s->ibc = vcpu->kvm->arch.model.ibc; in prepare_ibc()
384 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in unshadow_scb() local
388 scb_o->icptcode = scb_s->icptcode; in unshadow_scb()
389 scb_o->icptstatus = scb_s->icptstatus; in unshadow_scb()
390 scb_o->ipa = scb_s->ipa; in unshadow_scb()
391 scb_o->ipb = scb_s->ipb; in unshadow_scb()
392 scb_o->gbea = scb_s->gbea; in unshadow_scb()
395 scb_o->cputm = scb_s->cputm; in unshadow_scb()
396 scb_o->ckc = scb_s->ckc; in unshadow_scb()
397 scb_o->todpr = scb_s->todpr; in unshadow_scb()
400 scb_o->gpsw = scb_s->gpsw; in unshadow_scb()
401 scb_o->gg14 = scb_s->gg14; in unshadow_scb()
402 scb_o->gg15 = scb_s->gg15; in unshadow_scb()
403 memcpy(scb_o->gcr, scb_s->gcr, 128); in unshadow_scb()
404 scb_o->pp = scb_s->pp; in unshadow_scb()
409 scb_o->fpf |= scb_s->fpf & FPF_BPBC; in unshadow_scb()
413 switch (scb_s->icptcode) { in unshadow_scb()
418 (void *)((u64)scb_s + 0xc0), 0xf0 - 0xc0); in unshadow_scb()
422 if (scb_s->ihcpu != 0xffffU) in unshadow_scb()
423 scb_o->ihcpu = scb_s->ihcpu; in unshadow_scb()
436 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in shadow_scb() local
441 bool had_tx = scb_s->ecb & ECB_TE; in shadow_scb()
446 scb_s->icptcode = 0; in shadow_scb()
447 scb_s->eca = 0; in shadow_scb()
448 scb_s->ecb = 0; in shadow_scb()
449 scb_s->ecb2 = 0; in shadow_scb()
450 scb_s->ecb3 = 0; in shadow_scb()
451 scb_s->ecd = 0; in shadow_scb()
452 scb_s->fac = 0; in shadow_scb()
453 scb_s->fpf = 0; in shadow_scb()
460 scb_s->cputm = scb_o->cputm; in shadow_scb()
461 scb_s->ckc = scb_o->ckc; in shadow_scb()
462 scb_s->todpr = scb_o->todpr; in shadow_scb()
463 scb_s->epoch = scb_o->epoch; in shadow_scb()
466 scb_s->gpsw = scb_o->gpsw; in shadow_scb()
467 scb_s->gg14 = scb_o->gg14; in shadow_scb()
468 scb_s->gg15 = scb_o->gg15; in shadow_scb()
469 memcpy(scb_s->gcr, scb_o->gcr, 128); in shadow_scb()
470 scb_s->pp = scb_o->pp; in shadow_scb()
473 scb_s->gbea = scb_o->gbea; in shadow_scb()
474 scb_s->lctl = scb_o->lctl; in shadow_scb()
475 scb_s->svcc = scb_o->svcc; in shadow_scb()
476 scb_s->ictl = scb_o->ictl; in shadow_scb()
482 if (!(atomic_read(&scb_s->cpuflags) & CPUSTAT_KSS)) in shadow_scb()
483 scb_s->ictl |= ICTL_ISKE | ICTL_SSKE | ICTL_RRBE; in shadow_scb()
485 scb_s->icpua = scb_o->icpua; in shadow_scb()
487 if (!(atomic_read(&scb_s->cpuflags) & CPUSTAT_SM)) in shadow_scb()
490 if (scb_s->mso != new_mso || scb_s->prefix != new_prefix) in shadow_scb()
493 scb_s->msl = scb_o->msl & 0xfffffffffff00000UL; in shadow_scb()
494 scb_s->mso = new_mso; in shadow_scb()
495 scb_s->prefix = new_prefix; in shadow_scb()
498 if (scb_s->ihcpu != 0xffffU) in shadow_scb()
499 scb_s->ihcpu = scb_o->ihcpu; in shadow_scb()
502 scb_s->eca |= scb_o->eca & (ECA_MVPGI | ECA_PROTEXCI); in shadow_scb()
505 scb_s->ecb |= scb_o->ecb & ECB_HOSTPROTINT; in shadow_scb()
513 scb_s->ecb |= scb_o->ecb & ECB_PTF; in shadow_scb()
519 scb_s->ecb |= ECB_TE; in shadow_scb()
522 scb_s->ecb |= scb_o->ecb & ECB_SPECI; in shadow_scb()
525 scb_s->fpf |= scb_o->fpf & FPF_BPBC; in shadow_scb()
528 scb_s->eca |= scb_o->eca & ECA_VX; in shadow_scb()
529 scb_s->ecd |= scb_o->ecd & ECD_HOSTREGMGMT; in shadow_scb()
533 scb_s->ecb3 |= scb_o->ecb3 & ECB3_RI; in shadow_scb()
536 scb_s->ecb2 |= scb_o->ecb2 & ECB2_IEP; in shadow_scb()
539 scb_s->ecb |= scb_o->ecb & ECB_GS; in shadow_scb()
540 scb_s->ecd |= scb_o->ecd & ECD_HOSTREGMGMT; in shadow_scb()
543 scb_s->eca |= scb_o->eca & ECA_SII; in shadow_scb()
545 scb_s->eca |= scb_o->eca & ECA_IB; in shadow_scb()
547 scb_s->eca |= scb_o->eca & ECA_CEI; in shadow_scb()
550 scb_s->ecd |= scb_o->ecd & ECD_MEF; in shadow_scb()
551 scb_s->epdx = scb_o->epdx; in shadow_scb()
556 scb_s->ecd |= scb_o->ecd & ECD_ETOKENF; in shadow_scb()
558 scb_s->hpid = HPID_VSIE; in shadow_scb()
559 scb_s->cpnc = scb_o->cpnc; in shadow_scb()
595 prefix = cur->scb_s.prefix << GUEST_PREFIX_SHIFT; in kvm_s390_vsie_gmap_notifier()
597 prefix += cur->scb_s.mso; in kvm_s390_vsie_gmap_notifier()
617 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in map_prefix() local
618 u64 prefix = scb_s->prefix << GUEST_PREFIX_SHIFT; in map_prefix()
628 prefix += scb_s->mso; in map_prefix()
631 if (!rc && (scb_s->ecb & ECB_TE)) in map_prefix()
641 rc = set_validity_icpt(scb_s, 0x0037U); in map_prefix()
674 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in unpin_blocks() local
677 hpa = (u64) scb_s->scaoh << 32 | scb_s->scaol; in unpin_blocks()
681 scb_s->scaol = 0; in unpin_blocks()
682 scb_s->scaoh = 0; in unpin_blocks()
685 hpa = scb_s->itdba; in unpin_blocks()
689 scb_s->itdba = 0; in unpin_blocks()
692 hpa = scb_s->gvrd; in unpin_blocks()
696 scb_s->gvrd = 0; in unpin_blocks()
699 hpa = scb_s->riccbd; in unpin_blocks()
703 scb_s->riccbd = 0; in unpin_blocks()
706 hpa = scb_s->sdnxo; in unpin_blocks()
710 scb_s->sdnxo = 0; in unpin_blocks()
731 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in pin_blocks() local
741 rc = set_validity_icpt(scb_s, 0x0038U); in pin_blocks()
743 rc = set_validity_icpt(scb_s, 0x0011U); in pin_blocks()
746 rc = set_validity_icpt(scb_s, 0x003bU); in pin_blocks()
750 rc = set_validity_icpt(scb_s, 0x0034U); in pin_blocks()
755 scb_s->scaoh = (u32)((u64)hpa >> 32); in pin_blocks()
756 scb_s->scaol = (u32)(u64)hpa; in pin_blocks()
760 if (gpa && (scb_s->ecb & ECB_TE)) { in pin_blocks()
762 rc = set_validity_icpt(scb_s, 0x0080U); in pin_blocks()
768 rc = set_validity_icpt(scb_s, 0x0080U); in pin_blocks()
772 scb_s->itdba = hpa; in pin_blocks()
776 if (gpa && (scb_s->eca & ECA_VX) && !(scb_s->ecd & ECD_HOSTREGMGMT)) { in pin_blocks()
778 rc = set_validity_icpt(scb_s, 0x1310U); in pin_blocks()
787 rc = set_validity_icpt(scb_s, 0x1310U); in pin_blocks()
791 scb_s->gvrd = hpa; in pin_blocks()
795 if (gpa && (scb_s->ecb3 & ECB3_RI)) { in pin_blocks()
797 rc = set_validity_icpt(scb_s, 0x0043U); in pin_blocks()
803 rc = set_validity_icpt(scb_s, 0x0043U); in pin_blocks()
808 scb_s->riccbd = hpa; in pin_blocks()
810 if (((scb_s->ecb & ECB_GS) && !(scb_s->ecd & ECD_HOSTREGMGMT)) || in pin_blocks()
811 (scb_s->ecd & ECD_ETOKENF)) { in pin_blocks()
817 rc = set_validity_icpt(scb_s, 0x10b0U); in pin_blocks()
821 rc = set_validity_icpt(scb_s, 0x10b1U); in pin_blocks()
825 rc = set_validity_icpt(scb_s, 0x10b2U); in pin_blocks()
833 rc = set_validity_icpt(scb_s, 0x10b0U); in pin_blocks()
837 scb_s->sdnxo = hpa | sdnxc; in pin_blocks()
952 vsie_page->scb_s.icptcode = 0; in clear_vsie_icpt()
958 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in retry_vsie_icpt() local
959 int ilen = insn_length(scb_s->ipa >> 8); in retry_vsie_icpt()
962 if (scb_s->icptstatus & 1) { in retry_vsie_icpt()
963 ilen = (scb_s->icptstatus >> 4) & 0x6; in retry_vsie_icpt()
967 scb_s->gpsw.addr = __rewind_psw(scb_s->gpsw, ilen); in retry_vsie_icpt()
980 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in handle_stfle() local
987 return set_validity_icpt(scb_s, 0x1090U); in handle_stfle()
988 scb_s->fac = (__u32)(__u64) &vsie_page->fac; in handle_stfle()
1006 return vsie_page->scb_s.gg15; in vsie_get_register()
1008 return vsie_page->scb_s.gg14; in vsie_get_register()
1016 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in vsie_handle_mvpg() local
1024 mask = _kvm_s390_logical_to_effective(&scb_s->gpsw, PAGE_MASK); in vsie_handle_mvpg()
1025 prefix = scb_s->prefix << GUEST_PREFIX_SHIFT; in vsie_handle_mvpg()
1027 dest = vsie_get_register(vcpu, vsie_page, scb_s->ipb >> 20) & mask; in vsie_handle_mvpg()
1028 dest = _kvm_s390_real_to_abs(prefix, dest) + scb_s->mso; in vsie_handle_mvpg()
1029 src = vsie_get_register(vcpu, vsie_page, scb_s->ipb >> 16) & mask; in vsie_handle_mvpg()
1030 src = _kvm_s390_real_to_abs(prefix, src) + scb_s->mso; in vsie_handle_mvpg()
1097 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in do_vsie_run() local
1134 rc = sie64a(scb_s, vcpu->run->s.regs.gprs); in do_vsie_run()
1159 switch (scb_s->icptcode) { in do_vsie_run()
1161 if (scb_s->ipa == 0xb2b0) in do_vsie_run()
1170 if ((scb_s->ipa & 0xf000) != 0xf000) in do_vsie_run()
1171 scb_s->ipa += 0x1000; in do_vsie_run()
1174 if (scb_s->ipa == 0xb254) in do_vsie_run()
1226 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in register_shadow_scb() local
1228 WRITE_ONCE(vcpu->arch.vsie_block, &vsie_page->scb_s); in register_shadow_scb()
1239 scb_s->epoch += vcpu->kvm->arch.epoch; in register_shadow_scb()
1241 if (scb_s->ecd & ECD_MEF) { in register_shadow_scb()
1242 scb_s->epdx += vcpu->kvm->arch.epdx; in register_shadow_scb()
1243 if (scb_s->epoch < vcpu->kvm->arch.epoch) in register_shadow_scb()
1244 scb_s->epdx += 1; in register_shadow_scb()
1269 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in vsie_run() local
1282 atomic_andnot(PROG_BLOCK_SIE, &scb_s->prog20); in vsie_run()
1286 if (rc || scb_s->icptcode || signal_pending(current) || in vsie_run()
1304 scb_s->icptcode = ICPT_PROGI; in vsie_run()
1305 scb_s->iprcc = PGM_ADDRESSING; in vsie_run()
1306 scb_s->pgmilc = 4; in vsie_run()
1307 scb_s->gpsw.addr = __rewind_psw(scb_s->gpsw, 4); in vsie_run()
1373 memset(&vsie_page->scb_s, 0, sizeof(struct kvm_s390_sie_block)); in get_vsie_page()
1376 vsie_page->scb_s.ihcpu = 0xffffU; in get_vsie_page()