Public bug reported:

[Impact]

Our riscv64 kernels have CONFIG_KVM=m. This means that the /dev/kvm
device is only available after modprobing.

On amd64 we use the systemd qemu-kvm service for this purpose that runs

/usr/share/qemu/init/qemu-kvm-init start

/usr/share/qemu/init/qemu-kvm-init contains support for x86_64, i686,
and ppc*, but not for riscv64.

This is the change needed:

diff --git a/debian/qemu-kvm-init b/debian/qemu-kvm-init
index af00b7184..4a37c46b3 100755
--- a/debian/qemu-kvm-init
+++ b/debian/qemu-kvm-init
@@ -32,6 +32,9 @@ case "$arch" in
         fi
         modlist="kvm-hv"
         ;;
+    riscv64)
+        kvm=/usr/bin/qemu-system-riscv64
+        modlist="kvm"
 esac
 
 # Silently exit if the package isn't installed anymore

[Test Plan]

On a riscv64 system with RVA23S64 support:

* Install qemu-system-common.
* Check that /dev/kvm exists.
* Unload the kvm module.
* Check that that /dev/kvm no longer exists (assuming the kernel is configure 
with CONFIG_KVM=m)
* Restart the qemu-kvm service (sudo systemctl restart qemu-kvm.service)
* Check that /dev/kvm is available.

[Where Problems Could Occur]

If we create a syntax error in the script, automatic KVM loading might
fail on all architectures.

[ Other Info ]

n/a

** Affects: qemu (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: qemu (Ubuntu Resolute)
     Importance: Undecided
         Status: New

** Affects: qemu (Ubuntu Stonking)
     Importance: Undecided
         Status: New

** Also affects: qemu (Ubuntu Resolute)
   Importance: Undecided
       Status: New

** Also affects: qemu (Ubuntu Stonking)
   Importance: Undecided
       Status: New

** Changed in: qemu (Ubuntu Resolute)
    Milestone: None => ubuntu-26.04.1

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

Title:
  [SRU] qemu-kvm-init does not load kvm module on riscv64

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


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to