[nested] virt-install falls to SLOF

Bug #1660946 reported by Rafael Folco
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qemu (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

[nested] virt-install falls to SLOF: after starting installer (ISO/CDROM), it crashes w/ a kernel panic due to an HTM (Hardware Transactional Memory) exception.

Scenario:
Host=Ubuntu 16.04 Xenial (Ubuntu KVM ppc64el POWER8E 8247-22L)
Guest=Ubuntu 16.04 Xenial (Ubuntu Xenial Cloud Image QCOW2)
Nested=Ubuntu 16.04 Xenial (Ubuntu Xenial Server ISO *or* NetInstall mini.iso)

Inside Guest (1st level), run virt-install as shown below to reproduce the bug.

Facts:
 * ISO images (from both Server or netinstall mini.iso) fail to boot on xenial/yakkety
 * Cloud image (xenial/yakkety/zesty) on nested virt boots fine, the login prompt is seen.
 * Reproducible with Xenial and Yakkety
 * NOT reproducible with Zesty (Installer menu starts just normally)
 * virtio-scsi, virtio-net and virtio-blk modules are seen in zesty. Only virtio-scsi is seen on xenial/yakkety (-net and -blk are built-in modules?)
 * kvm-pr is loaded for all tested scenarios
 * This patch[1] rings a bell, however, it doesn't explain how cloud images boot just fine and don't hit the bug, since the kernel used in the cloud images also enable HTM[2].

[1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2016-April/141292.html

[2] grep TRANSA /boot/config-4.8.0-26-generic
CONFIG_PPC_TRANSACTIONAL_MEM=y

# cat virt-inst.sh
virt-install --virt-type=kvm --cpu=host --name=nested-xenial --controller type=scsi,model=virtio-scsi --graphics none --console pty,target_type=serial --disk path=/home/nested-xenial.qcow2,size=20 --vcpus=4 --ram=4096 --os-type=linux --os-variant ubuntu16.04 --network bridge=virbr0,model=virtio --cdrom=$1

# ./virt-inst.sh ubuntu-16.04-server-ppc64el.iso
WARNING CDROM media does not print to the text console by default, so you likely will not see text install output. You might want to use --location. See the man page for examples of using --location with CDROM media

Starting install...
Creating domain... | 0 B 00:00:00
Connected to domain nested-xenial
Escape character is ^]
Populating /vdevice methods
Populating /vdevice/vty@30000000
Populating /vdevice/nvram@71000000
Populating /pci@800000020000000
                     00 2800 (D) : 1af4 1002 unknown-legacy-device*
                     00 2000 (D) : 1af4 1001 virtio [ block ]
                     00 1800 (D) : 106b 003f serial bus [ usb-ohci ]
                     00 1000 (D) : 1af4 1004 virtio [ scsi ]
Populating /pci@800000020000000/scsi@2
       SCSI: Looking for devices
          100000000000000 CD-ROM : "QEMU QEMU CD-ROM 2.5+"
                     00 0800 (D) : 10ec 8139 network [ ethernet ]
No NVRAM common partition, re-initializing...
Scanning USB
  OHCI: initializing
Using default console: /vdevice/vty@30000000

  Welcome to Open Firmware

  Copyright (c) 2004, 2011 IBM Corporation All rights reserved.
  This program and the accompanying materials are made available
  under the terms of the BSD License available at
  http://www.opensource.org/licenses/bsd-license.php

Trying to load: from: /pci@800000020000000/scsi@2/disk@100000000000000 ... Successfully loaded

                     GNU GRUB version 2.02~beta2-36ubuntu3

 +----------------------------------------------------------------------------+
 |*Install |
 | Rescue mode |
 | |
 | |
 | |
 | |
 | |
 | |
 | |
 | |
 | |
 | |
 +----------------------------------------------------------------------------+

      Use the ^ and v keys to select which entry is highlighted.
      Press enter to boot the selected OS, `e' to edit the commands
      before booting or `c' for a command-line.

OF stdout device is: /vdevice/vty@30000000
Preparing to boot Linux version 4.4.0-21-generic (buildd@bos01-ppc64el-017) (gcc version 5.3.1 20160413 (Ubuntu/IBM 5.3.1-14ubuntu2) ) #37-Ubuntu SMP Mon Apr 18 18:30:22 UTC 2016 (Ubuntu 4.4.0-21.37-generic 4.4.6)
Detected machine type: 0000000000000101
Max number of cores passed to firmware: 2048 (NR_CPUS = 2048)
Calling ibm,client-architecture-support... done
command line: BOOT_IMAGE=/install/vmlinux tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false --- quiet
memory layout at init:
  memory_limit : 0000000000000000 (16 MB aligned)
  alloc_bottom : 0000000004640000
  alloc_top : 0000000030000000
  alloc_top_hi : 0000000100000000
  rmo_top : 0000000030000000
  ram_top : 0000000100000000
instantiating rtas at 0x000000002fff0000... done
prom_hold_cpus: skipped
copying OF device tree...
Building dt strings...
Building dt structure...
Device tree strings 0x0000000004650000 -> 0x0000000004650a5b
Device tree struct 0x0000000004660000 -> 0x0000000004670000
Quiescing Open Firmware ...
Booting Linux via __start() ...
 -> smp_release_cpus()
spinning_secondaries = 3
 <- smp_release_cpus()
 <- setup_system()
Linux ppc64le
#37-Ubuntu SMP M[ 2.155665] Facility 'TM' unavailable, exception at 0x3fff9f3d8644, MSR=b00000014280f033
[ 2.161582] Facility 'TM' unavailable, exception at 0x3fff8a488644, MSR=b00000014280f033
[ 2.168973] Facility 'TM' unavailable, exception at 0x3fffb2df8644, MSR=b00000014280f033
[ 2.174818] Facility 'TM' unavailable, exception at 0x3fff902f8644, MSR=b00000014280f033
[ 2.180887] Facility 'TM' unavailable, exception at 0x3fff84728644, MSR=b00000014280f033
[ 2.186023] Facility 'TM' unavailable, exception at 0x3fff8f1f8644, MSR=b00000014280f033
[ 2.193073] Facility 'TM' unavailable, exception at 0x3fffa8ecfe30, MSR=b00000014280f033
[ 2.193697] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
[ 2.193697]
[ 2.193751] CPU: 3 PID: 1 Comm: init Not tainted 4.4.0-21-generic #37-Ubuntu
[ 2.193788] Call Trace:
[ 2.193826] [c0000000fea83a50] [c000000000aedc1c] dump_stack+0xb0/0xf0 (unreliable)
[ 2.193868] [c0000000fea83a90] [c000000000ae9e50] panic+0x100/0x2c0
[ 2.193914] [c0000000fea83b20] [c0000000000bd474] do_exit+0xc24/0xc30
[ 2.193945] [c0000000fea83be0] [c0000000000bd564] do_group_exit+0x64/0x100
[ 2.193979] [c0000000fea83c20] [c0000000000ce9cc] get_signal+0x55c/0x7b0
[ 2.194012] [c0000000fea83d10] [c000000000017424] do_signal+0x54/0x2b0
[ 2.194043] [c0000000fea83e00] [c00000000001787c] do_notify_resume+0xbc/0xd0
[ 2.194072] [c0000000fea83e30] [c000000000009838] ret_from_except_lite+0x64/0x68

Domain creation completed.
Restarting guest.
Connected to domain nested-xenial
Escape character is ^]
Populating /vdevice methods
Populating /vdevice/vty@30000000
Populating /vdevice/nvram@71000000
Populating /pci@800000020000000
                     00 2800 (D) : 1af4 1002 unknown-legacy-device*
                     00 2000 (D) : 1af4 1001 virtio [ block ]
                     00 1800 (D) : 106b 003f serial bus [ usb-ohci ]
                     00 1000 (D) : 1af4 1004 virtio [ scsi ]
Populating /pci@800000020000000/scsi@2
       SCSI: Looking for devices
          100000000000000 CD-ROM : "QEMU QEMU CD-ROM 2.5+"
                     00 0800 (D) : 10ec 8139 network [ ethernet ]
No NVRAM common partition, re-initializing...
Scanning USB
  OHCI: initializing
Using default console: /vdevice/vty@30000000

  Welcome to Open Firmware

  Copyright (c) 2004, 2011 IBM Corporation All rights reserved.
  This program and the accompanying materials are made available
  under the terms of the BSD License available at
  http://www.opensource.org/licenses/bsd-license.php

Trying to load: from: /pci@800000020000000/scsi@4 ...
E3404: Not a bootable device!
Trying to load: from: HALT ...
E3405: No such device

E3407: Load failed

        ..`. .. ....... .. ...... .......
    ..`...`''.`'. .''``````..''. .`''```''`. `''``````
       .`` .:' ': `''..... .''. ''` .''..''.......
         ``.':.';. ``````''`.''. .''. ''``''`````'`
         ``.':':` .....`''.`'`...... `'`.....`''.`'`
        .`.`'`` .'`'`````. ``'''''' ``''`'''`. `'`
  Type 'boot' and press return to continue booting the system.
  Type 'reset-all' and press return to reboot the system.

Ready!
0 >

Tags: htm
Revision history for this message
Thomas Huth (th-huth) wrote :

Sounds like your problem only occurs on older versions of Ubuntu, so moving this to the QEMU-Ubuntu bug tracker.

affects: qemu → qemu (Ubuntu)
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi,
I mostly run with cloud-images so I haven't seen this yet (I always prefer uvtool-libvirt to virt-install).

Thank you already for your good summary!

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

After going the wrong direction for a while I see the almost hidden, yet so important words - "in nested only" !
That also explains the kvm-pr I wondered about, as I'd have expected kvm-hv if in 1st level.

I tried as you instructed - on first stage it worked (Host to lvl 1)

Command:
$virt-install --virt-type=kvm --cpu=host --name=nested-xenial --controller type=scsi,model=virtio-scsi --graphics none --console pty,target_type=serial --disk path=/home/ubuntu/cpaelzer/test-xenial-virt-inst.qcow2,size=20 --vcpus=4 --ram=4096 --os-type=linux --os-variant ubuntu16.04 --network bridge=virbr0,model=virtio --cdrom=ubuntu-16.04-server-ppc64el.iso

On a Xenial system with:
ii libvirt-bin 1.3.1-1ubuntu10.6
ii qemu-kvm 1:2.5+dfsg-5ubuntu10.6
ii virtinst 1:1.3.2-3ubuntu1.16.04.3

And HW:
POWER8E - PowerNV 8247-22L

Now the same in 2nd level:
1. install all packages for kvm
2. ensure kvm_pr is loaded correctly
3. make sure libvirt default network can start in 2nd level
3. wget http://cdimage.ubuntu.com/releases/xenial/release/ubuntu-16.04-server-ppc64el.iso
4. virt-install as above, yet shrinked down to fit (5G disk)

With that I can confirm your issue.

Changed in qemu (Ubuntu):
status: New → Confirmed
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I'm not entirely sure if kvm_pr (or more defined "the TM feature inside kvm_pr") is meant to be fully supported by IBM owning power in general.

Subscribing / pinging them for their expertise on this.

Revision history for this message
Rafael Folco (rafaelfolco) wrote :

kvm_pr is not "officially/fully/formally" supported for production use, but this mode is extensively used by OpenStack Continuous Integration and it is the testing ground for many other projects. This statement of "not supported" has been changing and Power ecosystem depends on kvm_pr for platform enablement efforts.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

The fix you referred to also is not upstream yet - although it is unclear to me why.
The discussion somehow just stalled
https://patchwork.kernel.org/patch/8740001/

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

As mentioned I was reaching out to IBM and they likely take a look at that patch once more now.

Revision history for this message
Rafael Folco (rafaelfolco) wrote :

Yep, for some reason, the discussion stalled.
Thanks for working on this bug. HTM bits should be cleared on nested virt, anyway.
Also, HTM is causing other components to fail on nested virt like rtas_errd daemon, which does PCI Hotplug.

Revision history for this message
Thomas Huth (th-huth) wrote :

FYI, the pa_features[24] setting has been fixed in upstream in a slightly different way:
http://git.qemu-project.org/?p=qemu.git;a=commitdiff;h=bac3bf287ab60e264b6

Revision history for this message
Michael Hohnbaum (hohnbaum) wrote :

Christian,

I checked with Breno and while nested virtualization is not something that they encourage use of in a production environment, it is used for testing purposes. They would like to have this working with Ubuntu and have stated it only requires a small fix to qemu. If possible, could you please look at pulling in the fix.

Thanks.

                    Michael

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks Thomas for pointing out the upstream fix.
IBM has opened a bug that I dup this one on.

There not only one but three patches are suggested.
It would be great if you could take a look there as the patches are all yours - see the dup bug 1664622

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.