summaryrefslogtreecommitdiff
path: root/tests/ioctl_kvm_run.c
Commit message (Collapse)AuthorAgeFilesLines
* Add copyright headers to some files that lack themDmitry V. Levin2018-12-241-0/+7
| | | | | | We do our best to keep copyright headers up to date, yet git history provides better information on this subject and is more accurate than copyright headers.
* tests: check decoding of vcpu auxstrMasatake YAMATO2018-07-071-389/+4
| | | | | | | | | | | | | | | | | | * tests/ioctl_kvm_run_common.c: Rename from ioctl_kvm_run.c. (run_kvm): Parametrize printing of KVM_RUN ioctl with print_KVM_RUN invocation. (main): Invoke optional KVM_NO_CPUID_CALLBACK macro when the old kernel behavior is detected. * tests/Makefile.am (EXTRA_DIST): Add ioctl_kvm_run_common.c. * tests/ioctl_kvm_run.c: New file, a wrapper around ioctl_kvm_run_common.c. * ioctl_kvm_run_auxstr_vcpu.c: Likewise. * tests/gen_tests.in (ioctl_kvm_run_auxstr_vcpu): New test. * tests/pure_executables.list: Add ioctl_kvm_run_auxstr_vcpu. * tests/.gitignore: Likewise. Signed-off-by: Masatake YAMATO <yamato@redhat.com> Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
* tests: check verbose decoding of kvm ioctlPierre Marsais2018-07-071-18/+102
| | | | | | | | | | | | | * tests/ioctl_kvm_run-v.c: New file. * tests/ioctl_kvm_run.c: Include xlat.h and xlat/kvm_cpuid_flags.h. (print_kvm_segment, print_kvm_sregs, print_kvm_regs): New functions. (run_kvm): Use them. (print_cpuid_ioctl) [VERBOSE]: Print verbose ioctl decoding. * tests/gen_tests.in (ioctl_kvm_run-v): New entry. * tests/pure_executables.list: Add ioctl_kvm_run-v. * tests/.gitignore: Likewise. Signed-off-by: Pierre Marsais <pierre.marsais@lse.epita.fr>
* tests: check decoding of kvm ioctls related to struct kvm_cpuid2Pierre Marsais2018-07-071-2/+45
| | | | | | | | | * tests/ioctl_kvm_run.c [!HAVE_STRUCT_KVM_CPUID2]: Skip the test. (KVM_MAX_CPUID_ENTRIES): New macro. (print_cpuid_ioctl): New function. (main): Add tests for cpuid related ioctl. Signed-off-by: Pierre Marsais <pierre.marsais@lse.epita.fr>
* tests/ioctl_kvm_run.c: handle cpuid at the end of vcpu dentryMasatake YAMATO2018-05-021-1/+28
| | | | | | | | | | | | | | | | | | | | Since Linux 4.16, kernel appends the cpuid as suffix to the entry for a kvm vcpu in /proc/$pid/fd like: anon_inode:kvm-vcpu:0 That was anon_inode:kvm-vcpu This kernel change causes the test case failure on newer kernels. Update the test to deal with the new name as well as the old one. * tests/ioctl_kvm_run.c: Include unistd.h for using readlink(2). (vcpu_dev_should_have_cpuid): New function for detecting whether a proc entry for given fd has the cpuid suffix or not. (main): Trim vcpu_dev to remove the cpuid suffix if needed. (vcpu_dev): Remove const modifier.
* Update copyright headersDmitry V. Levin2018-02-131-1/+1
| | | | | Headers updated automatically using maint/update_copyright_years.sh script.
* tests: avoid ioctl_kvm_run test failure when built with gcc -O0Eugene Syromyatnikov2018-02-131-9/+18
| | | | | | | | | | | | | | | | | | When built with -O0, gcc (rightfully) generates function prologue, which results in writing %rbp to the stack, causing premature KVM_EXIT_MMIO. It could be possible to avoid such problems by "naked" attribute but, unfortunately, the latter is not available on x86 with older GCC. A trick suggested in [1] is used instead: assembly is moved to the global scope. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50242#c3 * tests/ioctl_kvm_run.c (code): Remove function. Add globally scoped __asm__ with the function code and its size. (code, code_size): New extern symbols declarations. (run_kvm): Remove code_size definition and initialization. Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
* tests/ioctl_kvm_run.c: add KVM_EXIT_MMIO diagnosticsEugene Syromyatnikov2018-02-131-0/+13
| | | | | | | As it has proven itself useful. * tests/ioctl_kvm_run.c (run_kvm) <case KVM_EXIT_MMIO:>: Fail on unexpected KVM_EXIT_MMIO, providing relevant diagnostics.
* tests: check decoding of KVM ioctl commandsMasatake YAMATO2017-12-041-0/+220
* tests/ioctl_kvm_run.c: New file. * tests/ioctl_kvm_run.test: New test. * tests/Makefile.am (DECODER_TESTS): Add ioctl_kvm_run.test. * tests/pure_executables.list: Add ioctl_kvm_run. * tests/.gitignore: Likewise. Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>