Home
last modified time | relevance | path

Searched refs:TEST_ASSERT (Results 1 – 25 of 42) sorted by relevance

12

/kernel/linux/linux-5.10/tools/testing/selftests/kvm/s390x/
Dresets.c69 TEST_ASSERT(eval_reg == value, "value == 0x%lx", value); in test_one_reg()
85 TEST_ASSERT(irqs >= 0, "Could not fetch IRQs: errno %d\n", errno); in assert_noirq()
86 TEST_ASSERT(!irqs, "IRQ pending"); in assert_noirq()
96 TEST_ASSERT(!memcmp(&regs.gprs, regs_null, sizeof(regs.gprs)), "grs == 0"); in assert_clear()
99 TEST_ASSERT(!memcmp(&sregs.acrs, regs_null, sizeof(sregs.acrs)), "acrs == 0"); in assert_clear()
102 TEST_ASSERT(!memcmp(&fpu.fprs, regs_null, sizeof(fpu.fprs)), "fprs == 0"); in assert_clear()
105 TEST_ASSERT(!memcmp(sync_regs->gprs, regs_null, sizeof(sync_regs->gprs)), in assert_clear()
108 TEST_ASSERT(!memcmp(sync_regs->acrs, regs_null, sizeof(sync_regs->acrs)), in assert_clear()
111 TEST_ASSERT(!memcmp(sync_regs->vrs, regs_null, sizeof(sync_regs->vrs)), in assert_clear()
117 TEST_ASSERT(sync_regs->gprs[0] == 0xffff000000000000UL, in assert_initial_noclear()
[all …]
Dsync_regs_test.c40 TEST_ASSERT(left->reg == right->reg, \
46 TEST_ASSERT(left->reg == right->reg, \
101 TEST_ASSERT(rv < 0 && errno == EINVAL, in main()
108 TEST_ASSERT(rv < 0 && errno == EINVAL, in main()
116 TEST_ASSERT(rv < 0 && errno == EINVAL, in main()
123 TEST_ASSERT(rv < 0 && errno == EINVAL, in main()
131 TEST_ASSERT(rv == 0, "vcpu_run failed: %d\n", rv); in main()
132 TEST_ASSERT(run->exit_reason == KVM_EXIT_S390_SIEIC, in main()
136 TEST_ASSERT(run->s390_sieic.icptcode == 4 && in main()
156 TEST_ASSERT(rv == 0, "vcpu_run failed: %d\n", rv); in main()
[all …]
Dmemop.c67 TEST_ASSERT(run->exit_reason == KVM_EXIT_S390_SIEIC, in main()
83 TEST_ASSERT(!memcmp(mem1, mem2, maxsize), in main()
94 TEST_ASSERT(rv == -1 && errno == E2BIG, "ioctl allows insane sizes"); in main()
104 TEST_ASSERT(rv == -1 && (errno == EINVAL || errno == ENOMEM), in main()
115 TEST_ASSERT(rv == -1 && errno == EINVAL, "ioctl allows all flags"); in main()
125 TEST_ASSERT(rv == -1 && errno == EINVAL, "ioctl allows bad operations"); in main()
135 TEST_ASSERT(rv > 0, "ioctl does not report bad guest memory access"); in main()
145 TEST_ASSERT(rv == -1 && errno == EFAULT, in main()
159 TEST_ASSERT(rv == -1 && errno == EINVAL, "ioctl allows ARs > 15"); in main()
/kernel/linux/linux-5.10/tools/testing/selftests/kvm/lib/
Dkvm_util.c27 TEST_ASSERT(size != 0 && !(size & (size - 1)), in align()
58 TEST_ASSERT(ret >= 0, "KVM_CHECK_EXTENSION IOCTL failed,\n" in kvm_check_cap()
83 TEST_ASSERT(ret == 0, "KVM_ENABLE_CAP IOCTL failed,\n" in vm_enable_cap()
108 TEST_ASSERT(vcpu, "cannot find vcpu %d", vcpu_id); in vcpu_enable_cap()
111 TEST_ASSERT(!r, "KVM_ENABLE_CAP vCPU ioctl failed,\n" in vcpu_enable_cap()
129 TEST_ASSERT(vm->fd >= 0, "KVM_CREATE_VM ioctl failed, " in vm_open()
191 TEST_ASSERT(vm != NULL, "Insufficient Memory"); in vm_create()
232 TEST_ASSERT(vm->va_bits == 48 || vm->va_bits == 57, in vm_create()
297 TEST_ASSERT(ret == 0, "KVM_SET_USER_MEMORY_REGION IOCTL failed,\n" in kvm_vm_restart()
314 TEST_ASSERT(ret == 0, "%s: KVM_GET_DIRTY_LOG failed: %s", in kvm_vm_get_dirty_log()
[all …]
Delf.c23 TEST_ASSERT(fd >= 0, "Failed to open ELF file,\n" in elfhdr_get()
36 TEST_ASSERT((ident[EI_MAG0] == ELFMAG0) && (ident[EI_MAG1] == ELFMAG1) in elfhdr_get()
45 TEST_ASSERT(ident[EI_CLASS] == ELFCLASS64, in elfhdr_get()
52 TEST_ASSERT(((BYTE_ORDER == LITTLE_ENDIAN) in elfhdr_get()
67 TEST_ASSERT(ident[EI_VERSION] == EV_CURRENT, in elfhdr_get()
81 TEST_ASSERT(offset_rv == 0, "Seek to ELF header failed,\n" in elfhdr_get()
84 TEST_ASSERT(hdrp->e_phentsize == sizeof(Elf64_Phdr), in elfhdr_get()
89 TEST_ASSERT(hdrp->e_shentsize == sizeof(Elf64_Shdr), in elfhdr_get()
123 TEST_ASSERT(fd >= 0, "Failed to open ELF file,\n" in kvm_vm_elf_load()
142 TEST_ASSERT(offset_rv == offset, in kvm_vm_elf_load()
[all …]
Dio.c51 TEST_ASSERT(count >= 0, "Unexpected count, count: %li", count); in test_write()
58 TEST_ASSERT(errno == EAGAIN || errno == EINTR, in test_write()
70 TEST_ASSERT(rc >= 0, "Unexpected ret from write,\n" in test_write()
128 TEST_ASSERT(count >= 0, "Unexpected count, count: %li", count); in test_read()
135 TEST_ASSERT(errno == EAGAIN || errno == EINTR, in test_read()
147 TEST_ASSERT(rc > 0, "Unexpected ret from read,\n" in test_read()
Dtest_util.c25 TEST_ASSERT(size && isdigit(size[0]), "Need at least one digit in '%s'", size); in parse_size()
29 TEST_ASSERT(base != ULLONG_MAX, "Overflow parsing size!"); in parse_size()
49 TEST_ASSERT(false, "Unknown size letter %c", *scale); in parse_size()
52 TEST_ASSERT((base << shift) >> shift == base, "Overflow scaling size!"); in parse_size()
/kernel/linux/linux-5.10/tools/testing/selftests/kvm/x86_64/
Dsync_regs_test.c43 TEST_ASSERT(left->reg == right->reg, \ in compare_regs()
110 TEST_ASSERT(rv < 0 && errno == EINVAL, in main()
117 TEST_ASSERT(rv < 0 && errno == EINVAL, in main()
125 TEST_ASSERT(rv < 0 && errno == EINVAL, in main()
132 TEST_ASSERT(rv < 0 && errno == EINVAL, in main()
141 TEST_ASSERT(run->exit_reason == KVM_EXIT_IO, in main()
163 TEST_ASSERT(run->exit_reason == KVM_EXIT_IO, in main()
167 TEST_ASSERT(run->s.regs.regs.rbx == 0xBAD1DEA + 1, in main()
170 TEST_ASSERT(run->s.regs.sregs.apic_base == 1 << 11, in main()
190 TEST_ASSERT(run->exit_reason == KVM_EXIT_IO, in main()
[all …]
Dvmx_dirty_log_test.c121 TEST_ASSERT(run->exit_reason == KVM_EXIT_IO, in main()
138 TEST_ASSERT(test_bit(0, bmap), "Page 0 incorrectly reported clean\n"); in main()
139 TEST_ASSERT(host_test_mem[0] == 1, "Page 0 not written by guest\n"); in main()
141 TEST_ASSERT(!test_bit(0, bmap), "Page 0 incorrectly reported dirty\n"); in main()
142 TEST_ASSERT(host_test_mem[0] == 0xaaaaaaaaaaaaaaaaULL, "Page 0 written by guest\n"); in main()
145 TEST_ASSERT(!test_bit(1, bmap), "Page 1 incorrectly reported dirty\n"); in main()
146 TEST_ASSERT(host_test_mem[4096 / 8] == 0xaaaaaaaaaaaaaaaaULL, "Page 1 written by guest\n"); in main()
147 TEST_ASSERT(!test_bit(2, bmap), "Page 2 incorrectly reported dirty\n"); in main()
148 TEST_ASSERT(host_test_mem[8192 / 8] == 0xaaaaaaaaaaaaaaaaULL, "Page 2 written by guest\n"); in main()
Dhyperv_cpuid.c58 TEST_ASSERT(hv_cpuid_entries->nent == nent, in test_hv_cpuid()
66 TEST_ASSERT((entry->function >= 0x40000000) && in test_hv_cpuid()
71 TEST_ASSERT(evmcs_enabled || (entry->function != 0x4000000A), in test_hv_cpuid()
74 TEST_ASSERT(entry->index == 0, in test_hv_cpuid()
77 TEST_ASSERT(entry->flags == 0, in test_hv_cpuid()
80 TEST_ASSERT(!entry->padding[0] && !entry->padding[1] && in test_hv_cpuid()
87 TEST_ASSERT(entry->eax == test_val, in test_hv_cpuid()
96 TEST_ASSERT(!!test_val == !smt_possible(), in test_hv_cpuid()
120 TEST_ASSERT(ret == -1 && errno == E2BIG, in test_hv_cpuid_e2big()
Duser_msr_test.c161 TEST_ASSERT(run->msr.reason == KVM_MSR_EXIT_REASON_FILTER, in handle_rdmsr()
166 TEST_ASSERT(run->msr.reason == KVM_MSR_EXIT_REASON_UNKNOWN, in handle_rdmsr()
177 TEST_ASSERT(run->msr.data == 0x1234, in handle_wrmsr()
179 TEST_ASSERT(run->msr.reason == KVM_MSR_EXIT_REASON_FILTER, in handle_wrmsr()
184 TEST_ASSERT(run->msr.data == 0x1234, in handle_wrmsr()
186 TEST_ASSERT(run->msr.reason == KVM_MSR_EXIT_REASON_UNKNOWN, in handle_wrmsr()
212 TEST_ASSERT(rc, "KVM_CAP_X86_USER_SPACE_MSR is available"); in main()
216 TEST_ASSERT(rc, "KVM_CAP_X86_MSR_FILTER is available"); in main()
224 TEST_ASSERT(rc == 0, "vcpu_run failed: %d\n", rc); in main()
242 TEST_ASSERT(msr_reads == 4, "Handled 4 rdmsr in user space"); in main()
[all …]
Ddebug_regs.c96 TEST_ASSERT(run->exit_reason == KVM_EXIT_DEBUG && in main()
113 TEST_ASSERT(run->exit_reason == KVM_EXIT_DEBUG && in main()
136 TEST_ASSERT(run->exit_reason == KVM_EXIT_DEBUG && in main()
162 TEST_ASSERT(run->exit_reason == KVM_EXIT_DEBUG && in main()
180 TEST_ASSERT(run->exit_reason == KVM_EXIT_DEBUG && in main()
195 TEST_ASSERT(run->exit_reason == KVM_EXIT_IO, "KVM_EXIT_IO"); in main()
197 TEST_ASSERT(cmd == UCALL_DONE, "UCALL_DONE"); in main()
Dplatform_info_test.c55 TEST_ASSERT(run->exit_reason == KVM_EXIT_IO, in test_msr_platform_info_enabled()
60 TEST_ASSERT(uc.cmd == UCALL_SYNC, in test_msr_platform_info_enabled()
62 TEST_ASSERT((uc.args[1] & MSR_PLATFORM_INFO_MAX_TURBO_RATIO) == in test_msr_platform_info_enabled()
74 TEST_ASSERT(run->exit_reason == KVM_EXIT_SHUTDOWN, in test_msr_platform_info_disabled()
Dmmio_warning_test.c61 TEST_ASSERT(kvm != -1, "failed to open /dev/kvm"); in test()
63 TEST_ASSERT(kvmvm != -1, "KVM_CREATE_VM failed"); in test()
65 TEST_ASSERT(kvmcpu != -1, "KVM_CREATE_VCPU failed"); in test()
123 TEST_ASSERT(warnings_before == warnings_after, in main()
Dvmx_apic_access_test.c109 TEST_ASSERT(run->exit_reason == in main()
114 TEST_ASSERT(run->internal.suberror == in main()
120 TEST_ASSERT(run->exit_reason == KVM_EXIT_IO, in main()
137 TEST_ASSERT(false, "Unknown ucall %lu", uc.cmd); in main()
Dvmx_preemption_timer_test.c189 TEST_ASSERT(run->exit_reason == KVM_EXIT_IO, in main()
208 TEST_ASSERT(!strcmp((const char *)uc.args[0], "hello") && in main()
227 TEST_ASSERT(uc.args[2] >= uc.args[3], in main()
231 TEST_ASSERT(uc.args[4] < uc.args[5], in main()
252 TEST_ASSERT(!memcmp(&regs1, &regs2, sizeof(regs2)), in main()
/kernel/linux/linux-5.10/tools/testing/selftests/kvm/
Dset_memory_region_test.c84 TEST_ASSERT(!run->mmio.is_write, "Unexpected exit mmio write"); in vcpu_worker()
85 TEST_ASSERT(run->mmio.len == 8, in vcpu_worker()
88 TEST_ASSERT(run->mmio.phys_addr == MEM_REGION_GPA, in vcpu_worker()
105 TEST_ASSERT(!clock_gettime(CLOCK_REALTIME, &ts), in wait_for_vcpu()
109 TEST_ASSERT(!sem_timedwait(&vcpu_ready, &ts), in wait_for_vcpu()
135 TEST_ASSERT(gpa == MEM_REGION_GPA, "Failed vm_phy_pages_alloc\n"); in spawn_vm()
293 TEST_ASSERT(run->exit_reason == KVM_EXIT_SHUTDOWN || in test_delete_memory_region()
304 TEST_ASSERT(regs.rip >= final_rip_start && in test_delete_memory_region()
322 TEST_ASSERT(!ioctl(vm_get_fd(vm), KVM_SET_NR_MMU_PAGES, 64), in test_zero_memory_regions()
327 TEST_ASSERT(run->exit_reason == KVM_EXIT_INTERNAL_ERROR, in test_zero_memory_regions()
[all …]
Ddemand_paging_test.c61 TEST_ASSERT(ret == 0, "vcpu_run failed: %d\n", ret); in vcpu_worker()
63 TEST_ASSERT(false, in vcpu_worker()
161 TEST_ASSERT(r == 1, in uffd_handler_thread_fn()
269 TEST_ASSERT(guest_data_prototype, in run_test()
274 TEST_ASSERT(vcpu_threads, "Memory allocation failed"); in run_test()
281 TEST_ASSERT(uffd_handler_threads, "Memory allocation failed"); in run_test()
284 TEST_ASSERT(uffd_args, "Memory allocation failed"); in run_test()
287 TEST_ASSERT(pipefds, "Unable to allocate memory for pipefd"); in run_test()
306 TEST_ASSERT(!r, "Failed to set up pipefd"); in run_test()
348 TEST_ASSERT(r == 1, "Unable to write to pipefd"); in run_test()
[all …]
Ddirty_log_perf_test.c57 TEST_ASSERT(ret == 0, "vcpu_run failed: %d\n", ret); in vcpu_worker()
58 TEST_ASSERT(get_ucall(vm, vcpu_id, NULL) == UCALL_SYNC, in vcpu_worker()
130 TEST_ASSERT(vcpu_threads, "Memory allocation failed"); in run_test()
335 TEST_ASSERT(mode < NUM_VM_MODES, in main()
344 TEST_ASSERT(wr_fract >= 1, in main()
349 TEST_ASSERT(nr_vcpus > 0, in main()
351 TEST_ASSERT(nr_vcpus <= MAX_VCPUS, in main()
362 TEST_ASSERT(iterations >= 2, "The test should have at least two iterations"); in main()
369 TEST_ASSERT(guest_modes[i].supported, in main()
Dsteal_time.c83 TEST_ASSERT(ret == 0, "Bad GPA didn't fail"); in steal_time_init()
199 TEST_ASSERT(ret == -1 && errno == EINVAL, "Bad IPA didn't report EINVAL"); in steal_time_init()
205 TEST_ASSERT(ret == -1 && errno == EEXIST, "Set IPA twice without EEXIST"); in steal_time_init()
265 TEST_ASSERT(false, "%s at %s:%ld", (const char *)uc.args[0], in run_vcpu()
268 TEST_ASSERT(false, "Unexpected exit: %s", in run_vcpu()
317 TEST_ASSERT(stolen_time <= run_delay, in main()
329 TEST_ASSERT(run_delay >= MIN_RUN_DELAY_NS, in main()
337 TEST_ASSERT(stolen_time >= run_delay, in main()
Ddirty_log_test.c160 TEST_ASSERT(manual_caps, "MANUAL_CAPS is zero!"); in clear_log_create_vm_done()
245 TEST_ASSERT(mode->collect_dirty_pages != NULL, in log_mode_collect_dirty_pages()
274 TEST_ASSERT(ret == 0, "vcpu_run failed: %d\n", ret); in vcpu_worker()
302 TEST_ASSERT(test_bit_le(page, bmap), in vm_dirty_log_verify()
315 TEST_ASSERT(*value_ptr == iteration || in vm_dirty_log_verify()
341 TEST_ASSERT(*value_ptr <= iteration, in vm_dirty_log_verify()
579 TEST_ASSERT(mode < NUM_VM_MODES, in main()
610 TEST_ASSERT(iterations > 2, "Iterations must be greater than two"); in main()
611 TEST_ASSERT(interval > 0, "Interval must be greater than zero"); in main()
621 TEST_ASSERT(guest_modes[i].supported, in main()
Dkvm_create_max_vcpus.c58 TEST_ASSERT(!getrlimit(RLIMIT_NOFILE, &rl), "getrlimit() failed!"); in main()
73 TEST_ASSERT(!setrlimit(RLIMIT_NOFILE, &rl), "setrlimit() failed!"); in main()
85 TEST_ASSERT(kvm_max_vcpu_id >= kvm_max_vcpus, in main()
/kernel/linux/linux-5.10/tools/testing/selftests/kvm/lib/x86_64/
Dprocessor.c214 TEST_ASSERT(vm->mode == VM_MODE_PXXV48_4K, "Attempt to use " in virt_pgd_alloc()
232 TEST_ASSERT(vm->mode == VM_MODE_PXXV48_4K, "Attempt to use " in virt_pg_map()
235 TEST_ASSERT((vaddr % vm->page_size) == 0, in virt_pg_map()
239 TEST_ASSERT(sparsebit_is_set(vm->vpages_valid, in virt_pg_map()
243 TEST_ASSERT((paddr % vm->page_size) == 0, in virt_pg_map()
247 TEST_ASSERT((paddr >> vm->page_shift) <= vm->max_gfn, in virt_pg_map()
490 TEST_ASSERT(vm->mode == VM_MODE_PXXV48_4K, "Attempt to use " in addr_gva2gpa()
667 TEST_ASSERT(ret == 0, "KVM_GET_SUPPORTED_CPUID failed %d %d\n", in kvm_get_supported_cpuid()
701 TEST_ASSERT(entry, "Guest CPUID entry not found: (EAX=%x, ECX=%x).", in kvm_get_supported_cpuid_index()
726 TEST_ASSERT(vcpu != NULL, "vcpu not found, vcpuid: %u", vcpuid); in vcpu_set_cpuid()
[all …]
/kernel/linux/linux-5.10/tools/testing/selftests/kvm/lib/s390x/
Dprocessor.c22 TEST_ASSERT(vm->page_size == 4096, "Unsupported page size: 0x%x", in virt_pgd_alloc()
60 TEST_ASSERT((gva % vm->page_size) == 0, in virt_pg_map()
64 TEST_ASSERT(sparsebit_is_set(vm->vpages_valid, in virt_pg_map()
68 TEST_ASSERT((gpa % vm->page_size) == 0, in virt_pg_map()
72 TEST_ASSERT((gpa >> vm->page_shift) <= vm->max_gfn, in virt_pg_map()
99 TEST_ASSERT(vm->page_size == 4096, "Unsupported page size: 0x%x", in addr_gva2gpa()
105 TEST_ASSERT(!(entry[idx] & REGION_ENTRY_INVALID), in addr_gva2gpa()
113 TEST_ASSERT(!(entry[idx] & PAGE_INVALID), in addr_gva2gpa()
191 TEST_ASSERT(vm->page_size == 4096, "Unsupported page size: 0x%x", in vm_vcpu_add_default()
220 TEST_ASSERT(num >= 1 && num <= 5, "Unsupported number of args,\n" in vcpu_args_set()
/kernel/linux/linux-5.10/tools/testing/selftests/kvm/include/
Dtest_util.h45 #define TEST_ASSERT(e, fmt, ...) \ macro
51 TEST_ASSERT(__a == __b, \
59 TEST_ASSERT(false, fmt, ##__VA_ARGS__)

12