kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH v3 0/5] arm/arm64: Add support for running under kvmtool
@ 2019-02-04 13:44 Alexandru Elisei
  2019-02-04 13:44 ` [kvm-unit-tests PATCH v3 1/5] lib: arm: Use UART address from generated config.h Alexandru Elisei
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Alexandru Elisei @ 2019-02-04 13:44 UTC (permalink / raw)
  To: kvm; +Cc: andre.przywara, kvmarm

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. The
arm/arm64 selftest and gic tests will fail if unexpected command line
arguments are found. To get around this limitation, the test binary needs
to be loaded using the --firmware option introduced by kvmtool in commit
5e4b563d75b9 ("arm: Allow command line for firmware"). This option
suppresses the automatic kernel command line and can be used to run all
tests, not just the tests that require specific arguments.

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 --cpus 1 --console serial --firmware timer.flat.

To run the gicv3-ipi test:

lkvm run --cpus 8 --console serial --params "ipi" --irqchip gicv3 \
    --firmware gic.flat

Changes in v3:
* Updated cover letter with information about the kvmtool --firmware
  option.
* Gathered Reviewed-by tags.
* Renamed the config.h define UART_EARLY_BASE to CONFIG_UART_EARLY_BASE and
  made the necessary casts in lib/arm/io.c

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          | 32 ++++++++++++++++++++++++++++++++
 Makefile           |  2 +-
 lib/arm/asm/psci.h |  3 ++-
 lib/arm/io.c       | 41 ++++++++++++++++++++++++++---------------
 lib/arm/psci.c     |  8 +++++++-
 .gitignore         |  1 +
 6 files changed, 69 insertions(+), 18 deletions(-)

-- 
2.17.0

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-02-26  9:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-04 13:44 [kvm-unit-tests PATCH v3 0/5] arm/arm64: Add support for running under kvmtool Alexandru Elisei
2019-02-04 13:44 ` [kvm-unit-tests PATCH v3 1/5] lib: arm: Use UART address from generated config.h Alexandru Elisei
2019-02-04 14:00   ` Andrew Jones
2019-02-04 14:17     ` Alexandru Elisei
2019-02-04 14:40       ` Andrew Jones
2019-02-20 13:14         ` Alexandru Elisei
2019-02-26  9:29           ` Vladimir Murzin
2019-02-04 13:44 ` [kvm-unit-tests PATCH v3 2/5] configure: arm/arm64: Add --vmm option with no effect Alexandru Elisei
2019-02-04 13:44 ` [kvm-unit-tests PATCH v3 3/5] lib: arm: Use ns16550a UART when --vmm=kvmtool Alexandru Elisei
2019-02-04 13:44 ` [kvm-unit-tests PATCH v3 4/5] lib: arm: Implement PSCI SYSTEM_OFF in psci_system_off() Alexandru Elisei
2019-02-04 13:44 ` [kvm-unit-tests PATCH v3 5/5] lib: arm: Fallback to psci_system_off() in exit() Alexandru Elisei
2019-02-04 14:39 ` [kvm-unit-tests PATCH v3 0/5] arm/arm64: Add support for running under kvmtool Andrew Jones
2019-02-05 12:05   ` Alexandru Elisei
2019-02-05 12:38     ` Andrew Jones
2019-02-05 13:26       ` Alexandru Elisei
2019-02-05 14:29 ` [PATCH 6/5] arm/arm64: selftest.vectors-user: clean up PSCI exit Andrew Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).