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
diff --git a/debian/changelog b/debian/changelog
index fbd40f9..85f36bd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
1qemu (1:7.0+dfsg-7ubuntu2.5) kinetic; urgency=medium
2
3 * d/p/u/allow-repeating-hot-unplug-requests.patch: Allow repeating
4 hot-unplug requests by making ACPI PCI able to requeue them.
5 (LP: #2018733)
6
7 -- Sergio Durigan Junior <sergio.durigan@canonical.com> Fri, 26 May 2023 17:38:19 -0400
8
1qemu (1:7.0+dfsg-7ubuntu2.4) kinetic; urgency=medium9qemu (1:7.0+dfsg-7ubuntu2.4) kinetic; urgency=medium
210
3 * d/p/u/lp-2019766-target-arm-kvm-Retry-KVM_CREATE_VM-call-if-it-fails-.patch:11 * d/p/u/lp-2019766-target-arm-kvm-Retry-KVM_CREATE_VM-call-if-it-fails-.patch:
diff --git a/debian/patches/series b/debian/patches/series
index a58b213..6173884 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -48,3 +48,4 @@ ubuntu/lp-1999885-s390x-tod-kvm-don-t-save-restore-the-TOD-in-PV-guest.patch
48ubuntu/lp-2011832-target-mips-Fix-df_extract_val-and-df_extract_df-dfe.patch48ubuntu/lp-2011832-target-mips-Fix-df_extract_val-and-df_extract_df-dfe.patch
49ubuntu/lp-2011832-target-mips-Fix-FTRUNC_S-and-FTRUNC_U-trans-helper.patch49ubuntu/lp-2011832-target-mips-Fix-FTRUNC_S-and-FTRUNC_U-trans-helper.patch
50ubuntu/lp-2019766-target-arm-kvm-Retry-KVM_CREATE_VM-call-if-it-fails-.patch50ubuntu/lp-2019766-target-arm-kvm-Retry-KVM_CREATE_VM-call-if-it-fails-.patch
51ubuntu/allow-repeating-hot-unplug-requests.patch
diff --git a/debian/patches/ubuntu/allow-repeating-hot-unplug-requests.patch b/debian/patches/ubuntu/allow-repeating-hot-unplug-requests.patch
51new file mode 10064452new file mode 100644
index 0000000..ad31818
--- /dev/null
+++ b/debian/patches/ubuntu/allow-repeating-hot-unplug-requests.patch
@@ -0,0 +1,74 @@
1From 0f689cf5ada4d5df5ab95c7f7aa9fc221afa855d Mon Sep 17 00:00:00 2001
2From: Igor Mammedov <imammedo@redhat.com>
3Date: Tue, 18 Apr 2023 11:04:49 +0200
4Subject: [PATCH] acpi: pcihp: allow repeating hot-unplug requests
5
6with Q35 using ACPI PCI hotplug by default, user's request to unplug
7device is ignored when it's issued before guest OS has been booted.
8And any additional attempt to request device hot-unplug afterwards
9results in following error:
10
11 "Device XYZ is already in the process of unplug"
12
13arguably it can be considered as a regression introduced by [2],
14before which it was possible to issue unplug request multiple
15times.
16
17Accept new uplug requests after timeout (1ms). This brings ACPI PCI
18hotplug on par with native PCIe unplug behavior [1] and allows user
19to repeat unplug requests at propper times.
20Set expire timeout to arbitrary 1msec so user won't be able to
21flood guest with SCI interrupts by calling device_del in tight loop.
22
23PS:
24ACPI spec doesn't mandate what OSPM can do with GPEx.status
25bits set before it's booted => it's impl. depended.
26Status bits may be retained (I tested with one Windows version)
27or cleared (Linux since 2.6 kernel times) during guest's ACPI
28subsystem initialization.
29Clearing status bits (though not wrong per se) hides the unplug
30event from guest, and it's upto user to repeat device_del later
31when guest is able to handle unplug requests.
32
331) 18416c62e3 ("pcie: expire pending delete")
342)
35Fixes: cce8944cc9ef ("qdev-monitor: Forbid repeated device_del")
36Signed-off-by: Igor Mammedov <imammedo@redhat.com>
37Acked-by: Gerd Hoffmann <kraxel@redhat.com>
38CC: mst@redhat.com
39CC: anisinha@redhat.com
40CC: jusual@redhat.com
41CC: kraxel@redhat.com
42Message-Id: <20230418090449.2155757-1-imammedo@redhat.com>
43Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
44Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
45Reviewed-by: Ani Sinha <anisinha@redhat.com>
46
47Origin: upstream, https://gitlab.com/qemu-project/qemu/-/commit/0f689cf5ada4
48Bug: https://gitlab.com/libvirt/libvirt/-/issues/309
49Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2018733
50---
51 hw/acpi/pcihp.c | 10 ++++++++++
52 1 file changed, 10 insertions(+)
53
54Index: qemu/hw/acpi/pcihp.c
55===================================================================
56--- a/hw/acpi/pcihp.c 2023-05-26 16:04:30.563072680 -0400
57+++ b/hw/acpi/pcihp.c 2023-05-26 16:04:30.563072680 -0400
58@@ -425,6 +425,16 @@
59 * acpi_pcihp_eject_slot() when the operation is completed.
60 */
61 pdev->qdev.pending_deleted_event = true;
62+ /* if unplug was requested before OSPM is initialized,
63+ * linux kernel will clear GPE0.sts[] bits during boot, which effectively
64+ * hides unplug event. And than followup qmp_device_del() calls remain
65+ * blocked by above flag permanently.
66+ * Unblock qmp_device_del() by setting expire limit, so user can
67+ * repeat unplug request later when OSPM has been booted.
68+ */
69+ pdev->qdev.pending_deleted_expires_ms =
70+ qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL); /* 1 msec */
71+
72 s->acpi_pcihp_pci_status[bsel].down |= (1U << slot);
73 acpi_send_event(DEVICE(hotplug_dev), ACPI_PCI_HOTPLUG_STATUS);
74 }

Subscribers

People subscribed via source and target branches