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

Proposed by Sergio Durigan Junior
Status: Merged
Approved by: git-ubuntu bot
Approved revision: not available
Merged at revision: 994a3ecff4b01a9fc27d2a6eb4239ddfbbe0d37d
Proposed branch: ~sergiodj/ubuntu/+source/qemu:allow-repeating-hot-unplug-kinetic
Merge into: ubuntu/+source/qemu:ubuntu/kinetic-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+443832@code.launchpad.net

Description of the change

This MP is the Kinetic 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-kinetic-sergiodj-qemu/?format=plain)
  qemu @ amd64:
    30.05.23 08:20:08 Log 🗒️ ✅ Triggers: qemu/1:7.0+dfsg-7ubuntu2.5~ppa1
  qemu @ armhf:
    30.05.23 04:21:22 Log 🗒️ ✅ Triggers: qemu/1:7.0+dfsg-7ubuntu2.5~ppa1
  qemu @ ppc64el:
    30.05.23 00:19:06 Log 🗒️ ✅ Triggers: qemu/1:7.0+dfsg-7ubuntu2.5~ppa1

I'll post the results for arm64 and s390x when I have them.

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

Also looks good to me, matches up with mantic, jammy, and lunar

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 :

Thanks. Uploaded after fixing the path in the diff.

$ dput qemu_7.0+dfsg-7ubuntu2.5_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /home/sergio/work/qemu/qemu_7.0+dfsg-7ubuntu2.5_source.changes: Valid signature from 106DA1C8C3CBBF14
Checking signature on .dsc
gpg: /home/sergio/work/qemu/qemu_7.0+dfsg-7ubuntu2.5.dsc: Valid signature from 106DA1C8C3CBBF14
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading qemu_7.0+dfsg-7ubuntu2.5.dsc: done.
  Uploading qemu_7.0+dfsg-7ubuntu2.5.debian.tar.xz: done.
  Uploading qemu_7.0+dfsg-7ubuntu2.5_source.buildinfo: done.
  Uploading qemu_7.0+dfsg-7ubuntu2.5_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 fbd40f9..85f36bd 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+qemu (1:7.0+dfsg-7ubuntu2.5) kinetic; 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 17:38:19 -0400
13+
14 qemu (1:7.0+dfsg-7ubuntu2.4) kinetic; urgency=medium
15
16 * d/p/u/lp-2019766-target-arm-kvm-Retry-KVM_CREATE_VM-call-if-it-fails-.patch:
17diff --git a/debian/patches/series b/debian/patches/series
18index a58b213..6173884 100644
19--- a/debian/patches/series
20+++ b/debian/patches/series
21@@ -48,3 +48,4 @@ ubuntu/lp-1999885-s390x-tod-kvm-don-t-save-restore-the-TOD-in-PV-guest.patch
22 ubuntu/lp-2011832-target-mips-Fix-df_extract_val-and-df_extract_df-dfe.patch
23 ubuntu/lp-2011832-target-mips-Fix-FTRUNC_S-and-FTRUNC_U-trans-helper.patch
24 ubuntu/lp-2019766-target-arm-kvm-Retry-KVM_CREATE_VM-call-if-it-fails-.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..ad31818
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-26 16:04:30.563072680 -0400
88++++ b/hw/acpi/pcihp.c 2023-05-26 16:04:30.563072680 -0400
89+@@ -425,6 +425,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