Lines Matching refs:scb_s

25 	struct kvm_s390_sie_block scb_s;	/* 0x0000 */  member
65 atomic_or(PROG_REQUEST, &vsie_page->scb_s.prog20); in prefix_unmapped()
72 if (vsie_page->scb_s.prog0c & PROG_IN_SIE) in prefix_unmapped_sync()
73 atomic_or(CPUSTAT_STOP_INT, &vsie_page->scb_s.cpuflags); in prefix_unmapped_sync()
74 while (vsie_page->scb_s.prog0c & PROG_IN_SIE) in prefix_unmapped_sync()
81 atomic_andnot(PROG_REQUEST, &vsie_page->scb_s.prog20); in prefix_mapped()
87 return !(atomic_read(&vsie_page->scb_s.prog20) & PROG_REQUEST); in prefix_is_mapped()
97 atomic_andnot(bits, &vsie_page->scb_s.cpuflags); in update_intervention_requests()
98 atomic_or(cpuflags & bits, &vsie_page->scb_s.cpuflags); in update_intervention_requests()
104 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in prepare_cpuflags() local
110 return set_validity_icpt(scb_s, 0x0001U); in prepare_cpuflags()
113 return set_validity_icpt(scb_s, 0x0001U); in prepare_cpuflags()
115 return set_validity_icpt(scb_s, 0x0007U); in prepare_cpuflags()
123 return set_validity_icpt(scb_s, 0x0001U); in prepare_cpuflags()
135 atomic_set(&scb_s->cpuflags, newflags); in prepare_cpuflags()
285 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in shadow_crycb() local
299 scb_s->crycbd = 0; in shadow_crycb()
307 return set_validity_icpt(scb_s, 0x0039U); in shadow_crycb()
312 return set_validity_icpt(scb_s, 0x003CU); in shadow_crycb()
320 scb_s->eca |= scb_o->eca & ECA_APIE; in shadow_crycb()
333 return set_validity_icpt(scb_s, 0x0035U); in shadow_crycb()
335 scb_s->ecb3 |= ecb3_flags; in shadow_crycb()
336 scb_s->ecd |= ecd_flags; in shadow_crycb()
347 return set_validity_icpt(scb_s, 0x0022U); in shadow_crycb()
349 return set_validity_icpt(scb_s, 0x0035U); in shadow_crycb()
351 return set_validity_icpt(scb_s, 0x003CU); in shadow_crycb()
353 scb_s->crycbd = ((__u32)(__u64) &vsie_page->crycb) | CRYCB_FORMAT2; in shadow_crycb()
360 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in prepare_ibc() local
367 scb_s->ibc = 0; in prepare_ibc()
370 scb_s->ibc = new_ibc; in prepare_ibc()
372 if (scb_s->ibc < min_ibc) in prepare_ibc()
373 scb_s->ibc = min_ibc; in prepare_ibc()
375 if (scb_s->ibc > vcpu->kvm->arch.model.ibc) in prepare_ibc()
376 scb_s->ibc = vcpu->kvm->arch.model.ibc; in prepare_ibc()
383 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in unshadow_scb() local
387 scb_o->icptcode = scb_s->icptcode; in unshadow_scb()
388 scb_o->icptstatus = scb_s->icptstatus; in unshadow_scb()
389 scb_o->ipa = scb_s->ipa; in unshadow_scb()
390 scb_o->ipb = scb_s->ipb; in unshadow_scb()
391 scb_o->gbea = scb_s->gbea; in unshadow_scb()
394 scb_o->cputm = scb_s->cputm; in unshadow_scb()
395 scb_o->ckc = scb_s->ckc; in unshadow_scb()
396 scb_o->todpr = scb_s->todpr; in unshadow_scb()
399 scb_o->gpsw = scb_s->gpsw; in unshadow_scb()
400 scb_o->gg14 = scb_s->gg14; in unshadow_scb()
401 scb_o->gg15 = scb_s->gg15; in unshadow_scb()
402 memcpy(scb_o->gcr, scb_s->gcr, 128); in unshadow_scb()
403 scb_o->pp = scb_s->pp; in unshadow_scb()
408 scb_o->fpf |= scb_s->fpf & FPF_BPBC; in unshadow_scb()
412 switch (scb_s->icptcode) { in unshadow_scb()
417 (void *)((u64)scb_s + 0xc0), 0xf0 - 0xc0); in unshadow_scb()
422 (void *)((u64)scb_s + 0xc0), 0xd0 - 0xc0); in unshadow_scb()
426 if (scb_s->ihcpu != 0xffffU) in unshadow_scb()
427 scb_o->ihcpu = scb_s->ihcpu; in unshadow_scb()
440 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in shadow_scb() local
445 bool had_tx = scb_s->ecb & ECB_TE; in shadow_scb()
450 scb_s->icptcode = 0; in shadow_scb()
451 scb_s->eca = 0; in shadow_scb()
452 scb_s->ecb = 0; in shadow_scb()
453 scb_s->ecb2 = 0; in shadow_scb()
454 scb_s->ecb3 = 0; in shadow_scb()
455 scb_s->ecd = 0; in shadow_scb()
456 scb_s->fac = 0; in shadow_scb()
457 scb_s->fpf = 0; in shadow_scb()
464 scb_s->cputm = scb_o->cputm; in shadow_scb()
465 scb_s->ckc = scb_o->ckc; in shadow_scb()
466 scb_s->todpr = scb_o->todpr; in shadow_scb()
467 scb_s->epoch = scb_o->epoch; in shadow_scb()
470 scb_s->gpsw = scb_o->gpsw; in shadow_scb()
471 scb_s->gg14 = scb_o->gg14; in shadow_scb()
472 scb_s->gg15 = scb_o->gg15; in shadow_scb()
473 memcpy(scb_s->gcr, scb_o->gcr, 128); in shadow_scb()
474 scb_s->pp = scb_o->pp; in shadow_scb()
477 scb_s->gbea = scb_o->gbea; in shadow_scb()
478 scb_s->lctl = scb_o->lctl; in shadow_scb()
479 scb_s->svcc = scb_o->svcc; in shadow_scb()
480 scb_s->ictl = scb_o->ictl; in shadow_scb()
486 if (!(atomic_read(&scb_s->cpuflags) & CPUSTAT_KSS)) in shadow_scb()
487 scb_s->ictl |= ICTL_ISKE | ICTL_SSKE | ICTL_RRBE; in shadow_scb()
489 scb_s->icpua = scb_o->icpua; in shadow_scb()
491 if (!(atomic_read(&scb_s->cpuflags) & CPUSTAT_SM)) in shadow_scb()
494 if (scb_s->mso != new_mso || scb_s->prefix != new_prefix) in shadow_scb()
497 scb_s->msl = scb_o->msl & 0xfffffffffff00000UL; in shadow_scb()
498 scb_s->mso = new_mso; in shadow_scb()
499 scb_s->prefix = new_prefix; in shadow_scb()
502 if (scb_s->ihcpu != 0xffffU) in shadow_scb()
503 scb_s->ihcpu = scb_o->ihcpu; in shadow_scb()
506 scb_s->eca |= scb_o->eca & (ECA_MVPGI | ECA_PROTEXCI); in shadow_scb()
509 scb_s->ecb |= scb_o->ecb & ECB_HOSTPROTINT; in shadow_scb()
515 scb_s->ecb |= ECB_TE; in shadow_scb()
519 scb_s->fpf |= scb_o->fpf & FPF_BPBC; in shadow_scb()
522 scb_s->eca |= scb_o->eca & ECA_VX; in shadow_scb()
523 scb_s->ecd |= scb_o->ecd & ECD_HOSTREGMGMT; in shadow_scb()
527 scb_s->ecb3 |= scb_o->ecb3 & ECB3_RI; in shadow_scb()
530 scb_s->ecb2 |= scb_o->ecb2 & ECB2_IEP; in shadow_scb()
533 scb_s->ecb |= scb_o->ecb & ECB_GS; in shadow_scb()
534 scb_s->ecd |= scb_o->ecd & ECD_HOSTREGMGMT; in shadow_scb()
537 scb_s->eca |= scb_o->eca & ECA_SII; in shadow_scb()
539 scb_s->eca |= scb_o->eca & ECA_IB; in shadow_scb()
541 scb_s->eca |= scb_o->eca & ECA_CEI; in shadow_scb()
544 scb_s->ecd |= scb_o->ecd & ECD_MEF; in shadow_scb()
548 scb_s->ecd |= scb_o->ecd & ECD_ETOKENF; in shadow_scb()
550 scb_s->hpid = HPID_VSIE; in shadow_scb()
586 prefix = cur->scb_s.prefix << GUEST_PREFIX_SHIFT; in kvm_s390_vsie_gmap_notifier()
588 prefix += cur->scb_s.mso; in kvm_s390_vsie_gmap_notifier()
608 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in map_prefix() local
609 u64 prefix = scb_s->prefix << GUEST_PREFIX_SHIFT; in map_prefix()
619 prefix += scb_s->mso; in map_prefix()
622 if (!rc && (scb_s->ecb & ECB_TE)) in map_prefix()
632 rc = set_validity_icpt(scb_s, 0x0037U); in map_prefix()
665 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in unpin_blocks() local
668 hpa = (u64) scb_s->scaoh << 32 | scb_s->scaol; in unpin_blocks()
672 scb_s->scaol = 0; in unpin_blocks()
673 scb_s->scaoh = 0; in unpin_blocks()
676 hpa = scb_s->itdba; in unpin_blocks()
680 scb_s->itdba = 0; in unpin_blocks()
683 hpa = scb_s->gvrd; in unpin_blocks()
687 scb_s->gvrd = 0; in unpin_blocks()
690 hpa = scb_s->riccbd; in unpin_blocks()
694 scb_s->riccbd = 0; in unpin_blocks()
697 hpa = scb_s->sdnxo; in unpin_blocks()
701 scb_s->sdnxo = 0; in unpin_blocks()
722 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in pin_blocks() local
732 rc = set_validity_icpt(scb_s, 0x0038U); in pin_blocks()
734 rc = set_validity_icpt(scb_s, 0x0011U); in pin_blocks()
737 rc = set_validity_icpt(scb_s, 0x003bU); in pin_blocks()
741 rc = set_validity_icpt(scb_s, 0x0034U); in pin_blocks()
746 scb_s->scaoh = (u32)((u64)hpa >> 32); in pin_blocks()
747 scb_s->scaol = (u32)(u64)hpa; in pin_blocks()
751 if (gpa && (scb_s->ecb & ECB_TE)) { in pin_blocks()
753 rc = set_validity_icpt(scb_s, 0x0080U); in pin_blocks()
759 rc = set_validity_icpt(scb_s, 0x0080U); in pin_blocks()
763 scb_s->itdba = hpa; in pin_blocks()
767 if (gpa && (scb_s->eca & ECA_VX) && !(scb_s->ecd & ECD_HOSTREGMGMT)) { in pin_blocks()
769 rc = set_validity_icpt(scb_s, 0x1310U); in pin_blocks()
778 rc = set_validity_icpt(scb_s, 0x1310U); in pin_blocks()
782 scb_s->gvrd = hpa; in pin_blocks()
786 if (gpa && (scb_s->ecb3 & ECB3_RI)) { in pin_blocks()
788 rc = set_validity_icpt(scb_s, 0x0043U); in pin_blocks()
794 rc = set_validity_icpt(scb_s, 0x0043U); in pin_blocks()
799 scb_s->riccbd = hpa; in pin_blocks()
801 if (((scb_s->ecb & ECB_GS) && !(scb_s->ecd & ECD_HOSTREGMGMT)) || in pin_blocks()
802 (scb_s->ecd & ECD_ETOKENF)) { in pin_blocks()
808 rc = set_validity_icpt(scb_s, 0x10b0U); in pin_blocks()
812 rc = set_validity_icpt(scb_s, 0x10b1U); in pin_blocks()
816 rc = set_validity_icpt(scb_s, 0x10b2U); in pin_blocks()
824 rc = set_validity_icpt(scb_s, 0x10b0U); in pin_blocks()
828 scb_s->sdnxo = hpa | sdnxc; in pin_blocks()
943 vsie_page->scb_s.icptcode = 0; in clear_vsie_icpt()
949 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in retry_vsie_icpt() local
950 int ilen = insn_length(scb_s->ipa >> 8); in retry_vsie_icpt()
953 if (scb_s->icptstatus & 1) { in retry_vsie_icpt()
954 ilen = (scb_s->icptstatus >> 4) & 0x6; in retry_vsie_icpt()
958 scb_s->gpsw.addr = __rewind_psw(scb_s->gpsw, ilen); in retry_vsie_icpt()
971 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in handle_stfle() local
978 return set_validity_icpt(scb_s, 0x1090U); in handle_stfle()
979 scb_s->fac = (__u32)(__u64) &vsie_page->fac; in handle_stfle()
996 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in do_vsie_run() local
1036 rc = sie64a(scb_s, vcpu->run->s.regs.gprs); in do_vsie_run()
1061 switch (scb_s->icptcode) { in do_vsie_run()
1063 if (scb_s->ipa == 0xb2b0) in do_vsie_run()
1072 if ((scb_s->ipa & 0xf000) != 0xf000) in do_vsie_run()
1073 scb_s->ipa += 0x1000; in do_vsie_run()
1124 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in register_shadow_scb() local
1126 WRITE_ONCE(vcpu->arch.vsie_block, &vsie_page->scb_s); in register_shadow_scb()
1137 scb_s->epoch += vcpu->kvm->arch.epoch; in register_shadow_scb()
1139 if (scb_s->ecd & ECD_MEF) { in register_shadow_scb()
1140 scb_s->epdx += vcpu->kvm->arch.epdx; in register_shadow_scb()
1141 if (scb_s->epoch < vcpu->kvm->arch.epoch) in register_shadow_scb()
1142 scb_s->epdx += 1; in register_shadow_scb()
1167 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; in vsie_run() local
1180 atomic_andnot(PROG_BLOCK_SIE, &scb_s->prog20); in vsie_run()
1184 if (rc || scb_s->icptcode || signal_pending(current) || in vsie_run()
1201 scb_s->icptcode = ICPT_PROGI; in vsie_run()
1202 scb_s->iprcc = PGM_ADDRESSING; in vsie_run()
1203 scb_s->pgmilc = 4; in vsie_run()
1204 scb_s->gpsw.addr = __rewind_psw(scb_s->gpsw, 4); in vsie_run()
1269 memset(&vsie_page->scb_s, 0, sizeof(struct kvm_s390_sie_block)); in get_vsie_page()
1272 vsie_page->scb_s.ihcpu = 0xffffU; in get_vsie_page()