- 19 Oct, 2020 2 commits
-
-
Krish Sadhukhan authored
According to section "CR3" in APM vol. 2, the non-MBZ reserved bits in CR3 need to be set by software as follows: "Reserved Bits. Reserved fields should be cleared to 0 by software when writing CR3." But experiments show that consistency checking in SVM ignores these non-MBZ-reserved bits in CR3, meaning they can be set to 1 also. However, setting them to 1 may cause guest crashes in some modes and in bare metal environments. Hence, this test induces an #NPF by clearing the "P" bit in the highest level page table, when testing the 1-setting of these bits. Inducing an #NPF causes the guest to exit to userspace before any guest instruction is executed thus avoiding any crash. Signed-off-by:
Krish Sadhukhan <krish.sadhukhan@oracle.com> Message-Id: <20201006190654.32305-4-krish.sadhukhan@oracle.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Andrew Jones authored
Signed-off-by:
Andrew Jones <drjones@redhat.com> Message-Id: <20201001120224.72090-1-drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- 02 Oct, 2020 1 commit
-
-
Paolo Bonzini authored
This fixes the test once more, so that we correctly skip for example access-reduced-maxphyaddr on AMD processors. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- 01 Oct, 2020 8 commits
-
-
Sean Christopherson authored
Add an i386-only test to check that setting CR4.LA57 fails when 5-level paging is not exposed to the guest. Old versions of KVM don't intercept LA57 by default on VMX, which means a clever guest could set LA57 without it being detected by KVM. This test is i386-only because toggling CR4.LA57 in long mode is illegal, i.e. won't verify the desired KVM behavior. Signed-off-by:
Sean Christopherson <sean.j.christopherson@intel.com> Message-Id: <20200930043436.29270-1-sean.j.christopherson@intel.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Thomas Huth authored
With the new QEMU from Ubuntu Focal, we can now run some more tests with TCG. Also switch the second build job to native arm64, so we can use Clang to compile these tests to get some additional compiler test coverage. Signed-off-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20201001072234.143703-8-thuth@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Thomas Huth authored
/home/travis/build/huth/kvm-unit-tests/lib/arm64/spinlock.c:29:12: error: value size does not match register size specified by the constraint and modifier [-Werror,-Wasm-operand-widths] : "=&r" (val), "=&r" (fail) ^ /home/travis/build/huth/kvm-unit-tests/lib/arm64/spinlock.c:27:9: note: use constraint modifier "w" " mov %0, #1\n" ^~ %w0 Use the "w" modifier as suggested to fix the issue. Signed-off-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20201001072234.143703-7-thuth@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Andrew Jones <drjones@redhat.com> Tested-by:
Andrew Jones <drjones@redhat.com>
-
Thomas Huth authored
Clang complains here: arm/pmu.c:201:16: error: value size does not match register size specified by the constraint and modifier [-Werror,-Wasm-operand-widths] : [pmcr] "r" (pmcr) ^ arm/pmu.c:194:18: note: use constraint modifier "w" " msr pmcr_el0, %[pmcr]\n" ^~~~~~~ %w[pmcr] arm/pmu.c:200:17: error: value size does not match register size specified by the constraint and modifier [-Werror,-Wasm-operand-widths] : [loop] "+r" (loop) ^ arm/pmu.c:196:11: note: use constraint modifier "w" "1: subs %[loop], %[loop], #1\n" ^~~~~~~ %w[loop] arm/pmu.c:200:17: error: value size does not match register size specified by the constraint and modifier [-Werror,-Wasm-operand-widths] : [loop] "+r" (loop) ^ arm/pmu.c:196:20: note: use constrain...
-
Thomas Huth authored
KBuild abuses the asm statement to write to a file and clang chokes about these invalid asm statements. Hack it even more by fooling this is actual valid asm code. This is an adaption of the Linux kernel commit cf0c3e68aa81f992b0 which in turn is based on a patch for the U-Boot: http://patchwork.ozlabs.org/patch/375026/ Signed-off-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20201001072234.143703-5-thuth@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Andrew Jones <drjones@redhat.com> Tested-by:
Andrew Jones <drjones@redhat.com>
-
Thomas Huth authored
This test now seems to be working with the newer version of QEMU in Ubuntu Focal, so we can run it now in the Travis builds, too. Signed-off-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20201001072234.143703-4-thuth@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Thomas Huth authored
With the new QEMU from Ubuntu Focal, we can now run additional tests that were failing before. Signed-off-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20201001072234.143703-3-thuth@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Thomas Huth authored
We currently have three test jobs here: 1) gcc, in-tree build 2) gcc, out-of-tree build 3) clang, in-tree build Keeping everything in perspective, it should be sufficient to only use two build jobs for this, one in-tree with one compiler, and one out-of-tree with the other compiler. So let's re-order the jobs accordingly now. And while we're at it, make sure that all additional tests that work with the newer QEMU from Ubuntu Focal now are tested, too, and that we check all possible tests with Clang. Signed-off-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20201001072234.143703-2-thuth@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- 29 Sep, 2020 1 commit
-
-
https://gitlab.com/huth/kvm-unit-testsPaolo Bonzini authored
- s390x protected VM support - Some other small s390x improvements - Generic improvements in the scripts (better TAP13 names, nc -> ncat, ...)
-
- 28 Sep, 2020 17 commits
-
-
Paolo Bonzini authored
Add a variant of x86/access.flat that covers the emulation of guest-MAXPHYADDR < host-MAXPHYADDR. Use an old-ish CPU model because to speed up the test, as Ivy Bridge did not have SMEP and PKU. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
We need to check if the file exists, not just if it is a non-empty string. While an empty $path would have the unfortunate effect that "cat" would read from stdin, that is not an issue as you can simply not do that. Reviewed-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Andrew Jones <drjones@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Jamie Iles authored
On Red Hat 7+ and derived distributions, 'nc' is nmap-ncat, but on Debian based distributions this is often netcat-openbsd. Both are mostly compatible with the important distinction that netcat-openbsd does not shutdown the socket on stdin EOF without also passing '-N' as an argument which is not supported on nmap-ncat. This has the unfortunate consequence of hanging qmp calls so tests like aarch64 its-migration never complete. We're depending on ncat behaviour and nmap-ncat is available in all major distributions. Signed-off-by:
Jamie Iles <jamie@nuviainc.com> Message-Id: <20200921103644.1718058-1-jamie@nuviainc.com> Tested-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Mohammed Gamal authored
In case of npt=0 on kvm_amd, tests run slower and timeout, so increase the timeout. The tests then do succeed. Signed-off-by:
Mohammed Gamal <m.gamal005@gmail.com> Message-Id: <20200806124358.4928-2-mgamal@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Krish Sadhukhan authored
According to section "Canonicalization and Consistency Checks" in APM vol. 2 the following guest state combinations are illegal: * EFER.LME and CR0.PG are both set and CR4.PAE is zero. * EFER.LME and CR0.PG are both non-zero and CR0.PE is zero. * EFER.LME, CR0.PG, CR4.PAE, CS.L, and CS.D are all non-zero Signed-off-by:
Krish Sadhukhan <krish.sadhukhan@oracle.com> Reviewed-by:
Jim Mattson <jmattson@google.com> Message-Id: <20200812002935.48365-2-krish.sadhukhan@oracle.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc Hartmayer authored
Use the same test names in the TAP13 output as in the default output format. This makes the output more consistent. To achieve this, we need to pass the test name as an argument to the function `process_test_output`. Before this change: $ ./run_tests.sh PASS selftest-setup (14 tests) ... vs. $ ./run_tests.sh -t TAP version 13 ok 1 - selftest: true ok 2 - selftest: argc == 3 ... After this change: $ ./run_tests.sh PASS selftest-setup (14 tests) ... vs. $ ./run_tests.sh -t TAP version 13 ok 1 - selftest-setup: selftest: true ok 2 - selftest-setup: selftest: argc == 3 ... While at it, introduce a local variable `kernel` in `RUNTIME_log_stdout` since this makes the function easier to read. Signed-off-by:
Marc Hartmayer <mhartmay@linux.ibm.com> Message-Id: <20200825102036.17232-3-mhartmay@linux.ibm.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Cornelia Huck <cohuck@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com>
-
Marc Hartmayer authored
Since commit 6e1d3752 ("tap13: list testcases individually") the comment is no longer valid. Therefore let's remove it. Reviewed-by:
Andrew Jones <drjones@redhat.com> Reviewed-by:
Cornelia Huck <cohuck@redhat.com> Signed-off-by:
Marc Hartmayer <mhartmay@linux.ibm.com> Message-Id: <20200825102036.17232-2-mhartmay@linux.ibm.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Thomas Huth authored
Clang on s390x compains: /home/thuth/devel/kvm-unit-tests/s390x/selftest.c:39:15: error: %r0 used in an address asm volatile(" stg %0,0(%0)\n" : : "r"(-1L)); ^ <inline asm>:1:13: note: instantiated into assembly here stg %r0,0(%r0) ^ Right it is. We should not use address register 0 for STG. Thus let's use the "a" constraint to avoid register 0 here. Message-Id: <20200924111746.131633-1-thuth@redhat.com> Reviewed-by:
David Hildenbrand <david@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Marc Hartmayer authored
Add support for Protected Virtual Machine (PVM) tests. For starting a PVM guest we must be able to generate a PVM image by using the `genprotimg` tool from the s390-tools collection. This requires the ability to pass a machine-specific host-key document, so the option `--host-key-document` is added to the configure script. Reviewed-by:
Janosch Frank <frankja@linux.ibm.com> Signed-off-by:
Marc Hartmayer <mhartmay@linux.ibm.com> Message-Id: <20200923134758.19354-5-mhartmay@linux.ibm.com> Reviewed-by:
Cornelia Huck <cohuck@redhat.com> [thuth: Drop the verbose "SKIP ... (no host-key document specified)" output] Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Marc Hartmayer authored
This allows us, for example, to auto generate a new test case based on an existing test case. Reviewed-by:
Andrew Jones <drjones@redhat.com> Reviewed-by:
Cornelia Huck <cohuck@redhat.com> Reviewed-by:
David Hildenbrand <david@redhat.com> Signed-off-by:
Marc Hartmayer <mhartmay@linux.ibm.com> Message-Id: <20200923134758.19354-4-mhartmay@linux.ibm.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Marc Hartmayer authored
This is necessary to keep architecture dependent code separate from common code. Reviewed-by:
Andrew Jones <drjones@redhat.com> Reviewed-by:
Cornelia Huck <cohuck@redhat.com> Reviewed-by:
David Hildenbrand <david@redhat.com> Signed-off-by:
Marc Hartmayer <mhartmay@linux.ibm.com> Message-Id: <20200923134758.19354-3-mhartmay@linux.ibm.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Marc Hartmayer authored
It's only useful to run `cmd` in `for_each_unittest` if a test case was found. This change allows us to remove the guards from the functions `run_task` and `mkstandalone`. Reviewed-by:
Andrew Jones <drjones@redhat.com> Reviewed-by:
Cornelia Huck <cohuck@redhat.com> Reviewed-by:
David Hildenbrand <david@redhat.com> Signed-off-by:
Marc Hartmayer <mhartmay@linux.ibm.com> Message-Id: <20200923134758.19354-2-mhartmay@linux.ibm.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Thomas Huth authored
With the new QEMU from Ubuntu Focal, we can now run more tests with TCG. Message-Id: <20200924161612.144549-10-thuth@redhat.com> Acked-by:
Cornelia Huck <cohuck@redhat.com> Acked-by:
David Hildenbrand <david@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Thomas Huth authored
The newer version of QEMU in Focal should help to run more tests with TCG (which will be enabled in later patches). Message-Id: <20200924161612.144549-2-thuth@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Thomas Huth authored
Our scripts do not work with older versions of the bash, like the default Bash 3 from macOS (e.g. we use the "|&" operator which has been introduced in Bash 4.0). Add a check to make sure that we use at least version 4 to avoid that the users run into problems later. Message-Id: <20200925143852.227908-1-thuth@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Marc Hartmayer authored
Use the same test names in the TAP13 output as in the default output format. This makes the output more consistent. To achieve this, we need to pass the test name as an argument to the function `process_test_output`. Before this change: $ ./run_tests.sh PASS selftest-setup (14 tests) ... vs. $ ./run_tests.sh -t TAP version 13 ok 1 - selftest: true ok 2 - selftest: argc == 3 ... After this change: $ ./run_tests.sh PASS selftest-setup (14 tests) ... vs. $ ./run_tests.sh -t TAP version 13 ok 1 - selftest-setup: selftest: true ok 2 - selftest-setup: selftest: argc == 3 ... While at it, introduce a local variable `kernel` in `RUNTIME_log_stdout` since this makes the function easier to read. Signed-off-by:
Marc Hartmayer <mhartmay@linux.ibm.com> Message-Id: <20200825102036.17232-3-mhartmay@linux.ibm.com> Reviewed-by:
Cornelia Huck <cohuck@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Marc Hartmayer authored
Since commit 6e1d3752 ("tap13: list testcases individually") the comment is no longer valid. Therefore let's remove it. Reviewed-by:
Andrew Jones <drjones@redhat.com> Reviewed-by:
Cornelia Huck <cohuck@redhat.com> Signed-off-by:
Marc Hartmayer <mhartmay@linux.ibm.com> Message-Id: <20200825102036.17232-2-mhartmay@linux.ibm.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
- 25 Sep, 2020 2 commits
-
-
Thomas Huth authored
Travis already has an environment variable that points to the top of the checked-out source code, TRAVIS_BUILD_DIR. We can use it to avoid the guessing of the right location of the configure script. Signed-off-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20200925071147.149406-1-thuth@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
-m16 option is available only since GCC 4.9.0 [1]. That causes a build failure on centos-7 [2] that has GCC 4.8.5. Fallback to -m32 if -m16 is not available. 1. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59672 2. https://gitlab.com/bonzini/kvm-unit-tests/-/jobs/755368387 Fixes: 2616ad93 ("x86: realmode: Workaround clang issues") Reported-by:
Roman Bolshakov <r.bolshakov@yadro.com> [Commit message by Roman Bolshakov, patch redone. - Paolo] Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- 24 Sep, 2020 2 commits
-
-
Roman Bolshakov authored
clang doesn't properly support .code16gcc and generates wrong machine code [1][2][3][4]. But the test works if object file is compiled with -m16 and explicit suffixes are added for instructions. 1. https://lore.kernel.org/kvm/4d20fbce-d247-abf4-3ceb-da2c0d48fc50@redhat.com/ 2. https://lore.kernel.org/kvm/20200915155959.GF52559@SPB-NB-133.local/ 3. https://lore.kernel.org/kvm/788b7191-6987-9399-f352-2e661255157e@redhat.com/ 4. https://lore.kernel.org/kvm/20200922212507.GA11460@SPB-NB-133.local/ Suggested-by:
Thomas Huth <thuth@redhat.com> Suggested-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Roman Bolshakov <r.bolshakov@yadro.com> Message-Id: <20200924120516.77299-1-r.bolshakov@yadro.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Roman Bolshakov authored
83760814 ("configure: Check for new-enough getopt") has replaced proposed patch and doesn't introduce --getopt option in configure. Instead, `configure` and `run_tests.sh` expect proper getopt to be available in PATH. Signed-off-by:
Roman Bolshakov <r.bolshakov@yadro.com> Message-Id: <20200924100613.71136-1-r.bolshakov@yadro.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- 23 Sep, 2020 1 commit
-
-
Thomas Huth authored
The enhanced getopt is now not selected with a configure switch anymore, but by setting the PATH to the right location. Signed-off-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20200923073931.74769-1-thuth@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- 22 Sep, 2020 6 commits
-
-
Roman Bolshakov authored
.gitlab-ci.yml already has a job to build the tests with clang but it's not clear how to set it up on a personal github repo. NB, realmode test is disabled because it fails immediately after start if compiled with clang-10. Signed-off-by:
Roman Bolshakov <r.bolshakov@yadro.com> Message-Id: <20200901085056.33391-11-r.bolshakov@yadro.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Roman Bolshakov authored
jobs keyword is used throughout Travis documentation and matrix is an alias for it (according to Travis config validation): root: key matrix is an alias for jobs, using jobs At first glance it's not clear if they're the same and if jobs documentation applies to matrix. Changing keyword name should make it obvious. While at it, fix the Travis config warning: root: deprecated key sudo (The key `sudo` has no effect anymore.) Signed-off-by:
Roman Bolshakov <r.bolshakov@yadro.com> Message-Id: <20200901085056.33391-10-r.bolshakov@yadro.com> Tested-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Roman Bolshakov authored
Build the tests on macOS and test TCG. HVF doesn't work in travis. sieve tests pass but they might timeout in travis, they were left out because of that. Suggested-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Roman Bolshakov <r.bolshakov@yadro.com> Message-Id: <20200901085056.33391-9-r.bolshakov@yadro.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Roman Bolshakov authored
Pre-built cross-compilers for x86 are available in homebrew and can be used to build the tests. Cc: Cameron Esfahani <dirty@apple.com> Signed-off-by:
Roman Bolshakov <r.bolshakov@yadro.com> Message-Id: <20200901085056.33391-8-r.bolshakov@yadro.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
macOS is shipped with an old non-enhanced version of getopt and it doesn't support options used by run_tests.sh. Proper version of getopt is available from homebrew but it has to be added to PATH before invoking run_tests.sh. Halt ./configure if enhanced getopt can't be found. Based on a patch by Roman Bolshakov <r.bolshakov@yadro.com>. Cc: Cameron Esfahani <dirty@apple.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Roman Bolshakov authored
Compilation of the files fails on ARCH=i386 with i686-elf gcc because they use "%x" or "%d" format specifier that does not match the actual size of uint32_t: x86/s3.c: In function ‘main’: x86/s3.c:53:35: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘u32’ {aka ‘long unsigned int’} [-Werror=format=] 53 | printf("PM1a event registers at %x\n", fadt->pm1a_evt_blk); | ~^ ~~~~~~~~~~~~~~~~~~ | | | | | u32 {aka long unsigned int} | unsigned int | %lx Use PRIx32 instead of "x" and PRId32 instead of "d" to take into account u32_long case. Cc: Alex Bennée <alex.bennee@linaro.org> Cc: Andrew Jones <drjones@redhat.com> Cc: Cameron Esfahani <dirty@apple.com> Signed-off-by:
Roman Bolshakov <r.bolshakov@yadro.com> Message-Id: <20200901085056.33391-6-r.bolshakov@yadro.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-