Skip to content

Commit 06c7893

Browse files
authored
Merge pull request #13 from xcp-ng-rpms/QC-XCPNG-2834
Only two new patches added, albeit in the middle of the patch-queue so all the patch indexes have changed. Branches imported onto: - https://github.com/xcp-ng/qemu-dp/tree/qemu/xenserver-4.2.1-5.2.17/base - https://github.com/xcp-ng/qemu-dp/tree/qemu/xcpng-4.2.1-5.2.17.1/base You can review the patch-queue changes more easily using the git-review-rebase (PR in review xcp-ng/xcp#782) using: git-review-rebase.py qemu/xenserver-4.2.1-5.2.15/pre-base..qemu/xenserver-4.2.1-5.2.15/base qemu/xenserver-4.2.1-5.2.17/pre-base..qemu/xenserver-4.2.1-5.2.17/base For diffing the spec changes more easily: git diff --word-diff-regex='[^[:space:]]|Patch[0-9]+:' origin/master..QC-XCPNG-2834 -- SPECS The added commits are not merged upstream yet but can be found under review: - https://patchwork.ozlabs.org/project/qemu-devel/patch/20260108132514.1862552-1-ross.lagerwall@citrix.com/ - https://patchwork.ozlabs.org/project/qemu-devel/patch/20260107135824.1681685-1-ross.lagerwall@citrix.com/ Also included is a fix for an earlier bogus date in the changelog entries which I caught by chance.
2 parents fdc77b6 + 4701a9b commit 06c7893

File tree

3 files changed

+136
-56
lines changed

3 files changed

+136
-56
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
xen-hvm: Handle framebuffer relocation
2+
3+
It is possible for a guest to relocate the linear framebuffer by writing to the
4+
BAR. This causes QEMU to report an error and if the VM is migrated, the
5+
destination QEMU hits an assertion.
6+
The problem is that updating the BAR causes the PCI core code to call the del
7+
region callback followed by the add region callback but the xen-hvm code
8+
ignores the del region call and therefore the subsequent call to
9+
xen_relocate_memory() during the add region callback fails because the source
10+
address is not correct.
11+
12+
Handle remove region events for the linear framebuffer to fix this issue.
13+
14+
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
15+
diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
16+
index 4f2800aea35b..fd66875f13ba 100644
17+
--- a/hw/i386/xen/xen-hvm.c
18+
+++ b/hw/i386/xen/xen-hvm.c
19+
@@ -522,7 +522,7 @@ static void xen_set_memory(struct MemoryListener *listener,
20+
return;
21+
}
22+
23+
- if (log_dirty != add) {
24+
+ if (!(log_dirty == add || (section->mr == framebuffer && start_addr > 0xbffff))) {
25+
return;
26+
}
27+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
qmp: Fix race causing events to be sent during negotiation
2+
3+
As per the QMP spec, asynchronous messages should not be sent during
4+
negotiation.
5+
6+
The event sending code checks if the monitor is in the negotiation phase
7+
by checking for mon->commands != qmp_cap_negotiation_commands. However,
8+
events may be incorrectly sent from the point the connection is opened
9+
to when monitor_qmp_event() sets the negotiation phase.
10+
11+
Ensure it is always in the negotiation phase when a connection is opened
12+
by initializing it during monitor init and close.
13+
14+
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
15+
diff --git a/monitor/qmp.c b/monitor/qmp.c
16+
index b67a8e7d1f63..19e2edfd1cf8 100644
17+
--- a/monitor/qmp.c
18+
+++ b/monitor/qmp.c
19+
@@ -344,7 +344,6 @@ static void monitor_qmp_event(void *opaque, int event)
20+
21+
switch (event) {
22+
case CHR_EVENT_OPENED:
23+
- mon->commands = &qmp_cap_negotiation_commands;
24+
monitor_qmp_caps_reset(mon);
25+
data = qmp_greeting(mon);
26+
qmp_send_response(mon, data);
27+
@@ -364,6 +363,7 @@ static void monitor_qmp_event(void *opaque, int event)
28+
mon, NULL);
29+
mon_refcount--;
30+
monitor_fdsets_cleanup();
31+
+ mon->commands = &qmp_cap_negotiation_commands;
32+
break;
33+
}
34+
}
35+
@@ -398,6 +398,7 @@ void monitor_init_qmp(Chardev *chr, bool pretty)
36+
monitor_data_init(&mon->common, true, false,
37+
qemu_chr_has_feature(chr, QEMU_CHAR_FEATURE_GCONTEXT));
38+
39+
+ mon->commands = &qmp_cap_negotiation_commands;
40+
mon->pretty = pretty;
41+
42+
qemu_mutex_init(&mon->qmp_queue_lock);

SPECS/qemu.spec

Lines changed: 67 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
%global package_speccommit 7b0c9239c41cc92fffdcb233ec05c1c74d737941
1+
%global package_speccommit fd46ddb1d9e304c24c87622b68dc8dc1ec72a856
22
%global usver 4.2.1
3-
%global xsver 5.2.15
3+
%global xsver 5.2.17
44
%global xsrel %{xsver}%{?xscount}%{?xshash}
55
%global package_srccommit v4.2.1
66

77
# submodule ui/keycodemapdb
88
%define keycodemapdb_cset 22b8996dba9041874845c7446ce89ec4ae2b713d
9-
%define keycodemapdb_path ui/keycodemapdb
9+
%define keycodemapdb_path ui%2fkeycodemapdb
1010

1111
# Control whether we build with the address sanitizer.
1212
%define with_asan 0
@@ -15,7 +15,7 @@ Summary: qemu-dm device model
1515
Name: qemu
1616
Epoch: 2
1717
Version: 4.2.1
18-
Release: %{?xsrel}.2%{?dist}
18+
Release: %{?xsrel}.1%{?dist}
1919
License: GPL
2020
Requires: xcp-clipboardd
2121
Requires: xengt-userspace
@@ -92,57 +92,59 @@ Patch64: tpm_emulator-Avoid-double-initialization-during-migr.patch
9292
Patch65: tpm_crb-Avoid-backend-startup-just-before-shutdown-u.patch
9393
Patch66: token-bucket-event-throttling.patch
9494
Patch67: xen-hvm-Avoid-livelock-while-handling-buffered-ioreq.patch
95-
Patch68: 0001-pc-Do-not-expect-to-have-a-fw_cfg-device.patch
96-
Patch69: 0003-xen-apic-Implement-unrealize.patch
97-
Patch70: 0004-hotplug-Implement-legacy-CPU-hot-unplug.patch
98-
Patch71: igd-upt.patch
99-
Patch72: check-unmigratable-devices-when-saving.patch
100-
Patch73: query-migratable.patch
101-
Patch74: 0001-nvme-simplify-namespace-code.patch
102-
Patch75: 0002-nvme-move-device-parameters-to-separate-struct.patch
103-
Patch76: 0003-nvme-fix-lpa-field.patch
104-
Patch77: 0004-nvme-add-missing-fields-in-identify-controller.patch
105-
Patch78: 0005-nvme-populate-the-mandatory-subnqn-and-ver-fields.patch
106-
Patch79: 0006-nvme-support-completion-queue-in-cmb.patch
107-
Patch80: 0007-nvme-support-Abort-command.patch
108-
Patch81: 0008-nvme-refactor-device-realization.patch
109-
Patch82: 0009-nvme-support-Asynchronous-Event-Request-command.patch
110-
Patch83: 0010-nvme-support-Get-Log-Page-command.patch
111-
Patch84: 0011-nvme-add-missing-mandatory-Features.patch
112-
Patch85: 0012-nvme-bump-supported-NVMe-revision-to-1.3d.patch
113-
Patch86: 0013-nvme-simplify-dma-cmb-mappings.patch
114-
Patch87: 0014-nvme-support-multiple-block-requests-per-request.patch
115-
Patch88: 0015-nvme-support-scatter-gather-lists.patch
116-
Patch89: 0016-nvme-support-multiple-namespaces.patch
117-
Patch90: nvme-ns-allow-inactive.patch
118-
Patch91: nvme-close-backend.patch
119-
Patch92: 0001-hw-block-nvme-open-code-for-volatile-write-cache.patch
120-
Patch93: 0001-hw-block-nvme-Fix-a-build-error-in-nvme_get_feature.patch
121-
Patch94: 0001-Add-qemu-qcode-support-for-keys-F13-to-F24.patch
122-
Patch95: 0001-ps2-Don-t-send-key-release-event-for-Lang1-Lang2-key.patch
123-
Patch96: 0001-CP-20436-Introduce-a-config-option-for-machines-comp.patch
124-
Patch97: pci-add-subsystem-id-properties.patch
125-
Patch98: pci-add-revision_id-property.patch
126-
Patch99: force-lba-geometry.patch
127-
Patch100: 0001-CP-21767-Don-t-accidently-unplug-ourselves-if-PCI_CL.patch
128-
Patch101: 0001-CP-21434-Implement-VBE-LFB-physical-address-register.patch
129-
Patch102: 0001-CA-256542-Workaround-unassigned-accesses-caused-by-b.patch
130-
Patch103: match-xen-pvdevice-location.patch
131-
Patch104: 0001-CA-289906-Use-legacy-HID-descriptors-for-USB-Tablet-.patch
132-
Patch105: revert_hw-i386__remove_deprecated_machines_pc-0.10_and_pc-0.11.patch
133-
Patch106: 0001-CP-17697-Initial-port-of-NVIDIA-VGPU-support-from-QEMU-trad.patch
134-
Patch107: usb-batch-frames.patch
135-
Patch108: 0001-CP-23753-Talk-to-new-clipboard-daemon.patch
136-
Patch109: gvt-g.patch
137-
Patch110: allocate-guest-ram-reserved.patch
138-
Patch111: unplug-nvme-devices.patch
139-
Patch112: do_not_register_xen_backend_for_qdisk.patch
140-
Patch113: add-an-ide-read-cache.patch
141-
Patch114: disable-dirty-vram-tracking.patch
142-
Patch115: build-configuration.patch
143-
Patch116: 0001-CP-46162-Resolve-the-Null-pointer-error-in-configure.patch
144-
Patch117: 81ef3d06c970c6b7ae4971ad552b2287af376f43.patch
145-
Patch118: msix_pba_log.patch
95+
Patch68: handle-framebuffer-relocation.patch
96+
Patch69: qmp-Fix-race-causing-events-to-be-sent-during-negotiation.patch
97+
Patch70: 0001-pc-Do-not-expect-to-have-a-fw_cfg-device.patch
98+
Patch71: 0003-xen-apic-Implement-unrealize.patch
99+
Patch72: 0004-hotplug-Implement-legacy-CPU-hot-unplug.patch
100+
Patch73: igd-upt.patch
101+
Patch74: check-unmigratable-devices-when-saving.patch
102+
Patch75: query-migratable.patch
103+
Patch76: 0001-nvme-simplify-namespace-code.patch
104+
Patch77: 0002-nvme-move-device-parameters-to-separate-struct.patch
105+
Patch78: 0003-nvme-fix-lpa-field.patch
106+
Patch79: 0004-nvme-add-missing-fields-in-identify-controller.patch
107+
Patch80: 0005-nvme-populate-the-mandatory-subnqn-and-ver-fields.patch
108+
Patch81: 0006-nvme-support-completion-queue-in-cmb.patch
109+
Patch82: 0007-nvme-support-Abort-command.patch
110+
Patch83: 0008-nvme-refactor-device-realization.patch
111+
Patch84: 0009-nvme-support-Asynchronous-Event-Request-command.patch
112+
Patch85: 0010-nvme-support-Get-Log-Page-command.patch
113+
Patch86: 0011-nvme-add-missing-mandatory-Features.patch
114+
Patch87: 0012-nvme-bump-supported-NVMe-revision-to-1.3d.patch
115+
Patch88: 0013-nvme-simplify-dma-cmb-mappings.patch
116+
Patch89: 0014-nvme-support-multiple-block-requests-per-request.patch
117+
Patch90: 0015-nvme-support-scatter-gather-lists.patch
118+
Patch91: 0016-nvme-support-multiple-namespaces.patch
119+
Patch92: nvme-ns-allow-inactive.patch
120+
Patch93: nvme-close-backend.patch
121+
Patch94: 0001-hw-block-nvme-open-code-for-volatile-write-cache.patch
122+
Patch95: 0001-hw-block-nvme-Fix-a-build-error-in-nvme_get_feature.patch
123+
Patch96: 0001-Add-qemu-qcode-support-for-keys-F13-to-F24.patch
124+
Patch97: 0001-ps2-Don-t-send-key-release-event-for-Lang1-Lang2-key.patch
125+
Patch98: 0001-CP-20436-Introduce-a-config-option-for-machines-comp.patch
126+
Patch99: pci-add-subsystem-id-properties.patch
127+
Patch100: pci-add-revision_id-property.patch
128+
Patch101: force-lba-geometry.patch
129+
Patch102: 0001-CP-21767-Don-t-accidently-unplug-ourselves-if-PCI_CL.patch
130+
Patch103: 0001-CP-21434-Implement-VBE-LFB-physical-address-register.patch
131+
Patch104: 0001-CA-256542-Workaround-unassigned-accesses-caused-by-b.patch
132+
Patch105: match-xen-pvdevice-location.patch
133+
Patch106: 0001-CA-289906-Use-legacy-HID-descriptors-for-USB-Tablet-.patch
134+
Patch107: revert_hw-i386__remove_deprecated_machines_pc-0.10_and_pc-0.11.patch
135+
Patch108: 0001-CP-17697-Initial-port-of-NVIDIA-VGPU-support-from-QEMU-trad.patch
136+
Patch109: usb-batch-frames.patch
137+
Patch110: 0001-CP-23753-Talk-to-new-clipboard-daemon.patch
138+
Patch111: gvt-g.patch
139+
Patch112: allocate-guest-ram-reserved.patch
140+
Patch113: unplug-nvme-devices.patch
141+
Patch114: do_not_register_xen_backend_for_qdisk.patch
142+
Patch115: add-an-ide-read-cache.patch
143+
Patch116: disable-dirty-vram-tracking.patch
144+
Patch117: build-configuration.patch
145+
Patch118: 0001-CP-46162-Resolve-the-Null-pointer-error-in-configure.patch
146+
Patch119: 81ef3d06c970c6b7ae4971ad552b2287af376f43.patch
147+
Patch120: msix_pba_log.patch
146148

147149
# XCP-ng patches
148150
Patch1000: qemu-4.2.1-CVE-2023-3354.backport.patch
@@ -240,6 +242,15 @@ cp -r scripts/qmp %{buildroot}%{_datarootdir}/qemu
240242
%{?_cov_results_package}
241243

242244
%changelog
245+
246+
* Mon Feb 02 2026 Quentin Casasnovas <quentin.casasnovas@vates.tech> - 4.2.1-5.2.17.1
247+
- Sync with 4.2.1-5.2.17
248+
- *** Upstream changelog ***
249+
* Thu Jan 08 2026 Ross Lagerwall <ross.lagerwall@citrix.com> - 4.2.1-5.2.17
250+
- CA-407410: qmp: Fix race causing events to be sent during negotiation
251+
* Mon Dec 01 2025 Ross Lagerwall <ross.lagerwall@citrix.com> - 4.2.1-5.2.16
252+
- CA-420202: xen-hvm: Handle framebuffer relocation
253+
243254
* Thu Jan 08 2026 Thierry Escande <thierry.escande@vates.tech> - 4.2.1-5.2.15.2
244255
- Backport fixes for CVE-2021-3929
245256

@@ -249,7 +260,7 @@ cp -r scripts/qmp %{buildroot}%{_datarootdir}/qemu
249260
* Thu Oct 23 2025 Roger Pau Monné <roger.pau@citrix.com> - 4.2.1-5.2.15
250261
- Allow passthrough of devices from a PCI segment different than 0.
251262

252-
* Tue Nov 17 2025 Tu Dinh <ngoc-tu.dinh@vates.tech> - 4.2.1-5.2.14.1
263+
* Mon Nov 17 2025 Tu Dinh <ngoc-tu.dinh@vates.tech> - 4.2.1-5.2.14.1
253264
- Sync with 4.2.1-5.2.14
254265
- Remove 0001-nvme-Don-t-check-NSID-in-NVME_VOLATILE_WRITE_CACHE.patch in favor of XenServer's fix
255266
- *** Upstream changelog ***

0 commit comments

Comments
 (0)