Lines Matching refs:t
248 struct test_default t; in test_default_init() local
250 t.size = min((size_t)kvm_check_cap(KVM_CAP_S390_MEM_OP), sizeof(mem1)); in test_default_init()
251 t.kvm_vm = vm_create_with_one_vcpu(&vcpu, guest_code); in test_default_init()
252 t.vm = (struct test_info) { t.kvm_vm, NULL }; in test_default_init()
253 t.vcpu = (struct test_info) { t.kvm_vm, vcpu }; in test_default_init()
254 t.run = vcpu->run; in test_default_init()
255 return t; in test_default_init()
369 struct test_default t = test_default_init(guest_copy); in test_copy() local
371 HOST_SYNC(t.vcpu, STAGE_INITED); in test_copy()
373 default_write_read(t.vcpu, t.vcpu, LOGICAL, t.size, NO_KEY); in test_copy()
375 kvm_vm_free(t.kvm_vm); in test_copy()
415 struct test_default t = test_default_init(guest_copy_key); in test_copy_key() local
417 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_copy_key()
420 default_write_read(t.vcpu, t.vm, ABSOLUTE, t.size, NO_KEY); in test_copy_key()
423 default_write_read(t.vcpu, t.vcpu, LOGICAL, t.size, 0); in test_copy_key()
424 default_write_read(t.vcpu, t.vcpu, LOGICAL, t.size, 9); in test_copy_key()
425 default_write_read(t.vcpu, t.vm, ABSOLUTE, t.size, 0); in test_copy_key()
426 default_write_read(t.vcpu, t.vm, ABSOLUTE, t.size, 9); in test_copy_key()
432 default_write_read(t.vcpu, t.vcpu, LOGICAL, 1, 0); in test_copy_key()
433 default_write_read(t.vcpu, t.vcpu, LOGICAL, 1, 9); in test_copy_key()
434 default_write_read(t.vcpu, t.vm, ABSOLUTE, 1, 0); in test_copy_key()
435 default_write_read(t.vcpu, t.vm, ABSOLUTE, 1, 9); in test_copy_key()
438 default_read(t.vcpu, t.vcpu, LOGICAL, t.size, 2); in test_copy_key()
439 default_read(t.vcpu, t.vm, ABSOLUTE, t.size, 2); in test_copy_key()
441 kvm_vm_free(t.kvm_vm); in test_copy_key()
446 struct test_default t = test_default_init(guest_copy_key); in test_cmpxchg_key() local
448 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_cmpxchg_key()
450 default_cmpxchg(&t, NO_KEY); in test_cmpxchg_key()
451 default_cmpxchg(&t, 0); in test_cmpxchg_key()
452 default_cmpxchg(&t, 9); in test_cmpxchg_key()
454 kvm_vm_free(t.kvm_vm); in test_cmpxchg_key()
645 struct test_default t = test_default_init(guest_cmpxchg_key); in test_cmpxchg_key_concurrent() local
651 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_cmpxchg_key_concurrent()
653 MOP(t.vcpu, LOGICAL, WRITE, mem1, max_block, GADDR_V(mem2)); in test_cmpxchg_key_concurrent()
654 pthread_create(&thread, NULL, run_guest, &t.vcpu); in test_cmpxchg_key_concurrent()
660 MOP(t.vm, ABSOLUTE, CMPXCHG, &new, in test_cmpxchg_key_concurrent()
669 MOP(t.vm, ABSOLUTE, CMPXCHG, quad_to_char(&new, size), in test_cmpxchg_key_concurrent()
679 MOP(t.vcpu, LOGICAL, READ, mem2, max_block, GADDR_V(mem2)); in test_cmpxchg_key_concurrent()
683 kvm_vm_free(t.kvm_vm); in test_cmpxchg_key_concurrent()
706 struct test_default t = test_default_init(guest_copy_key_fetch_prot); in test_copy_key_storage_prot_override() local
708 HOST_SYNC(t.vcpu, STAGE_INITED); in test_copy_key_storage_prot_override()
709 t.run->s.regs.crs[0] |= CR0_STORAGE_PROTECTION_OVERRIDE; in test_copy_key_storage_prot_override()
710 t.run->kvm_dirty_regs = KVM_SYNC_CRS; in test_copy_key_storage_prot_override()
711 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_copy_key_storage_prot_override()
714 default_write_read(t.vcpu, t.vcpu, LOGICAL, t.size, 2); in test_copy_key_storage_prot_override()
716 kvm_vm_free(t.kvm_vm); in test_copy_key_storage_prot_override()
721 struct test_default t = test_default_init(guest_copy_key_fetch_prot); in test_copy_key_fetch_prot() local
723 HOST_SYNC(t.vcpu, STAGE_INITED); in test_copy_key_fetch_prot()
724 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_copy_key_fetch_prot()
727 default_read(t.vcpu, t.vcpu, LOGICAL, t.size, 9); in test_copy_key_fetch_prot()
728 default_read(t.vcpu, t.vm, ABSOLUTE, t.size, 9); in test_copy_key_fetch_prot()
730 kvm_vm_free(t.kvm_vm); in test_copy_key_fetch_prot()
752 struct test_default t = test_default_init(guest_error_key); in test_errors_key() local
754 HOST_SYNC(t.vcpu, STAGE_INITED); in test_errors_key()
755 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_errors_key()
758 CHECK_N_DO(ERR_PROT_MOP, t.vcpu, LOGICAL, WRITE, mem1, t.size, GADDR_V(mem1), KEY(2)); in test_errors_key()
759 CHECK_N_DO(ERR_PROT_MOP, t.vcpu, LOGICAL, READ, mem2, t.size, GADDR_V(mem1), KEY(2)); in test_errors_key()
760 CHECK_N_DO(ERR_PROT_MOP, t.vm, ABSOLUTE, WRITE, mem1, t.size, GADDR_V(mem1), KEY(2)); in test_errors_key()
761 CHECK_N_DO(ERR_PROT_MOP, t.vm, ABSOLUTE, READ, mem2, t.size, GADDR_V(mem1), KEY(2)); in test_errors_key()
763 kvm_vm_free(t.kvm_vm); in test_errors_key()
768 struct test_default t = test_default_init(guest_copy_key_fetch_prot); in test_errors_cmpxchg_key() local
771 HOST_SYNC(t.vcpu, STAGE_INITED); in test_errors_cmpxchg_key()
772 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_errors_cmpxchg_key()
777 ERR_PROT_MOP(t.vm, ABSOLUTE, CMPXCHG, mem2, i, GADDR_V(mem2), in test_errors_cmpxchg_key()
781 kvm_vm_free(t.kvm_vm); in test_errors_cmpxchg_key()
786 struct test_default t = test_default_init(guest_error_key); in test_termination() local
792 HOST_SYNC(t.vcpu, STAGE_INITED); in test_termination()
793 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_termination()
796 ERR_PROT_MOP(t.vcpu, LOGICAL, WRITE, mem1, t.size, GADDR_V(mem1), KEY(1), INJECT); in test_termination()
803 prefix = t.run->s.regs.prefix; in test_termination()
804 psw[0] = t.run->psw_mask; in test_termination()
805 psw[1] = t.run->psw_addr; in test_termination()
806 MOP(t.vm, ABSOLUTE, WRITE, psw, sizeof(psw), GADDR(prefix + 464)); in test_termination()
807 HOST_SYNC(t.vcpu, STAGE_IDLED); in test_termination()
808 MOP(t.vm, ABSOLUTE, READ, &teid, sizeof(teid), GADDR(prefix + 168)); in test_termination()
812 kvm_vm_free(t.kvm_vm); in test_termination()
817 struct test_default t = test_default_init(guest_copy_key_fetch_prot); in test_errors_key_storage_prot_override() local
819 HOST_SYNC(t.vcpu, STAGE_INITED); in test_errors_key_storage_prot_override()
820 t.run->s.regs.crs[0] |= CR0_STORAGE_PROTECTION_OVERRIDE; in test_errors_key_storage_prot_override()
821 t.run->kvm_dirty_regs = KVM_SYNC_CRS; in test_errors_key_storage_prot_override()
822 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_errors_key_storage_prot_override()
825 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()
826 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()
828 kvm_vm_free(t.kvm_vm); in test_errors_key_storage_prot_override()
853 struct test_default t = test_default_init(guest_copy_key_fetch_prot_override); in test_copy_key_fetch_prot_override() local
856 guest_0_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, 0); in test_copy_key_fetch_prot_override()
857 guest_last_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, last_page_addr); in test_copy_key_fetch_prot_override()
863 HOST_SYNC(t.vcpu, STAGE_INITED); in test_copy_key_fetch_prot_override()
864 t.run->s.regs.crs[0] |= CR0_FETCH_PROTECTION_OVERRIDE; in test_copy_key_fetch_prot_override()
865 t.run->kvm_dirty_regs = KVM_SYNC_CRS; in test_copy_key_fetch_prot_override()
866 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_copy_key_fetch_prot_override()
870 MOP(t.vcpu, LOGICAL, WRITE, mem1, PAGE_SIZE, GADDR_V(mem1)); in test_copy_key_fetch_prot_override()
871 HOST_SYNC(t.vcpu, STAGE_COPIED); in test_copy_key_fetch_prot_override()
872 CHECK_N_DO(MOP, t.vcpu, LOGICAL, READ, mem2, 2048, GADDR_V(guest_0_page), KEY(2)); in test_copy_key_fetch_prot_override()
880 MOP(t.vcpu, LOGICAL, WRITE, mem1, 2 * PAGE_SIZE, GADDR_V(guest_last_page)); in test_copy_key_fetch_prot_override()
881 HOST_SYNC(t.vcpu, STAGE_COPIED); in test_copy_key_fetch_prot_override()
882 CHECK_N_DO(MOP, t.vcpu, LOGICAL, READ, mem2, PAGE_SIZE + 2048, in test_copy_key_fetch_prot_override()
887 kvm_vm_free(t.kvm_vm); in test_copy_key_fetch_prot_override()
892 struct test_default t = test_default_init(guest_copy_key_fetch_prot_override); in test_errors_key_fetch_prot_override_not_enabled() local
895 guest_0_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, 0); in test_errors_key_fetch_prot_override_not_enabled()
896 guest_last_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, last_page_addr); in test_errors_key_fetch_prot_override_not_enabled()
901 HOST_SYNC(t.vcpu, STAGE_INITED); in test_errors_key_fetch_prot_override_not_enabled()
902 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_errors_key_fetch_prot_override_not_enabled()
905 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()
908 kvm_vm_free(t.kvm_vm); in test_errors_key_fetch_prot_override_not_enabled()
913 struct test_default t = test_default_init(guest_copy_key_fetch_prot_override); in test_errors_key_fetch_prot_override_enabled() local
916 guest_0_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, 0); in test_errors_key_fetch_prot_override_enabled()
917 guest_last_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, last_page_addr); in test_errors_key_fetch_prot_override_enabled()
922 HOST_SYNC(t.vcpu, STAGE_INITED); in test_errors_key_fetch_prot_override_enabled()
923 t.run->s.regs.crs[0] |= CR0_FETCH_PROTECTION_OVERRIDE; in test_errors_key_fetch_prot_override_enabled()
924 t.run->kvm_dirty_regs = KVM_SYNC_CRS; in test_errors_key_fetch_prot_override_enabled()
925 HOST_SYNC(t.vcpu, STAGE_SKEYS_SET); in test_errors_key_fetch_prot_override_enabled()
931 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()
932 CHECK_N_DO(ERR_PROT_MOP, t.vcpu, LOGICAL, READ, mem2, PAGE_SIZE + 2048 + 1, in test_errors_key_fetch_prot_override_enabled()
935 CHECK_N_DO(ERR_PROT_MOP, t.vm, ABSOLUTE, READ, mem2, 2048, GADDR(0), KEY(2)); in test_errors_key_fetch_prot_override_enabled()
936 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()
939 kvm_vm_free(t.kvm_vm); in test_errors_key_fetch_prot_override_enabled()
984 struct test_default t = test_default_init(guest_idle); in test_errors() local
987 HOST_SYNC(t.vcpu, STAGE_INITED); in test_errors()
989 _test_errors_common(t.vcpu, LOGICAL, t.size); in test_errors()
990 _test_errors_common(t.vm, ABSOLUTE, t.size); in test_errors()
993 rv = ERR_MOP(t.vcpu, INVALID, WRITE, mem1, t.size, GADDR_V(mem1)); in test_errors()
996 rv = ERR_MOP(t.vm, INVALID, WRITE, mem1, PAGE_SIZE, GADDR(0)); in test_errors()
1000 t.run->psw_mask &= ~(3UL << (63 - 17)); in test_errors()
1001 t.run->psw_mask |= 1UL << (63 - 17); /* Enable AR mode */ in test_errors()
1002 HOST_SYNC(t.vcpu, STAGE_IDLED); /* To sync new state to SIE block */ in test_errors()
1003 rv = ERR_MOP(t.vcpu, LOGICAL, WRITE, mem1, t.size, GADDR_V(mem1), AR(17)); in test_errors()
1005 t.run->psw_mask &= ~(3UL << (63 - 17)); /* Disable AR mode */ in test_errors()
1006 HOST_SYNC(t.vcpu, STAGE_IDLED); /* Run to sync new state */ in test_errors()
1009 rv = ERR_MOP(t.vcpu, SIDA, READ, mem1, 8, GADDR(0), SIDA_OFFSET(0x1c0)); in test_errors()
1012 rv = ERR_MOP(t.vcpu, SIDA, WRITE, mem1, 8, GADDR(0), SIDA_OFFSET(0x1c0)); in test_errors()
1016 kvm_vm_free(t.kvm_vm); in test_errors()
1021 struct test_default t = test_default_init(guest_idle); in test_errors_cmpxchg() local
1025 HOST_SYNC(t.vcpu, STAGE_INITED); in test_errors_cmpxchg()
1032 rv = ERR_MOP(t.vm, ABSOLUTE, CMPXCHG, mem1, i, GADDR_V(mem1), in test_errors_cmpxchg()
1038 rv = ERR_MOP(t.vm, ABSOLUTE, CMPXCHG, mem1, i, GADDR((void *)~0xfffUL), in test_errors_cmpxchg()
1043 rv = ERR_MOP(t.vm, ABSOLUTE, CMPXCHG, mem1, i, GADDR_V(mem1 + 1), in test_errors_cmpxchg()
1049 kvm_vm_free(t.kvm_vm); in test_errors_cmpxchg()