Merge ~sergiodj/ubuntu/+source/qemu:allow-repeating-hot-unplug-lunar into ubuntu/+source/qemu:ubuntu/lunar-devel

Proposed by Sergio Durigan Junior
Status: Merged
Approved by: git-ubuntu bot
Approved revision: not available
Merged at revision: f7609fe34873856d22a3d2e439c64ef3c94826f2
Proposed branch: ~sergiodj/ubuntu/+source/qemu:allow-repeating-hot-unplug-lunar
Merge into: ubuntu/+source/qemu:ubuntu/lunar-devel
Diff against target: 105 lines (+83/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/series (+1/-0)
debian/patches/ubuntu/allow-repeating-hot-unplug-requests.patch (+74/-0)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Lena Voytek (community) Approve
Canonical Server Core Reviewers Pending
Canonical Server Reporter Pending
Review via email: mp+443831@code.launchpad.net

Description of the change

This MP is the Lunar version of https://code.launchpad.net/~sergiodj/ubuntu/+source/qemu/+git/qemu/+merge/443231.

The backported patch is exactly the same. There is an extensive Test Plan in the bug if you'd like to perform more tests.

PPA: https://launchpad.net/~sergiodj/+archive/ubuntu/qemu

dep8 results:

Results: (from http://autopkgtest.ubuntu.com/results/autopkgtest-lunar-sergiodj-qemu/?format=plain)
  qemu @ arm64:
    28.05.23 05:43:38 Log 🗒️ ✅ Triggers: qemu/1:7.2+dfsg-5ubuntu2.1
  qemu @ armhf:
    30.05.23 07:52:02 Log 🗒️ ✅ Triggers: qemu/1:7.2+dfsg-5ubuntu2.1
  qemu @ ppc64el:
    30.05.23 00:24:20 Log 🗒️ ✅ Triggers: qemu/1:7.2+dfsg-5ubuntu2.1

I'll post the results for amd64 and s390x when they finish running.

To post a comment you must log in.
Revision history for this message
Lena Voytek (lvoytek) wrote :

LGTM, same comments as the jammy mp

review: Approve
Revision history for this message
git-ubuntu bot (git-ubuntu-bot) wrote :

Approvers: sergiodj, lvoytek
Uploaders: sergiodj, lvoytek
MP auto-approved

review: Approve
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Uploaded:

$ dput qemu_7.2+dfsg-5ubuntu2.1_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /home/sergio/work/qemu/qemu_7.2+dfsg-5ubuntu2.1_source.changes: Valid signature from 106DA1C8C3CBBF14
Checking signature on .dsc
gpg: /home/sergio/work/qemu/qemu_7.2+dfsg-5ubuntu2.1.dsc: Valid signature from 106DA1C8C3CBBF14
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading qemu_7.2+dfsg-5ubuntu2.1.dsc: done.
  Uploading qemu_7.2+dfsg-5ubuntu2.1.debian.tar.xz: done.
  Uploading qemu_7.2+dfsg-5ubuntu2.1_source.buildinfo: done.
  Uploading qemu_7.2+dfsg-5ubuntu2.1_source.changes: done.
Successfully uploaded packages.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 0450c1e..4064911 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+qemu (1:7.2+dfsg-5ubuntu2.1) lunar; urgency=medium
7+
8+ * d/p/u/allow-repeating-hot-unplug-requests.patch: Allow repeating
9+ hot-unplug requests by making ACPI PCI able to requeue them.
10+ (LP: #2018733)
11+
12+ -- Sergio Durigan Junior <sergio.durigan@canonical.com> Fri, 26 May 2023 15:57:03 -0400
13+
14 qemu (1:7.2+dfsg-5ubuntu2) lunar; urgency=medium
15
16 * Fix FTBFS with glibc >= 2.36. (LP: #2015418)
17diff --git a/debian/patches/series b/debian/patches/series
18index 204d249..fe2dc60 100644
19--- a/debian/patches/series
20+++ b/debian/patches/series
21@@ -68,3 +68,4 @@ ubuntu/pre-bionic-256k-ipxe-efi-roms.patch
22 ubuntu/qboot-Disable-LTO-for-ELF-binary-build-step.patch
23 ubuntu/fix-ftbfs-glibc-revert-compat-ioctl-defs.patch
24 ubuntu/fix-ftbfs-glibc-sys-mount-h.patch
25+ubuntu/allow-repeating-hot-unplug-requests.patch
26diff --git a/debian/patches/ubuntu/allow-repeating-hot-unplug-requests.patch b/debian/patches/ubuntu/allow-repeating-hot-unplug-requests.patch
27new file mode 100644
28index 0000000..45ec3c1
29--- /dev/null
30+++ b/debian/patches/ubuntu/allow-repeating-hot-unplug-requests.patch
31@@ -0,0 +1,74 @@
32+From 0f689cf5ada4d5df5ab95c7f7aa9fc221afa855d Mon Sep 17 00:00:00 2001
33+From: Igor Mammedov <imammedo@redhat.com>
34+Date: Tue, 18 Apr 2023 11:04:49 +0200
35+Subject: [PATCH] acpi: pcihp: allow repeating hot-unplug requests
36+
37+with Q35 using ACPI PCI hotplug by default, user's request to unplug
38+device is ignored when it's issued before guest OS has been booted.
39+And any additional attempt to request device hot-unplug afterwards
40+results in following error:
41+
42+ "Device XYZ is already in the process of unplug"
43+
44+arguably it can be considered as a regression introduced by [2],
45+before which it was possible to issue unplug request multiple
46+times.
47+
48+Accept new uplug requests after timeout (1ms). This brings ACPI PCI
49+hotplug on par with native PCIe unplug behavior [1] and allows user
50+to repeat unplug requests at propper times.
51+Set expire timeout to arbitrary 1msec so user won't be able to
52+flood guest with SCI interrupts by calling device_del in tight loop.
53+
54+PS:
55+ACPI spec doesn't mandate what OSPM can do with GPEx.status
56+bits set before it's booted => it's impl. depended.
57+Status bits may be retained (I tested with one Windows version)
58+or cleared (Linux since 2.6 kernel times) during guest's ACPI
59+subsystem initialization.
60+Clearing status bits (though not wrong per se) hides the unplug
61+event from guest, and it's upto user to repeat device_del later
62+when guest is able to handle unplug requests.
63+
64+1) 18416c62e3 ("pcie: expire pending delete")
65+2)
66+Fixes: cce8944cc9ef ("qdev-monitor: Forbid repeated device_del")
67+Signed-off-by: Igor Mammedov <imammedo@redhat.com>
68+Acked-by: Gerd Hoffmann <kraxel@redhat.com>
69+CC: mst@redhat.com
70+CC: anisinha@redhat.com
71+CC: jusual@redhat.com
72+CC: kraxel@redhat.com
73+Message-Id: <20230418090449.2155757-1-imammedo@redhat.com>
74+Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
75+Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
76+Reviewed-by: Ani Sinha <anisinha@redhat.com>
77+
78+Origin: upstream, https://gitlab.com/qemu-project/qemu/-/commit/0f689cf5ada4
79+Bug: https://gitlab.com/libvirt/libvirt/-/issues/309
80+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2018733
81+---
82+ hw/acpi/pcihp.c | 10 ++++++++++
83+ 1 file changed, 10 insertions(+)
84+
85+Index: qemu/hw/acpi/pcihp.c
86+===================================================================
87+--- a/hw/acpi/pcihp.c 2023-05-18 15:08:26.031339792 -0400
88++++ b/hw/acpi/pcihp.c 2023-05-18 15:08:26.027339825 -0400
89+@@ -429,6 +429,16 @@
90+ * acpi_pcihp_eject_slot() when the operation is completed.
91+ */
92+ pdev->qdev.pending_deleted_event = true;
93++ /* if unplug was requested before OSPM is initialized,
94++ * linux kernel will clear GPE0.sts[] bits during boot, which effectively
95++ * hides unplug event. And than followup qmp_device_del() calls remain
96++ * blocked by above flag permanently.
97++ * Unblock qmp_device_del() by setting expire limit, so user can
98++ * repeat unplug request later when OSPM has been booted.
99++ */
100++ pdev->qdev.pending_deleted_expires_ms =
101++ qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL); /* 1 msec */
102++
103+ s->acpi_pcihp_pci_status[bsel].down |= (1U << slot);
104+ acpi_send_event(DEVICE(hotplug_dev), ACPI_PCI_HOTPLUG_STATUS);
105+ }

Subscribers

People subscribed via source and target branches