Lines Matching refs:t

225 	struct test_default t;  in test_default_init()  local
227 t.size = min((size_t)kvm_check_cap(KVM_CAP_S390_MEM_OP), sizeof(mem1)); in test_default_init()
228 t.kvm_vm = vm_create_with_one_vcpu(&vcpu, guest_code); in test_default_init()
229 t.vm = (struct test_info) { t.kvm_vm, NULL }; in test_default_init()
230 t.vcpu = (struct test_info) { t.kvm_vm, vcpu }; in test_default_init()
231 t.run = vcpu->run; in test_default_init()
232 return t; in test_default_init()
309 struct test_default t = test_default_init(guest_copy); in test_copy() local
311 HOST_SYNC(t.vcpu, STAGE_INITED); in test_copy()
313 DEFAULT_WRITE_READ(t.vcpu, t.vcpu, LOGICAL, t.size); in test_copy()
315 kvm_vm_free(t.kvm_vm); in test_copy()
355 struct test_default t = test_default_init(guest_copy_key); in test_copy_key() local
357 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_copy_key()
360 DEFAULT_WRITE_READ(t.vcpu, t.vm, ABSOLUTE, t.size); in test_copy_key()
363 DEFAULT_WRITE_READ(t.vcpu, t.vcpu, LOGICAL, t.size, KEY(0)); in test_copy_key()
364 DEFAULT_WRITE_READ(t.vcpu, t.vcpu, LOGICAL, t.size, KEY(9)); in test_copy_key()
365 DEFAULT_WRITE_READ(t.vcpu, t.vm, ABSOLUTE, t.size, KEY(0)); in test_copy_key()
366 DEFAULT_WRITE_READ(t.vcpu, t.vm, ABSOLUTE, t.size, KEY(9)); in test_copy_key()
372 DEFAULT_WRITE_READ(t.vcpu, t.vcpu, LOGICAL, 1, KEY(0)); in test_copy_key()
373 DEFAULT_WRITE_READ(t.vcpu, t.vcpu, LOGICAL, 1, KEY(9)); in test_copy_key()
374 DEFAULT_WRITE_READ(t.vcpu, t.vm, ABSOLUTE, 1, KEY(0)); in test_copy_key()
375 DEFAULT_WRITE_READ(t.vcpu, t.vm, ABSOLUTE, 1, KEY(9)); in test_copy_key()
378 DEFAULT_READ(t.vcpu, t.vcpu, LOGICAL, t.size, GADDR_V(mem2), KEY(2)); in test_copy_key()
379 DEFAULT_READ(t.vcpu, t.vm, ABSOLUTE, t.size, GADDR_V(mem1), KEY(2)); in test_copy_key()
381 kvm_vm_free(t.kvm_vm); in test_copy_key()
404 struct test_default t = test_default_init(guest_copy_key_fetch_prot); in test_copy_key_storage_prot_override() local
406 HOST_SYNC(t.vcpu, STAGE_INITED); in test_copy_key_storage_prot_override()
407 t.run->s.regs.crs[0] |= CR0_STORAGE_PROTECTION_OVERRIDE; in test_copy_key_storage_prot_override()
408 t.run->kvm_dirty_regs = KVM_SYNC_CRS; in test_copy_key_storage_prot_override()
409 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_copy_key_storage_prot_override()
412 DEFAULT_WRITE_READ(t.vcpu, t.vcpu, LOGICAL, t.size, KEY(2)); in test_copy_key_storage_prot_override()
414 kvm_vm_free(t.kvm_vm); in test_copy_key_storage_prot_override()
419 struct test_default t = test_default_init(guest_copy_key_fetch_prot); in test_copy_key_fetch_prot() local
421 HOST_SYNC(t.vcpu, STAGE_INITED); in test_copy_key_fetch_prot()
422 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_copy_key_fetch_prot()
425 DEFAULT_READ(t.vcpu, t.vcpu, LOGICAL, t.size, GADDR_V(mem2), KEY(9)); in test_copy_key_fetch_prot()
426 DEFAULT_READ(t.vcpu, t.vm, ABSOLUTE, t.size, GADDR_V(mem2), KEY(9)); in test_copy_key_fetch_prot()
428 kvm_vm_free(t.kvm_vm); in test_copy_key_fetch_prot()
450 struct test_default t = test_default_init(guest_error_key); in test_errors_key() local
452 HOST_SYNC(t.vcpu, STAGE_INITED); in test_errors_key()
453 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_errors_key()
456 CHECK_N_DO(ERR_PROT_MOP, t.vcpu, LOGICAL, WRITE, mem1, t.size, GADDR_V(mem1), KEY(2)); in test_errors_key()
457 CHECK_N_DO(ERR_PROT_MOP, t.vcpu, LOGICAL, READ, mem2, t.size, GADDR_V(mem2), KEY(2)); in test_errors_key()
458 CHECK_N_DO(ERR_PROT_MOP, t.vm, ABSOLUTE, WRITE, mem1, t.size, GADDR_V(mem1), KEY(2)); in test_errors_key()
459 CHECK_N_DO(ERR_PROT_MOP, t.vm, ABSOLUTE, READ, mem2, t.size, GADDR_V(mem2), KEY(2)); in test_errors_key()
461 kvm_vm_free(t.kvm_vm); in test_errors_key()
466 struct test_default t = test_default_init(guest_error_key); in test_termination() local
472 HOST_SYNC(t.vcpu, STAGE_INITED); in test_termination()
473 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_termination()
476 ERR_PROT_MOP(t.vcpu, LOGICAL, WRITE, mem1, t.size, GADDR_V(mem1), KEY(1), INJECT); in test_termination()
483 prefix = t.run->s.regs.prefix; in test_termination()
484 psw[0] = t.run->psw_mask; in test_termination()
485 psw[1] = t.run->psw_addr; in test_termination()
486 MOP(t.vm, ABSOLUTE, WRITE, psw, sizeof(psw), GADDR(prefix + 464)); in test_termination()
487 HOST_SYNC(t.vcpu, STAGE_IDLED); in test_termination()
488 MOP(t.vm, ABSOLUTE, READ, &teid, sizeof(teid), GADDR(prefix + 168)); in test_termination()
492 kvm_vm_free(t.kvm_vm); in test_termination()
497 struct test_default t = test_default_init(guest_copy_key_fetch_prot); in test_errors_key_storage_prot_override() local
499 HOST_SYNC(t.vcpu, STAGE_INITED); in test_errors_key_storage_prot_override()
500 t.run->s.regs.crs[0] |= CR0_STORAGE_PROTECTION_OVERRIDE; in test_errors_key_storage_prot_override()
501 t.run->kvm_dirty_regs = KVM_SYNC_CRS; in test_errors_key_storage_prot_override()
502 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_errors_key_storage_prot_override()
505 CHECK_N_DO(ERR_PROT_MOP, t.vm, ABSOLUTE, WRITE, mem1, t.size, GADDR_V(mem1), KEY(2)); in test_errors_key_storage_prot_override()
506 CHECK_N_DO(ERR_PROT_MOP, t.vm, ABSOLUTE, READ, mem2, t.size, GADDR_V(mem2), KEY(2)); in test_errors_key_storage_prot_override()
508 kvm_vm_free(t.kvm_vm); in test_errors_key_storage_prot_override()
533 struct test_default t = test_default_init(guest_copy_key_fetch_prot_override); in test_copy_key_fetch_prot_override() local
536 guest_0_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, 0); in test_copy_key_fetch_prot_override()
537 guest_last_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, last_page_addr); in test_copy_key_fetch_prot_override()
543 HOST_SYNC(t.vcpu, STAGE_INITED); in test_copy_key_fetch_prot_override()
544 t.run->s.regs.crs[0] |= CR0_FETCH_PROTECTION_OVERRIDE; in test_copy_key_fetch_prot_override()
545 t.run->kvm_dirty_regs = KVM_SYNC_CRS; in test_copy_key_fetch_prot_override()
546 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_copy_key_fetch_prot_override()
550 MOP(t.vcpu, LOGICAL, WRITE, mem1, PAGE_SIZE, GADDR_V(mem1)); in test_copy_key_fetch_prot_override()
551 HOST_SYNC(t.vcpu, STAGE_COPIED); in test_copy_key_fetch_prot_override()
552 CHECK_N_DO(MOP, t.vcpu, LOGICAL, READ, mem2, 2048, GADDR_V(guest_0_page), KEY(2)); in test_copy_key_fetch_prot_override()
560 MOP(t.vcpu, LOGICAL, WRITE, mem1, 2 * PAGE_SIZE, GADDR_V(guest_last_page)); in test_copy_key_fetch_prot_override()
561 HOST_SYNC(t.vcpu, STAGE_COPIED); in test_copy_key_fetch_prot_override()
562 CHECK_N_DO(MOP, t.vcpu, LOGICAL, READ, mem2, PAGE_SIZE + 2048, in test_copy_key_fetch_prot_override()
567 kvm_vm_free(t.kvm_vm); in test_copy_key_fetch_prot_override()
572 struct test_default t = test_default_init(guest_copy_key_fetch_prot_override); in test_errors_key_fetch_prot_override_not_enabled() local
575 guest_0_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, 0); in test_errors_key_fetch_prot_override_not_enabled()
576 guest_last_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, last_page_addr); in test_errors_key_fetch_prot_override_not_enabled()
581 HOST_SYNC(t.vcpu, STAGE_INITED); in test_errors_key_fetch_prot_override_not_enabled()
582 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_errors_key_fetch_prot_override_not_enabled()
585 CHECK_N_DO(ERR_PROT_MOP, t.vcpu, LOGICAL, READ, mem2, 2048, GADDR_V(0), KEY(2)); in test_errors_key_fetch_prot_override_not_enabled()
588 kvm_vm_free(t.kvm_vm); in test_errors_key_fetch_prot_override_not_enabled()
593 struct test_default t = test_default_init(guest_copy_key_fetch_prot_override); in test_errors_key_fetch_prot_override_enabled() local
596 guest_0_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, 0); in test_errors_key_fetch_prot_override_enabled()
597 guest_last_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, last_page_addr); in test_errors_key_fetch_prot_override_enabled()
602 HOST_SYNC(t.vcpu, STAGE_INITED); in test_errors_key_fetch_prot_override_enabled()
603 t.run->s.regs.crs[0] |= CR0_FETCH_PROTECTION_OVERRIDE; in test_errors_key_fetch_prot_override_enabled()
604 t.run->kvm_dirty_regs = KVM_SYNC_CRS; in test_errors_key_fetch_prot_override_enabled()
605 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_errors_key_fetch_prot_override_enabled()
611 CHECK_N_DO(ERR_PROT_MOP, t.vcpu, LOGICAL, READ, mem2, 2048 + 1, GADDR_V(0), KEY(2)); in test_errors_key_fetch_prot_override_enabled()
612 CHECK_N_DO(ERR_PROT_MOP, t.vcpu, LOGICAL, READ, mem2, PAGE_SIZE + 2048 + 1, in test_errors_key_fetch_prot_override_enabled()
615 CHECK_N_DO(ERR_PROT_MOP, t.vm, ABSOLUTE, READ, mem2, 2048, GADDR(0), KEY(2)); in test_errors_key_fetch_prot_override_enabled()
616 CHECK_N_DO(ERR_PROT_MOP, t.vm, ABSOLUTE, READ, mem2, 2048, GADDR_V(guest_0_page), KEY(2)); in test_errors_key_fetch_prot_override_enabled()
619 kvm_vm_free(t.kvm_vm); in test_errors_key_fetch_prot_override_enabled()
662 struct test_default t = test_default_init(guest_idle); in test_errors() local
665 HOST_SYNC(t.vcpu, STAGE_INITED); in test_errors()
667 _test_errors_common(t.vcpu, LOGICAL, t.size); in test_errors()
668 _test_errors_common(t.vm, ABSOLUTE, t.size); in test_errors()
671 rv = ERR_MOP(t.vcpu, INVALID, WRITE, mem1, t.size, GADDR_V(mem1)); in test_errors()
674 rv = ERR_MOP(t.vm, INVALID, WRITE, mem1, PAGE_SIZE, GADDR(0)); in test_errors()
678 t.run->psw_mask &= ~(3UL << (63 - 17)); in test_errors()
679 t.run->psw_mask |= 1UL << (63 - 17); /* Enable AR mode */ in test_errors()
680 HOST_SYNC(t.vcpu, STAGE_IDLED); /* To sync new state to SIE block */ in test_errors()
681 rv = ERR_MOP(t.vcpu, LOGICAL, WRITE, mem1, t.size, GADDR_V(mem1), AR(17)); in test_errors()
683 t.run->psw_mask &= ~(3UL << (63 - 17)); /* Disable AR mode */ in test_errors()
684 HOST_SYNC(t.vcpu, STAGE_IDLED); /* Run to sync new state */ in test_errors()
687 rv = ERR_MOP(t.vcpu, SIDA, READ, mem1, 8, GADDR(0), SIDA_OFFSET(0x1c0)); in test_errors()
690 rv = ERR_MOP(t.vcpu, SIDA, WRITE, mem1, 8, GADDR(0), SIDA_OFFSET(0x1c0)); in test_errors()
694 kvm_vm_free(t.kvm_vm); in test_errors()