Can I use qemu system emulated builds for riscv64 and loongarch64 on build.opensuse.org?

riscv64 and loongarch64 have more test fails with erros like: qemu: uncaught target signal 6 (Aborted) - core dumped And they build much slower than the other architectures. They both use qemu user space emulation (qemu-$ARCH from the package qemu-linux-user) on top of a x86_64 qemu-kvm VM. The other ports (aarch64, ppc64le, s390x) use qemu-system-$ARCH VMs. Does there exist an option to use qemu-system-$ARCH for riscv64 and loongarch64 on build.opensuse.org?

The other architectures use `qemu-system-$ARCH -cpu host` so the speed difference comes from their native building machines. But the sentence regarding test fails is still valid. I think we can reduced the need to disable tests with full system emulation.

Am 02.01.25 um 07:10 schrieb JS:
The other architectures use `qemu-system-$ARCH -cpu host` so the speed difference comes from their native building machines.
But the sentence regarding test fails is still valid. I think we can reduced the need to disable tests with full system emulation.
In my experience: No, you can't. I'm running qemu-system-ppc64 emulated builds in my OBS instance at work, and while it is even much slower than plain userspace emulation, it still breaks the odd compilation / testcase, e.g. I basically had to disable all RHEL-9 annobin stuff to get moderately complex packages to build at all (albeit slow) without SIGILL, ICE, just seemingly random segfaults etc., not even thinking about enabling tests. Now it might be that the tests just have problems with interpreting /proc/cpuinfo or such, then system emulation might help, but as I said: it's even slower than userspace emulation. -- Stefan Seyfried "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." -- Richard Feynman

Thank you for sharing your insight. I'm very reluctant to disable tests. Knowing professionals also have to disable tests makes me a little better. As for build speed, on my x86_64 machine, qemu-system-riscv64 is as fast as userspace emulation.

On Donnerstag, 2. Januar 2025, 04:27:52 CET JS wrote:
riscv64 and loongarch64 have more test fails with erros like: qemu: uncaught target signal 6 (Aborted) - core dumped
This is just an artifact of the shutdown. Maybe due to timeout so the worker aborts it if nothing happens in the log anymore.
And they build much slower than the other architectures.
indeed. We don't have real build hardware there (yet).
They both use qemu user space emulation (qemu-$ARCH from the package qemu-linux-user) on top of a x86_64 qemu-kvm VM. The other ports (aarch64, ppc64le, s390x) use qemu-system-$ARCH VMs.
Does there exist an option to use qemu-system-$ARCH for riscv64 and loongarch64 on build.opensuse.org?
Well, that be even slower when you emulate also the kernel. There is currently no hardware and also no working KVM implemenation for these architectures AFAIK. -- Adrian Schroeter <adrian@suse.de> Build Infrastructure Project Manager SUSE Software Solutions Germany GmbH, Frankenstraße 146, 90461 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev

On build.opensuse.org, user mode emulation is nested in a x86_64 kvm VM. This nested virtualization is slower than system emulation (qemu-system-riscv64) on my local x86_64 machine. I compared the build time of the package openSUSE:Factory:RISCV/rpm with `osc build -j 4 --vm-type $VM_TYPE --clean standard riscv64`, $VM_TYPE being chroot, kvm and qemu (modified to run qemu-system-riscv64): - chroot (user mode emulation on bare metal) ~13 minutes - kvm (user mode emulation in x86_64 qemu-kvm) ~18 minutes - qemu (qemu-system-riscv64) ~12 minutes Repeated at least three times, variance of build time is no more than 2 minutes. I'm suprised that qemu-system-riscv64 is as fast as chroot. How I modified osc to use qemu-system-riscv64 when given `--vm-type qemu` for riscv64: Vanilla `osc --vm-type qemu` runs qemu-system-x86_64 and use user mode emulation for riscv64. I downloaded https://api.opensuse.org/public/build/openSUSE:Factory:RISCV/standard/riscv6..., deleted the `hostarch` and `qemu-linux-user` line, changed the `kernel-obs-build` line to the corresponding riscv64 package. Then I hardcoded in the `get_buildinfo()` function in /usr/lib/python3.11/site-packages/osc/core.py to return the contents of this modified _buildinfo instead of getting it from the server.
participants (3)
-
Adrian Schröter
-
JS
-
Stefan Seyfried