- Jul 16, 2021
-
-
Thomas Huth authored
The support for "snippets" (nested guest binaries) that has been added recently to the s390x folder broke the out-of-tree compilation. We have to make sure that the snippet folder is created in the build directory, too, and that linker script is taken from the source folder. While we're at it, switch the gitlab-CI cross compiler job to use out-of-tree builds, too, so that this does not happen so easily again. We're still testing in-tree s390x builds with the native "s390x-kvm" job on the s390x host, so we now test both, in-tree and out-of-tree builds. Fixes: 2f6fdb4a ("s390x: snippets: Add snippet compilation") Signed-off-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20210716105219.1201997-1-thuth@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
The MSR permission bitmap is two pages long. Therefore, the first test in test_msrpm_iopm_bitmap_addrs should actually pass. The problem is that KVM tries to merge the L1 MSR permission bitmap with its own at VMRUN time, fails to map the address of the L1 MSR permission bitmap, and fails. Thus remove the bogus test, which is failing on QEMU. Reported-by:
Lara Lazier <laramglazier@gmail.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Thomas Huth authored
Homebrew stopped working for the Catalina-based images. After updating to Big Sur and adding an explicit "brew update", the pipelines go green again. Signed-off-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20210716074616.1176282-1-thuth@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jul 15, 2021
-
-
Andrew Jones authored
Miscellaneous Bash improvements See merge request kvm-unit-tests/kvm-unit-tests!14
-
- Jul 14, 2021
-
-
The backticks are considered as bad style these days, e.g. when checking scripts with https://www.shellcheck.net/ ... let's use the modern $() syntax instead. Signed-off-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
- Jul 13, 2021
-
-
The very fact that QEMU drops the deprecation warning while running is enough to confuse the its-migration test into failing. The boolean options server and wait have accepted the long form options for a long time. Tested-by:
Zenghui Yu <yuzenghui@huawei.com> Reviewed-by:
Eric Auger <eric.auger@redhat.com> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Cc: Shashi Mallela <shashi.mallela@linaro.org> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
- Jul 07, 2021
-
-
Paolo Bonzini authored
s390x-pull-2021-07-07 See merge request kvm-unit-tests/kvm-unit-tests!13
-
Janosch Frank authored
When I added the backtrace support I forgot to remove the PGM report. Signed-off-by:
Janosch Frank <frankja@linux.ibm.com> Reviewed-by:
Cornelia Huck <cohuck@redhat.com>
-
Janosch Frank authored
For debugging it helps if you know if the PGM happened while being in SIE or not. Signed-off-by:
Janosch Frank <frankja@linux.ibm.com> Reviewed-by:
Cornelia Huck <cohuck@redhat.com>
-
Janosch Frank authored
The struct is getting longer, let's add offset comments so we know where we change things when we add struct members. Signed-off-by:
Janosch Frank <frankja@linux.ibm.com> Reviewed-by:
Cornelia Huck <cohuck@redhat.com>
-
- Jul 05, 2021
-
-
Janosch Frank authored
Let's only use the uint*_t types. Signed-off-by:
Janosch Frank <frankja@linux.ibm.com> Reviewed-by:
Cornelia Huck <cohuck@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com>
-
Janosch Frank authored
arch_def.h is needed for struct psw. stdint.h is needed for the uint*_t types. Signed-off-by:
Janosch Frank <frankja@linux.ibm.com> Reviewed-by:
Cornelia Huck <cohuck@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com>
-
Janosch Frank authored
Let's also check the PEI values to make sure our VSIE implementation is correct. Signed-off-by:
Janosch Frank <frankja@linux.ibm.com> Acked-by:
Thomas Huth <thuth@redhat.com>
-
Steffen Eiden authored
This patch provides the necessary make targets to properly compile snippets and link them into their associated host. To define the guest-host definition, we use the make-feature `SECONDEXPANSION` in combination with `Target specific Variable Values`. The variable `snippets` has different values depending on the current target. This enables us to define which snippets (=guests) belong to which hosts. Furthermore, using the second-expansion, we can use `snippets` in the perquisites of the host's `%.elf` rule, which otherwise would be not set. Signed-off-by:
Steffen Eiden <seiden@linux.ibm.com> Acked-by:
Thomas Huth <thuth@redhat.com> Acked-by:
Janosch Frank <frankja@linux.ibm.com>
-
Janosch Frank authored
Snippets are small guests which can be run under a unit test that implements a simple hypervisor. They can be written in C or assembly. The C code needs a linker script and a start assembly file that jumps to main to work properly. So let's add that as well as a gitignore entry for the new files. Signed-off-by:
Janosch Frank <frankja@linux.ibm.com> Reviewed-by:
Thomas Huth <thuth@redhat.com>
-
- Jun 30, 2021
-
-
Andrew Jones authored
configure: arm: Update kvmtool UART address See merge request kvm-unit-tests/kvm-unit-tests!12
-
- Jun 29, 2021
-
-
kvmtool commit 45b4968e0de1 ("hw/serial: ARM/arm64: Use MMIO at higher addresses") changed the UART address from 0x3f8 to 0x1000000. Update the UART early address accordingly when kvm-unit-tests is configured with --target=kvmtool. Users of older kvmtool versions can still enjoy having a working early UART by configuring kvm-unit-tests with --earlycon=uart,mmio,0x3f8. Note that in this case --target=kvmtool is still recommended because it enables all erratas. Signed-off-by:
Alexandru Elisei <alexandru.elisei@arm.com> Signed-off-by:
Andrew Jones <drjones@redhat.com>
-
- Jun 25, 2021
-
-
Paolo Bonzini authored
-
Sean Christopherson authored
Expand vmx_cr_load_test() to verify that KVM correclty handles toggling L1's CR4.LA57 on nested VM-Exit. LA57 can only be toggled in isolation via VM-Exit, i.e. be the lone bit the causes a MMU role change, because MOV CR4 #GPs if LA57 is changed while long mode is active. Test both nested EPT and shadow paging (for L2); the latter will also toggle KVM's guest_mode bit in the MMU role due to L1 and L2 sharing an MMU context, but it obviously shouldn't break. Signed-off-by:
Sean Christopherson <seanjc@google.com> Message-Id: <20210622211124.3698119-1-seanjc@google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Sean Christopherson authored
Add a test to verify that KVM generates the correct #NPF and PFEC when host and guest EFER.NX and CR4.SMEP values diverge, and that KVM correctly detects reserved bits in the first place. Signed-off-by:
Sean Christopherson <seanjc@google.com> Message-Id: <20210622210047.3691840-13-seanjc@google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Sean Christopherson authored
Add a GBPAGES CPUID macro for a future NPT test and reorganize the entries to be explicitly Basic vs. Extended, with a hint that Basic leafs come from Intel and Extended leafs come from AMD. Organizing by Intel vs. AMD is at best misleading, e.g. if both support a feature, and at worst flat out wrong, e.g. AMD defined NX and LM (not sure about RDPRU, but avoiding such questions is the whole point of organizing by type). Signed-off-by:
Sean Christopherson <seanjc@google.com> Message-Id: <20210622210047.3691840-12-seanjc@google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Sean Christopherson authored
Let tests opt out of setting PT_USER_MASK so that they can set CR4.SMEP and/or CR4.SMAP without having to manually modify all PTEs, which is beyond painful. Keep user pages the default to avoid having to update existing tests. Signed-off-by:
Sean Christopherson <seanjc@google.com> Message-Id: <20210622210047.3691840-11-seanjc@google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Sean Christopherson authored
Add an inner __setup_vm() that takes an opaque param and passes said param along to setup_mmu(). x86 will use the param to configure its page tables for kernel vs. user so that tests that want to enable SMEP (fault if kernel executes user page) can do so without resorting to hacks and without breaking tests that need user pages, i.e. that run user code. Signed-off-by:
Sean Christopherson <seanjc@google.com> Message-Id: <20210622210047.3691840-10-seanjc@google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Sean Christopherson authored
Clear the guest's EFER.NX when testing that KVM supports the NX bit in nested NPT. The guest's EFER (and CR0 and CR4) should not affect NPT behavior in any way. Signed-off-by:
Sean Christopherson <seanjc@google.com> Message-Id: <20210622210047.3691840-9-seanjc@google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Sean Christopherson authored
Remove a bizarre modification of the guest's EFER.NX from the NPT NX test. For reasons unknown, the NPT NX test forces EFER.NX in the guest _after_ running the test. Now that the v1 infrastructure saves/restores guest EFER across the test, the motivation, whatever thay may have been, is moot because the forced EFER.NX value won't persist. Signed-off-by:
Sean Christopherson <seanjc@google.com> Message-Id: <20210622210047.3691840-8-seanjc@google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Sean Christopherson authored
Don't force EFER.NX=1 for SVM tests now that the one NPT test that needs EFER.NX=1 does its own housekeeping. Signed-off-by:
Sean Christopherson <seanjc@google.com> Message-Id: <20210622210047.3691840-7-seanjc@google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Sean Christopherson authored
Remove two of nSVM's NPT reserved bits test, a soon-to-be-added test will provide a superset of their functionality, e.g. the current tests are limited in the sense that they test a single entry and a single bit, e.g. don't test conditionally-reserved bits. The npt_rsvd test in particular is quite nasty as it subtly relies on EFER.NX=1; dropping the test will allow cleaning up the EFER.NX weirdness (it's forced for _all_ tests, presumably to get the desired PFEC.FETCH=1 for this one test). Signed-off-by:
Sean Christopherson <seanjc@google.com> Message-Id: <20210622210047.3691840-6-seanjc@google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jun 23, 2021
-
-
Thomas Huth authored
Travis-CI recently changed their policy so that builds on the non-x86 build machines are possible without consuming any credits again. We can use these systems to test compilation of the non-x86 code with Clang. Unfortunately, the qemu-system-s390x of Ubuntu 20.04 seems to be buggy, so that the s390x binaries cause that QEMU to crash. Thus we can only run the TCG tests for ppc64le and aarch64. Message-Id: <20210622135517.234801-5-thuth@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Thomas Huth authored
According to the Principles of Operation, the epsw instruction does not touch the second register if it is r0. With GCC we were lucky so far that it never tried to use r0 here, but when compiling the kvm-unit-tests with Clang, this indeed happens and leads to very weird crashes. Thus let's make sure to never use r0 for the second operand of the epsw instruction. While we're at it, also change the constraint modifier from "+" to "=" since these are only output parameters, not input. Message-Id: <20210622135517.234801-4-thuth@redhat.com> Reviewed-by:
Claudio Imbrenda <imbrenda@linux.ibm.com> Acked-by:
Janosch Frank <frankja@linux.ibm.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Thomas Huth authored
Clang does not support "-mabi=no-altivec", so let's check whether this option is supported before using it. Message-Id: <20210622135517.234801-3-thuth@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Thomas Huth authored
For certain compilers or experiments, it might be necessary to specify additional CFLAGS for the build. Let's add an option to the configure script to specify such additional compiler flags. Message-Id: <20210622135517.234801-2-thuth@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Sean Christopherson authored
Explicitly set EFER.NX in the NPT NX test instead of assuming all tests will run with EFER.NX=1, and use the test's scratch field to save/restore EFER. There is no need to force EFER.NX=1 for all tests, and a future test will verify that a #NPT occurs when EFER.NX=0 and PTE.NX=1, i.e. wants the exact opposite. Signed-off-by:
Sean Christopherson <seanjc@google.com> Message-Id: <20210622210047.3691840-5-seanjc@google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Sean Christopherson authored
Refresh the VMCB before every v1 test to fix bugs where tests neglect to initialize the VMCB and end up taking a dependency on previous tests, e.g. looking at you mode_test and next_rip. This will also allow tests to modify VMCB fields without having to do their own manual save/restore. Signed-off-by:
Sean Christopherson <seanjc@google.com> Message-Id: <20210622210047.3691840-4-seanjc@google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Sean Christopherson authored
Use PT64_NX_MASK and EFER_NX to set/clear the NX bits in the NPT tests. No functional change intended. Signed-off-by:
Sean Christopherson <seanjc@google.com> Message-Id: <20210622210047.3691840-3-seanjc@google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Sean Christopherson authored
Be kind to debuggers and include the expected and actual exit codes if VMRUN doesn't yield the expected exit reason. Signed-off-by:
Sean Christopherson <seanjc@google.com> Message-Id: <20210622210047.3691840-2-seanjc@google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Sean Christopherson authored
Skip the sub-tests for guest CR3 that rely on NPT, unsurprisingly they fail when running with NPT disabled. Alternatively, the test could be modified to poke into the legacy page tables, but obviously no one actually cares that much about shadow paging. Fixes: 6d0ecbf6 ("nSVM: Test non-MBZ reserved bits in CR3 in long mode and legacy PAE mode") Signed-off-by:
Sean Christopherson <seanjc@google.com> Message-Id: <20210422025448.3475200-1-seanjc@google.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jun 22, 2021
-
-
Lara Lazier authored
Updated cr4 so that cr4 and vmcb->save.cr4 are the same and the report statement prints out the correct cr4. Signed-off-by:
Lara Lazier <laramglazier@gmail.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20210621153925.31375-1-laramglazier@gmail.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
s390x-pull-2021-22-06 See merge request kvm-unit-tests/kvm-unit-tests!11
-
- Jun 21, 2021
-
-
Claudio Imbrenda authored
Simple EDAT test. Signed-off-by:
Claudio Imbrenda <imbrenda@linux.ibm.com> Acked-by:
Janosch Frank <frankja@linux.ibm.com> Message-Id: <20210611140705.553307-8-imbrenda@linux.ibm.com> Signed-off-by:
Janosch Frank <frankja@linux.ibm.com>
-
Claudio Imbrenda authored
Add support for 1M and 2G pages. Signed-off-by:
Claudio Imbrenda <imbrenda@linux.ibm.com> Acked-by:
Janosch Frank <frankja@de.ibm.com> Message-Id: <20210611140705.553307-7-imbrenda@linux.ibm.com> Signed-off-by:
Janosch Frank <frankja@linux.ibm.com>
-