Bug 1220011 - qemu-8.2.0 does not have kvm support on aarch64
Summary: qemu-8.2.0 does not have kvm support on aarch64
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: KVM (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Claudio Fontana
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-16 14:32 UTC by Stefan Seyfried
Modified: 2024-02-29 18:50 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
strace log when TW snapshot VERSION_ID="20240212" (74.74 KB, text/plain)
2024-02-16 19:35 UTC, slager
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Seyfried 2024-02-16 14:32:44 UTC
The packman obs workers are not happy:

[   12s] /usr/bin/qemu-system-aarch64 -nodefaults -no-reboot -nographic -vga none -cpu host -enable-kvm -M virt,accel=kvm,usb=off,gic-version=host -sandbox on -object rng-random,filename=/dev/hwrng,id=rng0 -device virtio-rng-device,rng=rng0 -object iothread,id=io0 -runas qemu -net none -kernel /var/cache/obs/worker/root_1/.mount/boot/kernel -initrd /var/cache/obs/worker/root_1/.mount/boot/initrd -append root=/dev/disk/by-id/virtio-0 rootfstype=ext3 rootflags=data=writeback,nobarrier,commit=150,noatime kvmclock mitigations=off elevator=noop nmi_watchdog=0 rw rd.driver.pre=binfmt_misc oops=panic panic=1 quiet console=hvc0 init=/.build/build -m 3686 -drive file=/var/cache/obs/worker/root_1/root,format=raw,if=none,id=disk,cache=unsafe -device virtio-blk-device,iothread=io0,drive=disk,serial=0 -drive file=/var/cache/obs/worker/root_1/swap,format=raw,if=none,id=swap,cache=unsafe -device virtio-blk-device,iothread=io0,drive=swap,serial=1 -device virtio-serial,max_ports=2 -device virtconsole,chardev=virtiocon0 -chardev stdio,id=virtiocon0 -chardev socket,id=monitor,server=on,wait=off,path=/var/cache/obs/worker/root_1/root.qemu/monitor -mon chardev=monitor,mode=readline -smp 3
[   12s] qemu-system-aarch64: invalid accelerator kvm

Downgrading to the qemu-7.1.0 from 15.5 gets it running again.
Comment 1 slager 2024-02-16 16:30:47 UTC
I could also not use KVM, discovered it because strange python script error in virt-manager while tried to do anything wit a VM that worker earlier. This is after a disto upgrade to Tumbleweed snapshot VERSION_ID="20240212". Same VM still worked with RaspberryPiOS Bookworm ('latest updates installed')

So for Tumbleweed I went back to an older Btrfs rootfs Tumbleweed snapshot VERSION_ID="20240131". That one has qemu-system-aarch64 version 8.1.3 and that still works.
Comment 2 Dario Faggioli 2024-02-16 17:22:39 UTC
This seems related to Bug 1219818, except that, there it's said that Tumbleweed was working.

Anyway, we'll looking into this...
Comment 3 Dario Faggioli 2024-02-16 17:58:06 UTC
Can anyone, maybe, do something like:

> wget https://download.opensuse.org/ports/aarch64/tumbleweed/appliances/openSUSE-Tumbleweed-Minimal-VM.aarch64-kvm-and-xen.qcow2
> strace qemu-system-aarch64 -cpu host -enable-kvm -boot c -drive file=./openSUSE-Tumbleweed-Minimal-VM.aarch64-kvm-and-xen.qcow2 -smp 3 -m 1G -nographic 2> /tmp/trace

And then upload /tmp/trace ?
Comment 4 Stefan Seyfried 2024-02-16 18:58:37 UTC
I can do this once the packman build queue for ARM has cleared up :-)
https://pmbs.links2linux.de/monitor/old
Comment 5 slager 2024-02-16 19:35:08 UTC
Created attachment 872807 [details]
strace log when TW snapshot VERSION_ID="20240212"
Comment 6 Stefan Seyfried 2024-02-16 19:56:05 UTC
openSUSE:Factory qemu standard x86_64 buildlog shows, that configure is called as

./configure ... $MANYOPTIONS --disable-kvm $MOREOPTIONS --enable-kvm $EVENMORE

on openSUSE:Factory:ARM qemu standard aarch64, it is called without the --enable-kvm, so no wonder there is no KVM inside :-)
Comment 7 Stefan Seyfried 2024-02-16 20:28:36 UTC
Index: qemu.spec
===================================================================
--- qemu.spec   (revision 264)
+++ qemu.spec   (working copy)
@@ -653,6 +653,7 @@
        --enable-xen \
        --enable-xen-pci-passthrough \
 %endif
+%endif
 %if 0%{with xdp}
        --enable-af-xdp \
 %endif
@@ -679,7 +680,6 @@
 %endif
 %ifnarch %arm s390x
        --enable-numa \
-%endif
 %endif
 %if 0%{?with_rbd}
        --enable-rbd \

This might fix it.
Basically every conditional --enable-* is now %ifarch x86_64.
Something definitely went wrong during the update to 8.2.0 :-)
Comment 8 Dario Faggioli 2024-02-17 00:24:56 UTC
(In reply to Stefan Seyfried from comment #7)
> Index: qemu.spec
> ===================================================================
> --- qemu.spec   (revision 264)
> +++ qemu.spec   (working copy)
> @@ -653,6 +653,7 @@
>         --enable-xen \
>         --enable-xen-pci-passthrough \
>  %endif
> +%endif
>  %if 0%{with xdp}
>         --enable-af-xdp \
>  %endif
> @@ -679,7 +680,6 @@
>  %endif
>  %ifnarch %arm s390x
>         --enable-numa \
> -%endif
>  %endif
>  %if 0%{?with_rbd}
>         --enable-rbd \
> 
> This might fix it.
>
Ok, this was indeed found (by Fabian) and is already part of https://build.opensuse.org/request/show/1147249

Can you install QEMU from here and see if things work?

https://download.opensuse.org/repositories/Virtualization/openSUSE_Tumbleweed/
https://download.opensuse.org/repositories/Virtualization/openSUSE_Tumbleweed/Virtualization.repo
Comment 10 slager 2024-02-17 06:50:03 UTC
(In reply to Dario Faggioli from comment #8)
> Can you install QEMU from here and see if things work?
> 
> https://download.opensuse.org/repositories/Virtualization/
> openSUSE_Tumbleweed/
> https://download.opensuse.org/repositories/Virtualization/
> openSUSE_Tumbleweed/Virtualization.repo

I installed "qemu-arm-8.2.0-Virt.1699.963.1.aarch64.rpm" in the TW snapshot  VERSION_ID="20240212" and now virt-manager and starting/running the VM works again. 

So problem solved and I wait a bit for it to appear in the normal TW repo so I can redo the 'zypper dup' update of my VERSION_ID="20240131" TW rootfs snapshot.
Comment 11 Dario Faggioli 2024-02-17 08:28:03 UTC
(In reply to slager from comment #10)
> (In reply to Dario Faggioli from comment #8)
> > Can you install QEMU from here and see if things work?
> > 
> > https://download.opensuse.org/repositories/Virtualization/
> > openSUSE_Tumbleweed/
> > https://download.opensuse.org/repositories/Virtualization/
> > openSUSE_Tumbleweed/Virtualization.repo
> 
> I installed "qemu-arm-8.2.0-Virt.1699.963.1.aarch64.rpm" in the TW snapshot 
> VERSION_ID="20240212" and now virt-manager and starting/running the VM works
> again. 
> 
Ok, cool to know. And thanks for testing this!

> So problem solved and I wait a bit for it to appear in the normal TW repo so
> I can redo the 'zypper dup' update of my VERSION_ID="20240131" TW rootfs
> snapshot.
>
Yeah, I did indeed messed up, while moving the %ifdefs... Sorry for the inconvenience! :-/

This also showed that we need to improve our non-x86 testing coverage of updates. I'll work on that.
Comment 12 Stefan Seyfried 2024-02-17 08:43:39 UTC
(one of) the PMBS ARM obsworkers is also happy with the QEMU from Virtualization :-)

(I only update them one after another to not lose them all, so the second one is still running an older TW version, and the third is even running 15.5 because of that ;-)

I consider the regular updates of these Tumbleweed machines actually a way to contribute to aarch64 testing, because running an OBS worker certainly puts some stress and load on the machine and thus tests various parts of the Linux stack bottom to top.
Comment 13 Dario Faggioli 2024-02-19 15:48:28 UTC
(In reply to Stefan Seyfried from comment #12)
> (one of) the PMBS ARM obsworkers is also happy with the QEMU from
> Virtualization :-)
> 
Great. And the change has been accepted, so it should only be a matter of time until it shows up in a TW snapshot.

> I consider the regular updates of these Tumbleweed machines actually a way
> to contribute to aarch64 testing, because running an OBS worker certainly
> puts some stress and load on the machine and thus tests various parts of the
> Linux stack bottom to top.
>
Yep, and I couldn't agree more that, yes, it is a very valuable contribution to testing, and thank you for that!
Comment 16 Dario Faggioli 2024-02-28 15:27:53 UTC
All back to working now.