kvm-unit-tests is designed to be run with QEMU as the virtual machine monitor. It relies on devices emulated by QEMU (like isa-debug-exit or testdev) and it makes certain assumptions based on the implicit QEMU virtual environment configuration (like the serial base address). kvmtool [1] is a lightweight virtual machine monitor for running KVM guests. kvmtool has reduced complexity compared to QEMU and is easily hackable. This patch series aims to make it possible to run kvm-unit-tests using kvmtool on the arm and arm64 architectures, with two caveats: (1) When terminating a test, the userspace process won't exit with an exit code that signals the success or failure of the test. Output from the test can still be parsed to determine the outcome of the test. (2) kvmtool has been designed to work with a linux guest and it automatically generates the command line arguments for a Linux kernel. This causes the arm/arm64 selftest and gic tests to fail because those tests are very specific with regards to the command line arguments that are provided by the virtual machine manager. With regards to (2), a patch was posted that seeks too eliminate this behavior for kvmtool [2]. The run scripts haven't been modified. To run a test under kvmtool, one needs to launch kvmtool manually. For example, to run the timer test the following command can be used: lkvm run -c 1 --console=serial -k timer.flat. Changes in v2: * Generate lib/config.h when configuring kvm-unit-tests; arm/arm64 uses it to get the UART address. * Added --vmm configure option for arm/arm64 which will set the UART address in lib/config.h when the tests are run under QEMU or kvmtool. * Renamed psci_sys_reset() to psci_system_reset(). * Dropped patches that allowed a test to ignore unexpected command line arguments. Summary: * Patches 1, 2 and 3 add support for configuring kvm-unit-tests on arm and arm64 to use the ns16550a UART emulated by kvmtool. * Patches 4 and 5 provide an alternative mechanism for terminating the virtual machine by using PSCI. [1] https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git/ [2] https://www.spinics.net/lists/kvm-arm/msg34352.html Alexandru Elisei (5): lib: arm: Use UART address from generated config.h configure: arm/arm64: Add --vmm option with no effect lib: arm: Use ns16550a UART when --vmm=kvmtool lib: arm: Implement PSCI SYSTEM_OFF in psci_system_off() lib: arm: Fallback to psci_system_off() in exit() configure | 31 +++++++++++++++++++++++++++++++ Makefile | 2 +- lib/arm/asm/psci.h | 3 ++- lib/arm/io.c | 34 ++++++++++++++++++++++------------ lib/arm/psci.c | 8 +++++++- .gitignore | 1 + 6 files changed, 64 insertions(+), 15 deletions(-) -- 2.17.0 _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/mailman/listinfo/kvmarm