[Bug 1988527] Re: autopkgtest_qemu doesn't use accel=kvm on ppc64le, being fully unusable on that arch

Christian Ehrhardt  1988527 at bugs.launchpad.net
Mon Sep 5 06:57:48 UTC 2022


There are multiple levels this could be going wrong or being a
misunderstanding of expectations/behavior.

I assume you didn't hit the obvious, like a permission issue which would appear as:
Could not access KVM kernel module: Permission denied
qemu-system-ppc64: failed to initialize kvm: Permission denied
qemu-system-ppc64: falling back to tcg

In addition please be aware that second level virtualization is known be somewhat dysfunctional and therefore won't work. I assume we have level 1 = openstack providing a Vm for autopkgtest and then level 2 (without options to force it) will default to TCG.
For second level (using kernel kvm_pr instead of kvm_hv) you might always need to force accel=kvm which is just what you have done in your workaround (and maybe need to load kvm_pr manually).

But let us ignore second level for now and resolve the simple case first - running on bare metal.
With the qemu monitors `info jit` you can check if tcg was enabled (not needing to assume it based on speed) and therefore easily check which options lead to tcg being used or if KVM accel is used instead.

Easy cases first - things running as specified:

KVM Mode
$ sudo qemu-system-ppc64 -S -nographic -monitor telnet:127.0.0.1:1234,server,nowait -machine pseries-jammy,accel=kvm:tcg
$ sudo qemu-system-ppc64 -S -nographic -monitor telnet:127.0.0.1:1234,server,nowait -machine pseries-jammy,accel=kvm

TCG Mode
$ sudo qemu-system-ppc64 -S -nographic -monitor telnet:127.0.0.1:1234,server,nowait -machine pseries-jammy,accel=tcg
$ sudo qemu-system-ppc64 -S -nographic -monitor telnet:127.0.0.1:1234,server,nowait -machine pseries-jammy,accel=kvm:tcg:kvm

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to autopkgtest in Ubuntu.
https://bugs.launchpad.net/bugs/1988527

Title:
  autopkgtest_qemu doesn't use accel=kvm on ppc64le, being fully
  unusable on that arch

Status in autopkgtest package in Ubuntu:
  New

Bug description:
  On Power9 the qemu based autopkgtest commands create VMs that are
  extremely slow and fail with obscure errors (partially discussed in
  LP: #1973628, comment 8). This can be reproduced for example by
  running:

    autopkgtest-buildvm-ubuntu-cloud -v -r jammy --ram-size 1024

  but autopkgtest-virt-qemu is also affected. The extreme slowness of
  the VMs made me think that something was off with the virtualization
  settings. I modified autopkgtest_qemu.py so that qemu-system-ppc64le
  is called with '-machine accel=kvm' (which I think is the same as
  '-machine pseries,accel=kvm' with pseries being the default machine
  type).

  With this change everything is very fast and reliable. These warnings
  also went away:

  qemu-system-ppc64le: warning: TCG doesn't support requested feature, cap-cfpc=workaround
  qemu-system-ppc64le: warning: TCG doesn't support requested feature, cap-sbbc=workaround
  qemu-system-ppc64le: warning: TCG doesn't support requested feature, cap-ibs=workaround
  qemu-system-ppc64le: warning: TCG doesn't support requested feature, cap-ccf-assist=on

  indicating that we were using TCG emulation before.

  I imagine that Qemu has good reasons not to default to accel=kvm or
  accel=kvm:tcg on ppc64, but think it's reasonable to assume it's
  available and enable it in autopkgtest.

  We can fix this in autopkgtest upstream, but it would be nice to
  verify if this is an issue with Debian too before submitting a salsa
  MR.

  [1] https://wiki.qemu.org/Documentation/TCG

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/autopkgtest/+bug/1988527/+subscriptions




More information about the foundations-bugs mailing list