1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
|
graphic: 0.801
other: 0.777
assembly: 0.746
device: 0.738
semantic: 0.719
instruction: 0.695
vnc: 0.689
boot: 0.671
mistranslation: 0.669
socket: 0.642
network: 0.625
KVM: 0.544
[nested] virt-install falls to SLOF
[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 >
Sounds like your problem only occurs on older versions of Ubuntu, so moving this to the QEMU-Ubuntu bug tracker.
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!
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.
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.
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.
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/
As mentioned I was reaching out to IBM and they likely take a look at that patch once more now.
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.
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
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
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
|