SRU prepared (template in bug description) and tested against the PPA
(https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/4389) and
reviewed
(https://code.launchpad.net/~paelzer/ubuntu/+source/qemu/+git/qemu/+merge/395786
+
https://code.launchpad.net/~paelzer/ubuntu/+source/qemu/+git/qemu/+merge/395787).

I will upload that to -unapproved soon

** Description changed:

+ [Impact]
+ 
+ Symptom:       PCI devices are unavailable after a subsystem reset
+ Problem:       When a subsystem reset event occurs (e.g. via kexec) PCI
+                devices are not being reset and are therefore in an
+                unexpected state when the guest attempts to enable them
+                again after the subsystem reset. This results in the 
+ 
+ [Test Case]
+ 
+ # Prep a guest and wait until it booted
+ $ apt install uvtool-libvirt
+ $ uvt-simplestreams-libvirt --verbose sync --source 
http://cloud-images.ubuntu.com/daily "arch=s390x" label=daily "release=focal"
+ $ uvt-kvm create --disk 5 --password=ubuntu testguest release=focal 
arch=s390x label=daily
+ $ virsh console testguest
+ # lspci in guest shows nothing yet (expected)
+ 
+ # Add virtio device
+ $ cat > virtio-pci.xml << EOF
+ <interface type='network'>
+ <source network='default'/>
+ <model type='virtio'/>
+ <address type='pci'/>
+ <rom bar='off' file=''/>
+ </interface>
+ EOF
+ $ virsh attach-device testguest virtio-pci.xml
+ 
+ 
+ # lspci in guest now shows the device
+ ubuntu@testguest:~$ lspci
+ 0001:00:00.0 Ethernet controller: Red Hat, Inc. Virtio network device
+ 
+ # verify that a "normal" reboot does not loose the device
+ ubuntu@testguest:~$ sudo reboot
+ ...
+ ubuntu@testguest:~$ lspci
+ 0001:00:00.0 Ethernet controller: Red Hat, Inc. Virtio network device
+ 
+ # Kexec into a kernel (can be the same)
+ ubuntu@testguest:~$ sudo apt install kexec-tools
+ ubuntu@testguest:~$ sudo kexec --load /boot/vmlinuz --initrd=/boot/initrd.img 
--append="$(cat /proc/cmdline)"
+ ubuntu@testguest:~$ sudo kexec --exec
+ 
+ # Log in and recheck lspci - it will be empty (wrong)
+ # With the Fix that will show the pci device again
+ ubuntu@testguest:~$ lspci
+ 
+ # Note: A Reboot will get the device back (in old and new case)
+ 
+ [Where problems could occur]
+ 
+  * The patch is gladly small - it affects the list of devices that will 
+    be reset them. By extending this list obivously more devices will be 
+    reset - therefore the activity of a "subsystem_reset" will cover more 
+    devices.
+    Regressions (let us hope not) would happen there. For example think 
+    there is a buggy PCI device that no one cared about before. Formerly it 
+    would not have been reset, but now it is. If that reset fails badly you 
+    have a regression.
+    Fortunately PCI devices are still uncommon on s390x, so even if (I 
+    doubt) there is a regression it would affect a small fraqction of users 
+    only.
+    These kind of resets happen on load (kexec, reboot, start) and that is 
+    the place to look out for regressions.
+ 
+ [Other Info]
+  
+  * n/a
+ 
+ ---
+ 
+ 
  Description:   s390x/s390-virtio-ccw: Reset PCI devices during subsystem reset
  Symptom:       PCI devices are unavailable after a subsystem reset
  Problem:       When a subsystem reset event occurs (e.g. via kexec) PCI
-                devices are not being reset and are therefore in an
-                unexpected state when the guest attempts to enable them
-                again after the subsystem reset. This results in the devices
-                being unavailable to the guest until a reboot.
+                devices are not being reset and are therefore in an
+                unexpected state when the guest attempts to enable them
+                again after the subsystem reset. This results in the devices
+                being unavailable to the guest until a reboot.
  Solution:      Add the s390 PCI host bridge to the list of devices to be
-                reset during a subsystem reset event
+                reset during a subsystem reset event
  Reproduction:  kexec on an s390x guest with PCI devices
  
  db08244a3a7e s390x/s390-virtio-ccw: Reset PCI devices during subsystem
  reset
  
  This fix need to be applied to qemu for focal (20.04) and groovy
  (20.10).

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

Title:
  [UBUNTU 21.04] s390x/s390-virtio-ccw: Reset PCI devices during
  subsystem reset

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1907656/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to