kvm_unit_test failed on ThunderX but passed on Moonshot ARM64

Bug #1715611 reported by Po-Hsu Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Po-Hsu Lin

Bug Description

With Xenial kernel + QEMU emulator version 2.5.0, the kvm_unit_test failed on ThunderX system, but passed on the m400 moonshot system.

starmie-kernel PASSED: 2 FAILED: 4
ms10-34-mcdivittB0-kernel PASSED: 6 FAILED: 0

   Passed setup.all
   Failed selftest-setup
   Failed selftest-vectors-kernel
   Failed selftest-vectors-user
   Passed selftest-smp
   Failed pci-test

They all failed with "Failed to set device address: No such device"

Ran these job manually it will print:
$ sudo ./arm/run arm/selftest.flat -smp 2 -m 256 -append 'setup smp=2 mem=256'
qemu-system-aarch64 -machine virt,accel=kvm -cpu host -device virtio-serial-device -device virtconsole,chardev=ctd -chardev testdev,id=ctd -device pci-testdev -display none -serial stdio -kernel arm/selftest.flat -smp 2 -m 256 -append setup smp=2 mem=256
Failed to set device address: No such device

So the qemu-system-aarch64 output looks like the real command it uses, execute it manually:
$ sudo ./qemu-system-aarch64 -machine virt,accel=kvm -cpu host -device virtio-serial-device -device virtconsole,chardev=ctd -chardev testdev,id=ctd -device pci-testdev -display none -serial stdio -kernel arm/selftest.flat -smp 2 -m 256 -append setup smp=2 mem=256
qemu-system-aarch64: -append setup: Could not open 'smp=2': No such file or directory

I found a discussion thread similar to this https://bugzilla.redhat.com/show_bug.cgi?id=1375571

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: linux-image-4.4.0-93-generic 4.4.0-93.116
ProcVersionSignature: User Name 4.4.0-93.116-generic 4.4.79
Uname: Linux 4.4.0-93-generic aarch64
AlsaDevices:
 total 0
 crw-rw---- 1 root audio 116, 1 Sep 7 07:55 seq
 crw-rw---- 1 root audio 116, 33 Sep 7 07:55 timer
AplayDevices: Error: [Errno 2] No such file or directory: 'aplay'
ApportVersion: 2.20.1-0ubuntu2.10
Architecture: arm64
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
Date: Thu Sep 7 10:45:15 2017
IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig'
MachineType: Cavium ThunderX CRB
PciMultimedia:

ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcFB: 0 astdrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.4.0-93-generic root=UUID=c5160401-c147-4329-9683-b946ce7d0d37 ro
RelatedPackageVersions:
 linux-restricted-modules-4.4.0-93-generic N/A
 linux-backports-modules-4.4.0-93-generic N/A
 linux-firmware 1.157.12
RfKill: Error: [Errno 2] No such file or directory: 'rfkill'
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 12/12/2012
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 5.11
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: To be filled by O.E.M.
dmi.board.vendor: To be filled by O.E.M.
dmi.board.version: To be filled by O.E.M.
dmi.chassis.asset.tag: To be filled by O.E.M.
dmi.chassis.type: 0
dmi.chassis.vendor: Cavium
dmi.chassis.version: To be filled by O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr5.11:bd12/12/2012:svnCavium:pnThunderXCRB:pvrTobefilledbyO.E.M.:rvnTobefilledbyO.E.M.:rnTobefilledbyO.E.M.:rvrTobefilledbyO.E.M.:cvnCavium:ct0:cvrTobefilledbyO.E.M.:
dmi.product.name: ThunderX CRB
dmi.product.version: To be filled by O.E.M.
dmi.sys.vendor: Cavium

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Next is to build QEMU 2.10.0 to see if this is QEMU related.

(The setup.all test has crashed on ThunderX with zesty kernel.)

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Changed in linux (Ubuntu):
importance: Undecided → Medium
tags: added: kernel-da-key
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Tested with QEMU 2.10.0 from upstream, this issue still exist.
Tested with kvm_unit_test from upstream, this issue has gone with QEMU 2.5.0

$ sudo ./arm/run arm/selftest.flat -smp 2 -m 256 -append 'setup smp=2 mem=256'
/usr/bin/qemu-system-aarch64 -nodefaults -machine virt,gic-version=host,accel=kvm -cpu host -device virtio-serial-device -device virtconsole,chardev=ctd -chardev testdev,id=ctd -device pci-testdev -display none -serial stdio -kernel arm/selftest.flat -smp 2 -m 256 -append setup smp=2 mem=256 # -initrd /tmp/tmp.NRvKU9inc7
PASS: selftest: setup: smp: nr_cpus = 2
PASS: selftest: setup: mem: size = 256 MB
SUMMARY: 2 tests

I will update the kvm_unit_test in our repo.

Changed in linux (Ubuntu):
assignee: nobody → Po-Hsu Lin (cypressyew)
status: Confirmed → In Progress
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

With kvm_unit_test updated, these tests can be run on ThunderX.

Changed in linux (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.