[PATCH kvmtool 0/2] Fixes for arm64 and MIPS

Alexandru Elisei alexandru.elisei at arm.com
Wed May 25 09:57:02 PDT 2022


The first fix is for arm64, where the VCPUs weren't pinned correctly with
--vcpu-affinity when creating an aarch32 guest. Hopefully the patch is
straightforward.

The last patch is a fix for MIPS not compiling for a year now, ever since
hw/serial.c was changed to use a different address for arm/arm64 in commit
45b4968e0de1 ("hw/serial: ARM/arm64: Use MMIO at higher addresses"). Did
some digging and it turns out that the serial never worked on MIPS since
RAM starts at 0 for the architecture. So I just removed hw/serial.o from the
list of compilation objects, which revelead that kvm-ipc assumes that all
architectures use the 16550/8250 UART. Added a stub for
serial8250__inject_sysreg() to MIPS to fix that.

Note that as far as I can tell powerpc is in the same situation as MIPS:
RAM starts at 0 and ends at 64TB (that's terabytes), so the UART was never
working. It looks like powerpc uses hypercalls to emulate a console with
the name "hvterm" (devicetree node created in kvm.c and emulation
implemented in spapr_hvcons.{c,h}). I don't know enough about the powerpc
architecture and I don't have a machine to test it on, and since powerpc
still compiles, I opted not to do any changes to the architecture.

Tested by cross-compiling both patches for all architectures (arm, arm64, mips,
powerpc, riscv, x86), running a kernel on x86, and running kvm-unit-tests for
both arm and arm64 on a rockpro64 (has two PMUs).

Alexandru Elisei (2):
  arm64: Honor --vcpu-affinity for aarch32 guests
  mips: Do not emulate a serial device

 Makefile              |  7 +++++--
 arm/aarch64/kvm-cpu.c | 22 ++++++++++++----------
 mips/kvm.c            |  5 +++++
 3 files changed, 22 insertions(+), 12 deletions(-)

-- 
2.36.1




More information about the linux-arm-kernel mailing list