/kvm-unit-tests/x86/ |
H A D | svm_tests.c | 40 static void null_test(struct svm_test *test) in null_test() argument 44 static bool null_check(struct svm_test *test) in null_check() argument 49 static void prepare_no_vmrun_int(struct svm_test *test) in prepare_no_vmrun_int() argument 54 static bool check_no_vmrun_int(struct svm_test *test) in check_no_vmrun_int() argument 59 static void test_vmrun(struct svm_test *test) in test_vmrun() argument 64 static bool check_vmrun(struct svm_test *test) in check_vmrun() argument 69 static void prepare_rsm_intercept(struct svm_test *test) in prepare_rsm_intercept() argument 71 default_prepare(test); in prepare_rsm_intercept() 76 static void test_rsm_intercept(struct svm_test *test) in test_rsm_intercept() argument 81 static bool check_rsm_intercept(struct svm_test *test) in check_rsm_intercept() argument [all …]
|
H A D | smap.c | 9 volatile unsigned test; variable 20 save = test; in do_pf_tss() 56 invlpg(&test); in init_test() 57 invlpg(&USER_VAR(test)); in init_test() 63 test = 0x99; in check_smap_nowp() 65 *get_pte(phys_to_virt(read_cr3()), USER_ADDR(test)) &= ~PT_WRITABLE_MASK; in check_smap_nowp() 73 USER_VAR(test) = 0x99; in check_smap_nowp() 81 (void)USER_VAR(test); in check_smap_nowp() 86 *get_pte(phys_to_virt(read_cr3()), USER_ADDR(test)) |= PT_WRITABLE_MASK; in check_smap_nowp() 131 test = 42; in main() [all …]
|
H A D | pks.c | 14 volatile unsigned test; variable 31 save = test; in do_pf_tss() 58 invlpg(&test); in init_test() 59 invlpg(&SUPER_VAR(test)); in init_test() 102 SUPER_VAR(test) = 21; in main() 103 report(pf_count == 1 && test == 21 && save == 0, in main() 109 SUPER_VAR(test) = 22; in main() 110 report(pf_count == 1 && test == 22 && save == 21, in main() 116 SUPER_VAR(test) = 23; in main() 117 report(pf_count == 1 && test == 23 && save == 22, in main() [all …]
|
H A D | pku.c | 14 volatile unsigned test; variable 30 save = test; in do_pf_tss() 57 invlpg(&test); in init_test() 58 invlpg(&USER_VAR(test)); in init_test() 99 test = 21; in main() 100 report(pf_count == 0 && test == 21, in main() 106 test = 22; in main() 107 report(pf_count == 0 && test == 22, in main() 113 test = 23; in main() 114 report(pf_count == 0 && test == 23, in main() [all …]
|
H A D | svm_npt.c | 8 static void null_test(struct svm_test *test) in null_test() argument 12 static void npt_np_prepare(struct svm_test *test) in npt_np_prepare() argument 22 static void npt_np_test(struct svm_test *test) in npt_np_test() argument 27 static bool npt_np_check(struct svm_test *test) in npt_np_check() argument 37 static void npt_nx_prepare(struct svm_test *test) in npt_nx_prepare() argument 41 test->scratch = rdmsr(MSR_EFER); in npt_nx_prepare() 42 wrmsr(MSR_EFER, test->scratch | EFER_NX); in npt_nx_prepare() 52 static bool npt_nx_check(struct svm_test *test) in npt_nx_check() argument 56 wrmsr(MSR_EFER, test->scratch); in npt_nx_check() 64 static void npt_us_prepare(struct svm_test *test) in npt_us_prepare() argument [all …]
|
H A D | svm.c | 82 void default_prepare(struct svm_test *test) in default_prepare() argument 87 void default_prepare_gif_clear(struct svm_test *test) in default_prepare_gif_clear() argument 91 bool default_finished(struct svm_test *test) in default_finished() argument 106 int get_test_stage(struct svm_test *test) in get_test_stage() argument 109 return test->scratch; in get_test_stage() 112 void set_test_stage(struct svm_test *test, int s) in set_test_stage() argument 115 test->scratch = s; in set_test_stage() 119 void inc_test_stage(struct svm_test *test) in inc_test_stage() argument 122 test->scratch++; in inc_test_stage() 147 static void test_thunk(struct svm_test *test) in test_thunk() argument [all …]
|
H A D | vmexit.c | 13 struct test { struct 18 bool (*next)(struct test *); argument 345 static bool pci_next(struct test *test, unsigned long addr, bool io) in pci_next() argument 351 test->func = NULL; in pci_next() 355 iowriteb(addr + offsetof(struct pci_test_dev_hdr, test), in pci_next() 361 test->func = io ? pci_io_testb : pci_mem_testb; in pci_next() 364 test->func = io ? pci_io_testw : pci_mem_testw; in pci_next() 367 test->func = io ? pci_io_testl : pci_mem_testl; in pci_next() 370 /* Reset index for purposes of the next test */ in pci_next() 372 test->func = NULL; in pci_next() [all …]
|
H A D | README | 5 calls the 'main' function of the individual test. Tests use a qemu virtual 6 test device, named testdev, for services like printing, exiting, querying 9 Examples of a test invocation: 10 These invocations run the msr test case and outputs to stdio. 39 kvmclock_test: test of wallclock, monotonic cycle and performance of kvmclock 40 pcid: basic functionality test of PCID/INVPCID feature 44 the unit-test is done, the exit status of qemu is 1, different from the
|
H A D | taskswitch2.c | 121 /* test that int $2 triggers task gate */ in test_kernel_mode_int() 129 /* test that external NMI triggers task gate */ in test_kernel_mode_int() 138 /* test that external interrupt triggesr task gate */ in test_kernel_mode_int() 149 /* test that HW exception triggesr task gate */ in test_kernel_mode_int() 157 /* test if call HW exception DE by int $0 triggers task gate */ in test_kernel_mode_int() 165 /* test if HW exception OF triggers task gate */ in test_kernel_mode_int() 173 /* test if HW exception BP triggers task gate */ in test_kernel_mode_int() 182 * test that PF triggers task gate and error code is placed on in test_kernel_mode_int() 197 /* test that calling a task by lcall works */ in test_gdt_task_gate() 212 /* test that calling a task by ljmp works */ in test_gdt_task_gate() [all …]
|
H A D | pcid.c | 1 /* Basic PCID & INVPCID functionality test */ 31 report(passed, "Test on PCID when enabled"); in test_pcid_enabled() 46 report(passed, "Test on PCID when disabled"); in test_pcid_disabled() 92 report(passed, "Test on INVPCID when enabled"); in test_invpcid_enabled() 107 report(passed, "Test on INVPCID when disabled"); in test_invpcid_disabled()
|
H A D | vmx.c | 3 * This is a framework to test nested VMX for KVM, which 4 * started as a project of GSoC 2013. All test cases should 8 * How to write test cases? 9 * Add callbacks of test suite in variant "vmx_tests". You can 11 * 1. init function used for initializing test suite 18 * If no special function is needed for a test suite, use 23 * Currently, vmx test framework only set up one VCPU and one 24 * concurrent guest test environment with same paging for L2 and 438 * Test with two values to candy-stripe the 5 flags stored/loaded by in test_vmread_vmwrite_pf() 743 "test vmclear flush (current VMCS)"); in test_vmclear_flushing() [all …]
|
/kvm-unit-tests/docs/ |
H A D | unittests.txt | 5 test cases by specifying an executable (target image) under the <arch>/ 7 provide multiple test cases by being run with different host configurations 18 Each unit test is defined with a [unit-test-name] line, followed by 19 a set of parameters that control how the test case is run. The name is 22 Parameters appear on their own lines under the test name, and have a 27 Note! Some parameters like smp and extra_params modify how a test is run, 29 test is run. 42 the test to the specified arch. By default, the test will run on any 48 the test to the specified machine. By default, the test will run on 56 Optional, the number of processors created in the machine to run the test. [all …]
|
/kvm-unit-tests/lib/ |
H A D | pci-testdev.c | 2 * QEMU "pci-testdev" PCI test device 98 static bool pci_testdev_one(struct pci_test_dev_hdr *test, in pci_testdev_one() argument 107 ops->io_writeb(test_nr, &test->test); in pci_testdev_one() 108 count = ops->io_readl(&test->count); in pci_testdev_one() 112 width = ops->io_readb(&test->width); in pci_testdev_one() 116 sig = ops->io_readl(&test->data); in pci_testdev_one() 117 off = ops->io_readl(&test->offset); in pci_testdev_one() 121 case 1: ops->io_writeb(sig, (void *)test + off); break; in pci_testdev_one() 122 case 2: ops->io_writew(sig, (void *)test + off); break; in pci_testdev_one() 123 case 4: ops->io_writel(sig, (void *)test + off); break; in pci_testdev_one() [all …]
|
/kvm-unit-tests/ |
H A D | README | 9 This directory contains sources for a KVM test suite. 11 To create the test images do: 16 in this directory. Test images are created in ./ARCH/\*.flat 48 (send tests/some-test somewhere) 50 ./some-test 53 each as a standalone test. 59 invoke the test: 89 The test case may need specific runtime configurations, for 94 The configuration file also contain the groups (if any) each test belong 98 # Unit test inputs [all …]
|
H A D | README.md | 9 This directory contains sources for a KVM test suite. 11 To create the test images do: 16 in this directory. Test images are created in ./ARCH/\*.flat 48 (send tests/some-test somewhere) 50 ./some-test 53 each as a standalone test. 59 invoke the test: 89 The test case may need specific runtime configurations, for 94 The configuration file also contain the groups (if any) each test belong 98 # Unit test inputs [all …]
|
H A D | .gitlab-ci.yml | 8 # because the test logs are important to help diagnose failures. 43 pci-test 103 pci-test 139 pci-test pmu-cycle-counter gicv2-ipi gicv2-mmio gicv3-ipi gicv2-active 190 - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env 191 - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh 203 - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env 204 - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh 218 - printf "FOO=foo\nBAR=bar\nBAZ=baz\nMVENDORID=0\nMARCHID=0\nMIMPID=0\n" >test-env 219 - ACCEL=tcg KVM_UNIT_TESTS_ENV=test-env ./run_tests.sh [all …]
|
/kvm-unit-tests/s390x/ |
H A D | sclp.c | 55 * Perform one test at the given address, optionally using the SCCB template, 59 * should be copied to the test address, and should be 0 when the test 72 /* Copy the template to the test address if needed */ in test_one_sccb() 113 * template that need to be copied to the actual test address. In many cases 128 * Test SCCB lengths < 8. 142 * Test SCCBs that are not 64-bit aligned. 155 * Test SCCBs whose address is in the lowcore or prefix area. 182 * do), this will be a read-only test. in test_sccb_prefix() 206 * Test SCCBs that are above 2GB. If outside of memory, an addressing 212 uintptr_t a[33 * 4 * 2 + 2]; /* for the list of addresses to test */ in test_sccb_high() [all …]
|
H A D | selftest-migration.c | 5 * This is just a very simple test that is intended to stress the migration 6 * support in the test harness. This could be expanded to test more guest 7 * library code, but architecture-specific tests should be used to test
|
H A D | exittime.c | 30 /* nops don't trap into the hypervisor, so let's test them for reference */ in test_nop() 180 struct test { struct 184 * When non-null, will be called once before running the test loop. argument 235 static void report_iteration_result(struct test const* test, struct test_result const* test_result) in report_iteration_result() argument 237 uint64_t total = tod_to_ns(normalize_iters(test_result->total, test->iters)), in report_iteration_result() 238 best = tod_to_ns(normalize_iters(test_result->best, test->iters)), in report_iteration_result() 239 average = tod_to_ns(normalize_iters(test_result->average, test->iters)), in report_iteration_result() 240 worst = tod_to_ns(normalize_iters(test_result->worst, test->iters)); in report_iteration_result() 255 struct test const *current_test; in main()
|
/kvm-unit-tests/arm/ |
H A D | unittests.cfg | 11 # Test that the configured number of processors (smp = <num>), and 21 # Test vector setup and exception handling (kernel mode). 27 # Test vector setup and exception handling (user mode). 33 # Test SMP support 40 # Test PCI emulation 41 [pci-test] 42 file = pci-test.flat 45 # Test PMU support 111 # Test PMU support (TCG) with -icount IPC=1 118 # Test PMU support (TCG) with -icount IPC=256 [all …]
|
H A D | micro-bench.c | 4 * This test provides support for quantifying the cost of micro level 253 * We use a 10msec timer to test the latency of PPI, in timer_post() 270 * FIXME: We need an MMIO address that we can safely read to test in mmio_read_user_prep() 271 * exits to userspace. Ideally, the test-dev would provide us this in mmio_read_user_prep() 274 * this address (and the future test-dev address) from the devicetree, in mmio_read_user_prep() 335 static void loop_test(struct exit_test *test) in loop_test() argument 341 if (test->prep) { in loop_test() 342 if(!test->prep()) { in loop_test() 343 printf("%s test skipped\n", test->name); in loop_test() 352 while (ntimes < test->times) { in loop_test() [all …]
|
H A D | pci-test.c | 2 * PCI bus operation test 28 report_skip("No PCI test device"); in main() 30 report(ret >= NR_TESTS, "PCI test device passed %d/%d tests", in main()
|
/kvm-unit-tests/common/ |
H A D | selftest-migration.c | 5 * This is just a very simple test that is intended to stress the migration 6 * support in the test harness. This could be expanded to test more guest 7 * library code, but architecture-specific tests should be used to test
|
/kvm-unit-tests/powerpc/ |
H A D | selftest-migration.c | 5 * This is just a very simple test that is intended to stress the migration 6 * support in the test harness. This could be expanded to test more guest 7 * library code, but architecture-specific tests should be used to test
|
/kvm-unit-tests/x86/efi/ |
H A D | README.md | 5 This dir provides code to build kvm-unit-tests test cases and run them under 12 - [UEFI firmware](https://github.com/tianocore/edk2): to run test cases in QEMU 21 ### Run test cases with UEFI 23 To run a test case with UEFI:
|