** Description changed:

+ [ Impact ]
+ 
+ KVM on RISC-V does not expose the Zicclsm, Ziccamoa, Ziccif and Za64rs
+ extensions. 
+ The riscv_hwprobe syscall in the guest reports:
+ 
+   Zicclsm NOT supported
+   Ziccamoa NOT supported
+   Ziccif NOT supported
+   Za64rs NOT supported
+ 
+ The host hardware has all four. The RVA23 profile requires these
+ extensions.
+ 
+ [ Fix ]
+ 
+ Cherry picked two commits from mainline (v7.4):
+ - 65452f8b9c02 "RISC-V: KVM: Allow Zicclsm, Ziccamoa, Ziccif, Za64rs in guest"
+ - 633b3931a874 "KVM: riscv: selftest: add Zicclsm, Ziccamoa, Ziccif, Za64rs"
+ 
+ [ Test Plan ]
+ 
+ Use a riscv64 host whose CPU has the four extensions (for example a
+ SpacemiT K3) and boot the patched kernel on it.
+ 
+ 1. Start a VM with KVM acceleration, following
+    
https://github.com/ubuntu/ubuntu-manual-tests/blob/main/stonking/testsuites/RISCV%20Generic/Mandatory/Install%20Qemu.md
+    and adding "-accel kvm" to the qemu-system-riscv64 command line.
+ 2. In the guest, build and run https://github.com/xypron/hwprobe.git.
+ 3. Before the fix, it prints:
+ 
+      Zicclsm NOT supported
+      Ziccamoa NOT supported
+      Ziccif NOT supported
+      Za64rs NOT supported
+ 
+    After the fix, it should report all four as supported.
+ 4. On the host, build and run
+    tools/testing/selftests/kvm/riscv/get-reg-list. It should pass.
+ 
+ [ Where problems could occur ]
+ 
+ The patches add four enum values and table entries, so the risk is small.
+ The new IDs go just before KVM_RISCV_ISA_EXT_MAX, so existing register
+ numbers do not change. A bug in the new entries would only affect KVM
+ guests on riscv64.
+ 
+ 
+ Original bug report:
+ 
  On my SpacemiT K3 I run kernel 7.3.0-9-generic. I start a VM with Ubuntu
  26.10 also running 7.3.0-9-generic using KVM. The hwprobe syscall in the
  VM reports:
  
  Zicclsm NOT supported
  Ziccamoa NOT supported
  Ziccif NOT supported
  Za64rs NOT supported
  
  My expectation is that the VM should support full RVA23U64 compliance
  except for extension H.
  
  https://github.com/xypron/hwprobe.git can be used for testing.
- --- 
+ ---
  ProblemType: Bug
  AlsaDevices:
-  total 0
-  crw-rw---- 1 root audio 116,  1 Oct 12 21:40 seq
-  crw-rw---- 1 root audio 116, 33 Oct 12 21:40 timer
+  total 0
+  crw-rw---- 1 root audio 116,  1 Oct 12 21:40 seq
+  crw-rw---- 1 root audio 116, 33 Oct 12 21:40 timer
  AplayDevices: Error: [Errno 2] No such file or directory: 'aplay'
  ApportVersion: 2.36.0-0ubuntu1
  Architecture: riscv64
  ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord'
  AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', 
'/dev/snd/timer'] failed with exit code 1:
  CRDA: N/A
  CasperMD5CheckResult: unknown
  CloudArchitecture: riscv64
  CloudBuildName: server
  CloudID: nocloud
  CloudName: unknown
  CloudPlatform: nocloud
  CloudSerial: 20261012.1
  CloudSubPlatform: seed-dir (/var/lib/cloud/seed/nocloud-net)
  CurrentDmesg: Error: command ['dmesg'] failed with exit code 1: dmesg: read 
kernel buffer failed: Operation not permitted
  DistroRelease: Ubuntu 26.10
  Lspci-vt:
-  -[0000:00]-+-00.0  Red Hat, Inc. QEMU PCIe Host bridge
-             \-01.0  Red Hat, Inc. Virtio RNG
+  -[0000:00]-+-00.0  Red Hat, Inc. QEMU PCIe Host bridge
+             \-01.0  Red Hat, Inc. Virtio RNG
  Lsusb: Error: command ['lsusb'] failed with exit code 1:
  Lsusb-t:
-  
+ 
  Lsusb-v: Error: command ['lsusb', '-v'] failed with exit code 1:
  MachineType: QEMU KVM Virtual Machine
  Package: linux-riscv (not installed)
  PciMultimedia:
-  
+ 
  ProcEnviron:
-  LANG=C.UTF-8
-  PATH=(custom, no user)
-  SHELL=/bin/bash
-  TERM=vt220
-  XDG_RUNTIME_DIR=<set>
+  LANG=C.UTF-8
+  PATH=(custom, no user)
+  SHELL=/bin/bash
+  TERM=vt220
+  XDG_RUNTIME_DIR=<set>
  ProcFB:
-  
+ 
  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-7.3.0-9-generic 
root=LABEL=cloudimg-rootfs ro efi=debug earlycon
  ProcVersionSignature: User Name 7.3.0-9.9.1-generic 7.3.0-rc6
  RfKill: Error: [Errno 2] No such file or directory: 'rfkill'
  Tags: cloud-image stonking
  Uname: Linux 7.3.0-9-generic riscv64
  UpgradeStatus: No upgrade log present (probably fresh install)
  UserGroups: adm cdrom dip lxd sudo
  _MarkForUpload: True
  acpidump:
-  
+ 
  dmi.bios.date: 10/08/2026
  dmi.bios.release: 0.0
  dmi.bios.vendor: Ubuntu distribution of EDK II
  dmi.bios.version: 2026.05-2ubuntu3
  dmi.chassis.type: 1
  dmi.chassis.vendor: QEMU
  dmi.chassis.version: virt
  dmi.modalias: 
dmi:bvnUbuntudistributionofEDKII:bvr2026.05-2ubuntu3:bd10/08/2026:br0.0:svnQEMU:pnKVMVirtualMachine:pvrvirt:cvnQEMU:ct1:cvrvirt:sku:pfa:
  dmi.product.name: KVM Virtual Machine
  dmi.product.version: virt
  dmi.sys.vendor: QEMU

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

Title:
  On 7.3.0-9-generic KVM does not fully support RVA23U64

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-riscv/+bug/2170634/+subscriptions


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

Reply via email to