Merge ~paelzer/ubuntu/+source/libvirt:lp-1921880-1921754-amd-epyc-1922907-stepping-parsing-FOCAL into ubuntu/+source/libvirt:ubuntu/focal-devel

Proposed by Christian Ehrhardt 
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: da9685885ba232dc8009f605c9b503b8a4938f71
Merge reported by: Christian Ehrhardt 
Merged at revision: da9685885ba232dc8009f605c9b503b8a4938f71
Proposed branch: ~paelzer/ubuntu/+source/libvirt:lp-1921880-1921754-amd-epyc-1922907-stepping-parsing-FOCAL
Merge into: ubuntu/+source/libvirt:ubuntu/focal-devel
Diff against target: 7404 lines (+7112/-0)
48 files modified
debian/changelog (+12/-0)
debian/patches/series (+46/-0)
debian/patches/ubuntu/lp-1921754-cpumap-Add-support-for-ibrs-CPU-feature.patch (+59/-0)
debian/patches/ubuntu/lp-1921880-cpu_map-Add-EPYC-Milan-x86-CPU-model.patch (+129/-0)
debian/patches/ubuntu/lp-1921880-cpu_map-Add-support-for-fsrm-CPU-feature.patch (+73/-0)
debian/patches/ubuntu/lp-1921880-cpu_map-Fix-spelling-of-svme-addr-chk-feature.patch (+51/-0)
debian/patches/ubuntu/lp-1921880-cpu_map-Install-x86_EPYC-Milan.xml.patch (+39/-0)
debian/patches/ubuntu/lp-1921880-cpumap-Add-support-for-svme-addr-check-CPU-feature.patch (+33/-0)
debian/patches/ubuntu/lp-1922907-cleanup-test-data.patch (+28/-0)
debian/patches/ubuntu/lp-1922907-cpu_map-Distinguish-Cascadelake-Server-from-Skylake-.patch (+151/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Add-support-for-stepping-part-of-CPU-signatu.patch (+180/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Don-t-check-return-value-of-x86ModelCopy.patch (+71/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Drop-noTSX-hint-for-incompatible-CPUs.patch (+99/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Introduce-virCPUx86SignatureFromCPUID.patch (+68/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Introduce-virCPUx86SignaturesFree.patch (+61/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Move-and-rename-x86FormatSignatures.patch (+85/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Move-and-rename-x86ModelCopySignatures.patch (+97/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Move-and-rename-x86ModelHasSignature.patch (+98/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Replace-32b-signatures-in-virCPUx86Model-wit.patch (+317/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Baseline.patch (+157/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86CheckFeature.patch (+51/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Compare.patch (+66/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86CopyMigratable.patch (+51/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86DataParse.patch (+84/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86ExpandFeatures.patch (+83/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86GetHost.patch (+68/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86LoadMap.patch (+48/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Translate.patch (+82/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Update.patch (+70/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86UpdateLive.patch (+101/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86Compute.patch (+178/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86DataToCPU.patch (+68/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86Decode.patch (+96/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86Encode.patch (+138/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86EncodePolicy.patch (+43/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86FeatureParse.patch (+112/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86ModelFromCPU.patch (+71/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86ModelParse.patch (+77/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86UpdateHostModel.patch (+68/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86VendorParse.patch (+73/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPU-x86-Data.patch (+142/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Feature.patch (+71/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Map.patch (+66/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Model.patch (+100/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Vendor.patch (+50/-0)
debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-in-virCPUx86GetModels.patch (+49/-0)
debian/patches/ubuntu/lp-1922907-cputest-Add-data-for-Intel-R-Xeon-R-Gold-6130-CPU.patch (+1460/-0)
debian/patches/ubuntu/lp-1922907-cputest-Add-data-for-Intel-R-Xeon-R-Platinum-9242-CP.patch (+1692/-0)
Reviewer Review Type Date Requested Status
Robie Basak sru Approve
Canonical Server Pending
git-ubuntu developers Pending
Review via email: mp+401371@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Revision history for this message
Robie Basak (racb) :
review: Approve (sru)
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks for the Review Robie!

FYI tests also completed (again in a more complete fashion) and LGTM:

prep (x86_64) : Pass 25 F/S/N 0/0/0 - RC 0 (15 min 44428 lin)
migrate (x86_64) : Pass 720 F/S/N 36/0/0 - RC 36 (496 min 820003 lin)
cross (x86_64) : Pass 58 F/S/N 0/1/2 - RC 0 (82 min 100241 lin)
misc (x86_64) : Pass 219 F/S/N 0/0/0 - RC 0 (84 min 120581 lin)

prep (s390x) : Pass 25 F/S/N 0/0/0 - RC 0 (14 min 31196 lin)
migrate (s390x) : Pass 804 F/S/N 0/15/0 - RC 0 (311 min 517498 lin)
cross (s390x) : Pass 62 F/S/N 0/1/1 - RC 0 (94 min 93721 lin)
misc (s390x) : Pass 199 F/S/N 2/0/0 - RC 2 (78 min 94668 lin)

The 36 fails in x86 are an issue with postcopy-after-precopy that isn't due to this new version.
The 2 fails on s390x are a real issue in Hirsute guests, but not due to these updates.
The tests above included F/G/H releases.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hirsute completed uploading focal

To ssh://git.launchpad.net/~usd-import-team/ubuntu/+source/libvirt
 * [new tag] upload/6.0.0-0ubuntu8.9 -> upload/6.0.0-0ubuntu8.9

Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading libvirt_6.0.0-0ubuntu8.9.dsc: done.
  Uploading libvirt_6.0.0-0ubuntu8.9.debian.tar.xz: done.
  Uploading libvirt_6.0.0-0ubuntu8.9_source.buildinfo: done.
  Uploading libvirt_6.0.0-0ubuntu8.9_source.changes: done.
Successfully uploaded packages.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

This is in F/G-proposed, setting the MP to merged

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 443bb33..fa7efba 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,15 @@
6+libvirt (6.0.0-0ubuntu8.9) focal; urgency=medium
7+
8+ * d/p/u/lp-1921754*: add EPYC-Rome-v2 as v1 missed IBRS and thereby fails
9+ on some HW/Guest combinations e.g. Windows 10 on Threadripper
10+ (LP: #1921754)
11+ * d/p/u/lp-1921880*: add EPYC-Milan features and named cpu type support
12+ (LP: #1921880)
13+ * d/p/u/lp-1922907: add ability to parse cpu stepping and thereby correctly
14+ differentiate skylake and cascadelake chips (LP: #1922907)
15+
16+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Wed, 07 Apr 2021 13:33:46 +0200
17+
18 libvirt (6.0.0-0ubuntu8.8) focal; urgency=medium
19
20 * d/p/lp1915811-*: Fix NUMA topology population for machines with high number
21diff --git a/debian/patches/series b/debian/patches/series
22index dc5b7e9..33f754c 100644
23--- a/debian/patches/series
24+++ b/debian/patches/series
25@@ -109,3 +109,49 @@ ubuntu/lp-1887490-cpu_map-Remove-monitor-feature-from-EPYC-Rome.patch
26 ubuntu/lp-1913266-qemu-Add-virtio-related-options-to-vsock.patch
27 ubuntu/lp1915811-01-virnuma-Don-t-work-around-numa_node_to_cpus.patch
28 ubuntu/lp1915811-02-virnuma-Use-numa_nodes_ptr-when-checking-av.patch
29+ubuntu/lp-1921754-cpumap-Add-support-for-ibrs-CPU-feature.patch
30+ubuntu/lp-1921880-cpu_map-Add-support-for-fsrm-CPU-feature.patch
31+ubuntu/lp-1921880-cpumap-Add-support-for-svme-addr-check-CPU-feature.patch
32+ubuntu/lp-1921880-cpu_map-Add-EPYC-Milan-x86-CPU-model.patch
33+ubuntu/lp-1921880-cpu_map-Install-x86_EPYC-Milan.xml.patch
34+ubuntu/lp-1921880-cpu_map-Fix-spelling-of-svme-addr-chk-feature.patch
35+ubuntu/lp-1922907-cpu_x86-Drop-noTSX-hint-for-incompatible-CPUs.patch
36+ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPU-x86-Data.patch
37+ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Vendor.patch
38+ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Feature.patch
39+ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Model.patch
40+ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Map.patch
41+ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-in-virCPUx86GetModels.patch
42+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86DataToCPU.patch
43+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86VendorParse.patch
44+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86FeatureParse.patch
45+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86ModelFromCPU.patch
46+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86ModelParse.patch
47+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86LoadMap.patch
48+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86DataParse.patch
49+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86Compute.patch
50+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Compare.patch
51+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86Decode.patch
52+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86EncodePolicy.patch
53+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86Encode.patch
54+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86CheckFeature.patch
55+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86GetHost.patch
56+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Baseline.patch
57+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86UpdateHostModel.patch
58+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Update.patch
59+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86UpdateLive.patch
60+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Translate.patch
61+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86ExpandFeatures.patch
62+ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86CopyMigratable.patch
63+ubuntu/lp-1922907-cpu_x86-Move-and-rename-x86ModelCopySignatures.patch
64+ubuntu/lp-1922907-cpu_x86-Move-and-rename-x86ModelHasSignature.patch
65+ubuntu/lp-1922907-cpu_x86-Move-and-rename-x86FormatSignatures.patch
66+ubuntu/lp-1922907-cpu_x86-Introduce-virCPUx86SignaturesFree.patch
67+ubuntu/lp-1922907-cpu_x86-Introduce-virCPUx86SignatureFromCPUID.patch
68+ubuntu/lp-1922907-cpu_x86-Replace-32b-signatures-in-virCPUx86Model-wit.patch
69+ubuntu/lp-1922907-cpu_x86-Don-t-check-return-value-of-x86ModelCopy.patch
70+ubuntu/lp-1922907-cpu_x86-Add-support-for-stepping-part-of-CPU-signatu.patch
71+ubuntu/lp-1922907-cputest-Add-data-for-Intel-R-Xeon-R-Platinum-9242-CP.patch
72+ubuntu/lp-1922907-cputest-Add-data-for-Intel-R-Xeon-R-Gold-6130-CPU.patch
73+ubuntu/lp-1922907-cpu_map-Distinguish-Cascadelake-Server-from-Skylake-.patch
74+ubuntu/lp-1922907-cleanup-test-data.patch
75diff --git a/debian/patches/ubuntu/lp-1921754-cpumap-Add-support-for-ibrs-CPU-feature.patch b/debian/patches/ubuntu/lp-1921754-cpumap-Add-support-for-ibrs-CPU-feature.patch
76new file mode 100644
77index 0000000..5cd251d
78--- /dev/null
79+++ b/debian/patches/ubuntu/lp-1921754-cpumap-Add-support-for-ibrs-CPU-feature.patch
80@@ -0,0 +1,59 @@
81+From 5c17a7ba41670f3182186c06e621995b5d03fc95 Mon Sep 17 00:00:00 2001
82+From: Tim Wiederhake <twiederh@redhat.com>
83+Date: Mon, 22 Feb 2021 13:20:09 +0100
84+Subject: [PATCH] cpumap: Add support for ibrs CPU feature
85+
86+Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
87+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
88+
89+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=5c17a7ba
90+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1921754
91+Last-Update: 2021-04-07
92+
93+---
94+ src/cpu_map/x86_features.xml | 3 +++
95+ tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-guest.xml | 1 +
96+ tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-host.xml | 1 +
97+ 3 files changed, 5 insertions(+)
98+
99+diff --git a/src/cpu_map/x86_features.xml b/src/cpu_map/x86_features.xml
100+index 5cfa07502a..b03a6b065d 100644
101+--- a/src/cpu_map/x86_features.xml
102++++ b/src/cpu_map/x86_features.xml
103+@@ -507,6 +507,9 @@
104+ <feature name='ibpb'>
105+ <cpuid eax_in='0x80000008' ebx='0x00001000'/>
106+ </feature>
107++ <feature name='ibrs'>
108++ <cpuid eax_in='0x80000008' ebx='0x00004000'/>
109++ </feature>
110+ <feature name='amd-stibp'>
111+ <cpuid eax_in='0x80000008' ebx='0x00008000'/>
112+ </feature>
113+diff --git a/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-guest.xml b/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-guest.xml
114+index 6d95b508b2..40e7912398 100644
115+--- a/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-guest.xml
116++++ b/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-guest.xml
117+@@ -17,6 +17,7 @@
118+ <feature policy='require' name='topoext'/>
119+ <feature policy='require' name='perfctr_nb'/>
120+ <feature policy='require' name='invtsc'/>
121++ <feature policy='require' name='ibrs'/>
122+ <feature policy='require' name='amd-ssbd'/>
123+ <feature policy='require' name='lbrv'/>
124+ <feature policy='require' name='svm-lock'/>
125+diff --git a/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-host.xml b/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-host.xml
126+index 65eaeabdd0..9f8108cdaa 100644
127+--- a/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-host.xml
128++++ b/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-host.xml
129+@@ -18,6 +18,7 @@
130+ <feature name='topoext'/>
131+ <feature name='perfctr_nb'/>
132+ <feature name='invtsc'/>
133++ <feature name='ibrs'/>
134+ <feature name='amd-ssbd'/>
135+ <feature name='lbrv'/>
136+ <feature name='svm-lock'/>
137+--
138+2.31.1
139+
140diff --git a/debian/patches/ubuntu/lp-1921880-cpu_map-Add-EPYC-Milan-x86-CPU-model.patch b/debian/patches/ubuntu/lp-1921880-cpu_map-Add-EPYC-Milan-x86-CPU-model.patch
141new file mode 100644
142index 0000000..50710d5
143--- /dev/null
144+++ b/debian/patches/ubuntu/lp-1921880-cpu_map-Add-EPYC-Milan-x86-CPU-model.patch
145@@ -0,0 +1,129 @@
146+From f321a4822e9fa6542e48a78611989ecd9acaa83a Mon Sep 17 00:00:00 2001
147+From: Jiri Denemark <jdenemar@redhat.com>
148+Date: Mon, 1 Mar 2021 19:20:51 +0100
149+Subject: [PATCH] cpu_map: Add EPYC-Milan x86 CPU model
150+MIME-Version: 1.0
151+Content-Type: text/plain; charset=UTF-8
152+Content-Transfer-Encoding: 8bit
153+
154+Introduced in QEMU 6.0.0 by 623972ceae091b31331ae4a1dc94fe5cbb891937
155+
156+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
157+Reviewed-by: Ján Tomko <jtomko@redhat.com>
158+
159+Backport-Note: only whitespace damage
160+Origin: backport, https://libvirt.org/git/?p=libvirt.git;a=commit;h=f321a482
161+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1921880
162+Last-Update: 2021-04-07
163+
164+---
165+ src/cpu_map/index.xml | 1 +
166+ src/cpu_map/x86_EPYC-Milan.xml | 92 ++++++++++++++++++++++++++++++++++
167+ 2 files changed, 93 insertions(+)
168+ create mode 100644 src/cpu_map/x86_EPYC-Milan.xml
169+
170+--- /dev/null
171++++ b/src/cpu_map/x86_EPYC-Milan.xml
172+@@ -0,0 +1,92 @@
173++<cpus>
174++ <model name='EPYC-Milan'>
175++ <decode host='on' guest='on'/>
176++ <signature family='25' model='1'/>
177++ <vendor name='AMD'/>
178++ <feature name='3dnowprefetch'/>
179++ <feature name='abm'/>
180++ <feature name='adx'/>
181++ <feature name='aes'/>
182++ <feature name='amd-ssbd'/>
183++ <feature name='amd-stibp'/>
184++ <feature name='apic'/>
185++ <feature name='arat'/>
186++ <feature name='avx'/>
187++ <feature name='avx2'/>
188++ <feature name='bmi1'/>
189++ <feature name='bmi2'/>
190++ <feature name='clflush'/>
191++ <feature name='clflushopt'/>
192++ <feature name='clwb'/>
193++ <feature name='clzero'/>
194++ <feature name='cmov'/>
195++ <feature name='cr8legacy'/>
196++ <feature name='cx16'/>
197++ <feature name='cx8'/>
198++ <feature name='de'/>
199++ <feature name='erms'/>
200++ <feature name='f16c'/>
201++ <feature name='fma'/>
202++ <feature name='fpu'/>
203++ <feature name='fsgsbase'/>
204++ <feature name='fsrm'/>
205++ <feature name='fxsr'/>
206++ <feature name='fxsr_opt'/>
207++ <feature name='ibpb'/>
208++ <feature name='ibrs'/>
209++ <feature name='invpcid'/>
210++ <feature name='lahf_lm'/>
211++ <feature name='lm'/>
212++ <feature name='mca'/>
213++ <feature name='mce'/>
214++ <feature name='misalignsse'/>
215++ <feature name='mmx'/>
216++ <feature name='mmxext'/>
217++ <feature name='movbe'/>
218++ <feature name='msr'/>
219++ <feature name='mtrr'/>
220++ <feature name='npt'/>
221++ <feature name='nrip-save'/>
222++ <feature name='nx'/>
223++ <feature name='osvw'/>
224++ <feature name='pae'/>
225++ <feature name='pat'/>
226++ <feature name='pcid'/>
227++ <feature name='pclmuldq'/>
228++ <feature name='pdpe1gb'/>
229++ <feature name='perfctr_core'/>
230++ <feature name='pge'/>
231++ <feature name='pku'/>
232++ <feature name='pni'/>
233++ <feature name='popcnt'/>
234++ <feature name='pse'/>
235++ <feature name='pse36'/>
236++ <feature name='rdpid'/>
237++ <feature name='rdrand'/>
238++ <feature name='rdseed'/>
239++ <feature name='rdtscp'/>
240++ <feature name='sep'/>
241++ <feature name='sha-ni'/>
242++ <feature name='smap'/>
243++ <feature name='smep'/>
244++ <feature name='sse'/>
245++ <feature name='sse2'/>
246++ <feature name='sse4.1'/>
247++ <feature name='sse4.2'/>
248++ <feature name='sse4a'/>
249++ <feature name='ssse3'/>
250++ <feature name='svm'/>
251++ <feature name='svme-addr-check'/>
252++ <feature name='syscall'/>
253++ <feature name='tsc'/>
254++ <feature name='umip'/>
255++ <feature name='vme'/>
256++ <feature name='wbnoinvd'/>
257++ <feature name='xgetbv1'/>
258++ <feature name='xsave'/>
259++ <feature name='xsavec'/>
260++ <feature name='xsaveerptr'/>
261++ <feature name='xsaveopt'/>
262++ <feature name='xsaves'/>
263++ </model>
264++</cpus>
265+--- a/src/cpu_map/index.xml
266++++ b/src/cpu_map/index.xml
267+@@ -66,6 +66,7 @@
268+ <include filename="x86_EPYC.xml"/>
269+ <include filename="x86_EPYC-IBPB.xml"/>
270+ <include filename="x86_EPYC-Rome.xml"/>
271++ <include filename='x86_EPYC-Milan.xml'/>
272+
273+ <!-- Hygon CPU models -->
274+ <include filename="x86_Dhyana.xml"/>
275diff --git a/debian/patches/ubuntu/lp-1921880-cpu_map-Add-support-for-fsrm-CPU-feature.patch b/debian/patches/ubuntu/lp-1921880-cpu_map-Add-support-for-fsrm-CPU-feature.patch
276new file mode 100644
277index 0000000..72a6c0f
278--- /dev/null
279+++ b/debian/patches/ubuntu/lp-1921880-cpu_map-Add-support-for-fsrm-CPU-feature.patch
280@@ -0,0 +1,73 @@
281+From 8c5c660b99101544d8cfcb8edbe48688c04bee25 Mon Sep 17 00:00:00 2001
282+From: Tim Wiederhake <twiederh@redhat.com>
283+Date: Wed, 6 Jan 2021 11:05:06 +0100
284+Subject: [PATCH] cpu_map: Add support for fsrm CPU feature
285+
286+Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
287+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
288+
289+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=8c5c660b
290+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1921880
291+Last-Update: 2021-04-07
292+
293+---
294+ src/cpu_map/x86_features.xml | 3 +++
295+ tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-disabled.xml | 2 +-
296+ tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-guest.xml | 1 +
297+ tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-host.xml | 1 +
298+ 4 files changed, 6 insertions(+), 1 deletion(-)
299+
300+diff --git a/src/cpu_map/x86_features.xml b/src/cpu_map/x86_features.xml
301+index a55f52b16c..b0bf22d916 100644
302+--- a/src/cpu_map/x86_features.xml
303++++ b/src/cpu_map/x86_features.xml
304+@@ -339,6 +339,9 @@
305+ <feature name='avx512-4fmaps'>
306+ <cpuid eax_in='0x07' ecx_in='0x00' edx='0x00000008'/>
307+ </feature>
308++ <feature name='fsrm'>
309++ <cpuid eax_in='0x07' ecx_in='0x00' edx='0x00000010'/>
310++ </feature>
311+ <feature name='md-clear'> <!-- md_clear -->
312+ <cpuid eax_in='0x07' ecx_in='0x00' edx='0x00000400'/>
313+ </feature>
314+diff --git a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-disabled.xml b/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-disabled.xml
315+index ce65579bcc..33bd1013f0 100644
316+--- a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-disabled.xml
317++++ b/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-disabled.xml
318+@@ -1,7 +1,7 @@
319+ <!-- Features disabled by QEMU -->
320+ <cpudata arch='x86'>
321+ <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0804c1fc' edx='0xb0600000'/>
322+- <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x02001000' ecx='0x00400010' edx='0x00000000'/>
323++ <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x02001000' ecx='0x00400010' edx='0x00000010'/>
324+ <cpuid eax_in='0x0000000f' ecx_in='0x01' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000006'/>
325+ <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/>
326+ </cpudata>
327+diff --git a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-guest.xml b/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-guest.xml
328+index 9b75ace710..3a71b28cfb 100644
329+--- a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-guest.xml
330++++ b/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-guest.xml
331+@@ -24,6 +24,7 @@
332+ <feature policy='require' name='sha-ni'/>
333+ <feature policy='require' name='ospke'/>
334+ <feature policy='require' name='rdpid'/>
335++ <feature policy='require' name='fsrm'/>
336+ <feature policy='require' name='stibp'/>
337+ <feature policy='require' name='arch-capabilities'/>
338+ <feature policy='require' name='xsaves'/>
339+diff --git a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-host.xml b/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-host.xml
340+index efbf9d363b..1582de0422 100644
341+--- a/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-host.xml
342++++ b/tests/cputestdata/x86_64-cpuid-Ice-Lake-Server-host.xml
343+@@ -25,6 +25,7 @@
344+ <feature name='sha-ni'/>
345+ <feature name='ospke'/>
346+ <feature name='rdpid'/>
347++ <feature name='fsrm'/>
348+ <feature name='stibp'/>
349+ <feature name='arch-capabilities'/>
350+ <feature name='xsaves'/>
351+--
352+2.31.1
353+
354diff --git a/debian/patches/ubuntu/lp-1921880-cpu_map-Fix-spelling-of-svme-addr-chk-feature.patch b/debian/patches/ubuntu/lp-1921880-cpu_map-Fix-spelling-of-svme-addr-chk-feature.patch
355new file mode 100644
356index 0000000..8d23051
357--- /dev/null
358+++ b/debian/patches/ubuntu/lp-1921880-cpu_map-Fix-spelling-of-svme-addr-chk-feature.patch
359@@ -0,0 +1,51 @@
360+From b5abf9a192248b1005f63a7102d2627375d70fe5 Mon Sep 17 00:00:00 2001
361+From: Jiri Denemark <jdenemar@redhat.com>
362+Date: Thu, 4 Mar 2021 08:43:09 +0100
363+Subject: [PATCH] cpu_map: Fix spelling of svme-addr-chk feature
364+
365+Commit a208176ca1d9eedf8aa6bf12fde6a7a9579ab549 introduced this feature
366+with an incorrect "svme-addr-check" spelling.
367+
368+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
369+Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
370+
371+Backport-Note: sync_qemu_cpu_i386 didn't exist before v6.10
372+Origin: backport, https://libvirt.org/git/?p=libvirt.git;a=commit;h=b5abf9a1
373+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1921880
374+Last-Update: 2021-04-07
375+
376+---
377+ src/cpu_map/sync_qemu_i386.py | 2 +-
378+ src/cpu_map/x86_EPYC-Milan.xml | 2 +-
379+ src/cpu_map/x86_features.xml | 2 +-
380+ 3 files changed, 3 insertions(+), 3 deletions(-)
381+
382+diff --git a/src/cpu_map/x86_EPYC-Milan.xml b/src/cpu_map/x86_EPYC-Milan.xml
383+index 53f0cd6aac..3055e175fa 100644
384+--- a/src/cpu_map/x86_EPYC-Milan.xml
385++++ b/src/cpu_map/x86_EPYC-Milan.xml
386+@@ -76,7 +76,7 @@
387+ <feature name='sse4a'/>
388+ <feature name='ssse3'/>
389+ <feature name='svm'/>
390+- <feature name='svme-addr-check'/>
391++ <feature name='svme-addr-chk'/>
392+ <feature name='syscall'/>
393+ <feature name='tsc'/>
394+ <feature name='umip'/>
395+diff --git a/src/cpu_map/x86_features.xml b/src/cpu_map/x86_features.xml
396+index c43520d08f..e98b84f3ef 100644
397+--- a/src/cpu_map/x86_features.xml
398++++ b/src/cpu_map/x86_features.xml
399+@@ -554,7 +554,7 @@
400+ <feature name='pfthreshold'>
401+ <cpuid eax_in='0x8000000a' edx='0x00001000'/>
402+ </feature>
403+- <feature name='svme-addr-check'>
404++ <feature name='svme-addr-chk'>
405+ <cpuid eax_in='0x8000000a' edx='0x10000000'/>
406+ </feature>
407+
408+--
409+2.31.1
410+
411diff --git a/debian/patches/ubuntu/lp-1921880-cpu_map-Install-x86_EPYC-Milan.xml.patch b/debian/patches/ubuntu/lp-1921880-cpu_map-Install-x86_EPYC-Milan.xml.patch
412new file mode 100644
413index 0000000..e9e6e9f
414--- /dev/null
415+++ b/debian/patches/ubuntu/lp-1921880-cpu_map-Install-x86_EPYC-Milan.xml.patch
416@@ -0,0 +1,39 @@
417+From d3de79dbfc20dc4dfc19154b16079861c542b71e Mon Sep 17 00:00:00 2001
418+From: Jiri Denemark <jdenemar@redhat.com>
419+Date: Tue, 2 Mar 2021 10:32:42 +0100
420+Subject: [PATCH] cpu_map: Install x86_EPYC-Milan.xml
421+
422+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
423+Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
424+
425+Backport-Note: Focal is pre-meson so the patch needed to be adapted to
426+ fit the Make based build, the same that we've done in patch
427+ ubuntu/lp-1887490-cpu_map-Defined-and-enable-EPYC-Rome-model.patch
428+Origin: backport, https://libvirt.org/git/?p=libvirt.git;a=commit;h=d3de79db
429+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1921880
430+Last-Update: 2021-04-07
431+
432+---
433+ src/cpu_map/meson.build | 1 +
434+ 1 file changed, 1 insertion(+)
435+
436+--- a/src/Makefile.in
437++++ b/src/Makefile.in
438+@@ -5561,6 +5561,7 @@ cpumap_DATA = \
439+ cpu_map/x86_Dhyana.xml \
440+ cpu_map/x86_EPYC.xml \
441+ cpu_map/x86_EPYC-IBPB.xml \
442++ cpu_map/x86_EPYC-Milan.xml \
443+ cpu_map/x86_EPYC-Rome.xml \
444+ cpu_map/x86_Haswell.xml \
445+ cpu_map/x86_Haswell-IBRS.xml \
446+--- a/src/cpu_map/Makefile.inc.am
447++++ b/src/cpu_map/Makefile.inc.am
448+@@ -29,6 +29,7 @@ cpumap_DATA = \
449+ cpu_map/x86_Dhyana.xml \
450+ cpu_map/x86_EPYC.xml \
451+ cpu_map/x86_EPYC-IBPB.xml \
452++ cpu_map/x86_EPYC-Milan.xml \
453+ cpu_map/x86_EPYC-Rome.xml \
454+ cpu_map/x86_Haswell.xml \
455+ cpu_map/x86_Haswell-IBRS.xml \
456diff --git a/debian/patches/ubuntu/lp-1921880-cpumap-Add-support-for-svme-addr-check-CPU-feature.patch b/debian/patches/ubuntu/lp-1921880-cpumap-Add-support-for-svme-addr-check-CPU-feature.patch
457new file mode 100644
458index 0000000..5e5420e
459--- /dev/null
460+++ b/debian/patches/ubuntu/lp-1921880-cpumap-Add-support-for-svme-addr-check-CPU-feature.patch
461@@ -0,0 +1,33 @@
462+From 5ac6ab2fde63881d3c5cc7372a0d0e59618feb55 Mon Sep 17 00:00:00 2001
463+From: Tim Wiederhake <twiederh@redhat.com>
464+Date: Mon, 22 Feb 2021 13:20:10 +0100
465+Subject: [PATCH] cpumap: Add support for svme-addr-check CPU feature
466+
467+Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
468+Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
469+
470+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=5ac6ab2f
471+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1921880
472+Last-Update: 2021-04-07
473+
474+---
475+ src/cpu_map/x86_features.xml | 3 +++
476+ 1 file changed, 3 insertions(+)
477+
478+diff --git a/src/cpu_map/x86_features.xml b/src/cpu_map/x86_features.xml
479+index b03a6b065d..c43520d08f 100644
480+--- a/src/cpu_map/x86_features.xml
481++++ b/src/cpu_map/x86_features.xml
482+@@ -554,6 +554,9 @@
483+ <feature name='pfthreshold'>
484+ <cpuid eax_in='0x8000000a' edx='0x00001000'/>
485+ </feature>
486++ <feature name='svme-addr-check'>
487++ <cpuid eax_in='0x8000000a' edx='0x10000000'/>
488++ </feature>
489+
490+ <!-- IA32_ARCH_CAPABILITIES features -->
491+ <feature name='rdctl-no'>
492+--
493+2.31.1
494+
495diff --git a/debian/patches/ubuntu/lp-1922907-cleanup-test-data.patch b/debian/patches/ubuntu/lp-1922907-cleanup-test-data.patch
496new file mode 100644
497index 0000000..52e378e
498--- /dev/null
499+++ b/debian/patches/ubuntu/lp-1922907-cleanup-test-data.patch
500@@ -0,0 +1,28 @@
501+Description: clean up testcase data
502+ When adding
503+ lp-1887490-cpu_map-Add-pschange-mc-no-bit-in-IA32_ARCH_CAPABILI.patch
504+ in the past some cpu types where not present yet. Now that they got added
505+ by the series for LP: #1922907 the changes that were skipped back then need
506+ to be applied as the code of 1887490 changes that behavior.
507+Author: Christian Ehrhardt <christian.ehrhardt@canonical.com>
508+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=12eb0c94
509+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1922907
510+Last-Update: 2021-04-07
511+--- a/tests/cputestdata/x86_64-cpuid-Xeon-Platinum-9242-enabled.xml
512++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Platinum-9242-enabled.xml
513+@@ -6,5 +6,5 @@
514+ <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x0000000f' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/>
515+ <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000121' edx='0x2c100800'/>
516+ <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00000000' ebx='0x01001000' ecx='0x00000000' edx='0x00000000'/>
517+- <msr index='0x10a' edx='0x00000000' eax='0x000000ab'/>
518++ <msr index='0x10a' edx='0x00000000' eax='0x000000eb'/>
519+ </cpudata>
520+--- a/tests/cputestdata/x86_64-cpuid-Xeon-Platinum-9242-json.xml
521++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Platinum-9242-json.xml
522+@@ -17,5 +17,6 @@
523+ <feature policy='require' name='ibrs-all'/>
524+ <feature policy='require' name='skip-l1dfl-vmentry'/>
525+ <feature policy='require' name='mds-no'/>
526++ <feature policy='require' name='pschange-mc-no'/>
527+ <feature policy='require' name='tsx-ctrl'/>
528+ </cpu>
529diff --git a/debian/patches/ubuntu/lp-1922907-cpu_map-Distinguish-Cascadelake-Server-from-Skylake-.patch b/debian/patches/ubuntu/lp-1922907-cpu_map-Distinguish-Cascadelake-Server-from-Skylake-.patch
530new file mode 100644
531index 0000000..4ee3c48
532--- /dev/null
533+++ b/debian/patches/ubuntu/lp-1922907-cpu_map-Distinguish-Cascadelake-Server-from-Skylake-.patch
534@@ -0,0 +1,151 @@
535+From 5d6059f8ec16d64f240dc5e6413ca55a3b46b3f7 Mon Sep 17 00:00:00 2001
536+From: Jiri Denemark <jdenemar@redhat.com>
537+Date: Thu, 26 Mar 2020 21:55:14 +0100
538+Subject: [PATCH] cpu_map: Distinguish Cascadelake-Server from Skylake-Server
539+MIME-Version: 1.0
540+Content-Type: text/plain; charset=UTF-8
541+Content-Transfer-Encoding: 8bit
542+
543+The signatures of these two CPU model differ only in stepping as both
544+report family 6 and model 85. Skylake-Server uses stepping 4 or less and
545+Cascadelake-Server uses stepping 5..7.
546+
547+https://bugzilla.redhat.com/show_bug.cgi?id=1761678
548+
549+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
550+Reviewed-by: Ján Tomko <jtomko@redhat.com>
551+
552+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=5d6059f8ec
553+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
554+Last-Update: 2021-04-07
555+
556+---
557+ src/cpu_map/x86_Cascadelake-Server-noTSX.xml | 2 +-
558+ src/cpu_map/x86_Cascadelake-Server.xml | 2 +-
559+ src/cpu_map/x86_Skylake-Server-IBRS.xml | 2 +-
560+ src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml | 2 +-
561+ src/cpu_map/x86_Skylake-Server.xml | 2 +-
562+ tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-guest.xml | 5 +++--
563+ tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-json.xml | 5 +++--
564+ 7 files changed, 11 insertions(+), 9 deletions(-)
565+
566+diff --git a/src/cpu_map/x86_Cascadelake-Server-noTSX.xml b/src/cpu_map/x86_Cascadelake-Server-noTSX.xml
567+index 459174a30d..bfd4629836 100644
568+--- a/src/cpu_map/x86_Cascadelake-Server-noTSX.xml
569++++ b/src/cpu_map/x86_Cascadelake-Server-noTSX.xml
570+@@ -1,7 +1,7 @@
571+ <cpus>
572+ <model name='Cascadelake-Server-noTSX'>
573+ <decode host='on' guest='off'/>
574+- <signature family='6' model='85'/> <!-- 050654 -->
575++ <signature family='6' model='85' stepping='5-7'/> <!-- 050654 -->
576+ <vendor name='Intel'/>
577+ <feature name='3dnowprefetch'/>
578+ <feature name='abm'/>
579+diff --git a/src/cpu_map/x86_Cascadelake-Server.xml b/src/cpu_map/x86_Cascadelake-Server.xml
580+index d7ec42f57e..335e9cb584 100644
581+--- a/src/cpu_map/x86_Cascadelake-Server.xml
582++++ b/src/cpu_map/x86_Cascadelake-Server.xml
583+@@ -1,7 +1,7 @@
584+ <cpus>
585+ <model name='Cascadelake-Server'>
586+ <decode host='on' guest='on'/>
587+- <signature family='6' model='85'/> <!-- 050654 -->
588++ <signature family='6' model='85' stepping='5-7'/> <!-- 050654 -->
589+ <vendor name='Intel'/>
590+ <feature name='3dnowprefetch'/>
591+ <feature name='abm'/>
592+diff --git a/src/cpu_map/x86_Skylake-Server-IBRS.xml b/src/cpu_map/x86_Skylake-Server-IBRS.xml
593+index bd6b6457ad..9fb3488809 100644
594+--- a/src/cpu_map/x86_Skylake-Server-IBRS.xml
595++++ b/src/cpu_map/x86_Skylake-Server-IBRS.xml
596+@@ -1,7 +1,7 @@
597+ <cpus>
598+ <model name='Skylake-Server-IBRS'>
599+ <decode host='on' guest='on'/>
600+- <signature family='6' model='85'/> <!-- 050654 -->
601++ <signature family='6' model='85' stepping='0-4'/> <!-- 050654 -->
602+ <vendor name='Intel'/>
603+ <feature name='3dnowprefetch'/>
604+ <feature name='abm'/>
605+diff --git a/src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml b/src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml
606+index c2b7de40e8..c162c0acc3 100644
607+--- a/src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml
608++++ b/src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml
609+@@ -1,7 +1,7 @@
610+ <cpus>
611+ <model name='Skylake-Server-noTSX-IBRS'>
612+ <decode host='on' guest='off'/>
613+- <signature family='6' model='85'/> <!-- 050654 -->
614++ <signature family='6' model='85' stepping='0-4'/> <!-- 050654 -->
615+ <vendor name='Intel'/>
616+ <feature name='3dnowprefetch'/>
617+ <feature name='abm'/>
618+diff --git a/src/cpu_map/x86_Skylake-Server.xml b/src/cpu_map/x86_Skylake-Server.xml
619+index f96875a85f..e022d94c84 100644
620+--- a/src/cpu_map/x86_Skylake-Server.xml
621++++ b/src/cpu_map/x86_Skylake-Server.xml
622+@@ -1,7 +1,7 @@
623+ <cpus>
624+ <model name='Skylake-Server'>
625+ <decode host='on' guest='on'/>
626+- <signature family='6' model='85'/> <!-- 050654 -->
627++ <signature family='6' model='85' stepping='0-4'/> <!-- 050654 -->
628+ <vendor name='Intel'/>
629+ <feature name='3dnowprefetch'/>
630+ <feature name='abm'/>
631+diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-guest.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-guest.xml
632+index cfb0eb982d..c21cb1e600 100644
633+--- a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-guest.xml
634++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-guest.xml
635+@@ -1,5 +1,5 @@
636+ <cpu mode='custom' match='exact'>
637+- <model fallback='forbid'>Cascadelake-Server</model>
638++ <model fallback='forbid'>Skylake-Server-IBRS</model>
639+ <vendor>Intel</vendor>
640+ <feature policy='require' name='ds'/>
641+ <feature policy='require' name='acpi'/>
642+@@ -20,14 +20,15 @@
643+ <feature policy='require' name='osxsave'/>
644+ <feature policy='require' name='tsc_adjust'/>
645+ <feature policy='require' name='cmt'/>
646++ <feature policy='require' name='clflushopt'/>
647+ <feature policy='require' name='intel-pt'/>
648+ <feature policy='require' name='pku'/>
649+ <feature policy='require' name='ospke'/>
650+ <feature policy='require' name='md-clear'/>
651+ <feature policy='require' name='stibp'/>
652++ <feature policy='require' name='ssbd'/>
653+ <feature policy='require' name='xsaves'/>
654+ <feature policy='require' name='mbm_total'/>
655+ <feature policy='require' name='mbm_local'/>
656+ <feature policy='require' name='invtsc'/>
657+- <feature policy='disable' name='avx512vnni'/>
658+ </cpu>
659+diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-json.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-json.xml
660+index 968d904557..b482043ccf 100644
661+--- a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-json.xml
662++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-json.xml
663+@@ -1,16 +1,17 @@
664+ <cpu mode='custom' match='exact'>
665+- <model fallback='forbid'>Cascadelake-Server</model>
666++ <model fallback='forbid'>Skylake-Server-IBRS</model>
667+ <vendor>Intel</vendor>
668+ <feature policy='require' name='ss'/>
669+ <feature policy='require' name='vmx'/>
670+ <feature policy='require' name='hypervisor'/>
671+ <feature policy='require' name='tsc_adjust'/>
672++ <feature policy='require' name='clflushopt'/>
673+ <feature policy='require' name='umip'/>
674+ <feature policy='require' name='pku'/>
675+ <feature policy='require' name='md-clear'/>
676+ <feature policy='require' name='stibp'/>
677+ <feature policy='require' name='arch-capabilities'/>
678++ <feature policy='require' name='ssbd'/>
679+ <feature policy='require' name='xsaves'/>
680+ <feature policy='require' name='skip-l1dfl-vmentry'/>
681+- <feature policy='disable' name='avx512vnni'/>
682+ </cpu>
683+--
684+2.31.1
685+
686diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Add-support-for-stepping-part-of-CPU-signatu.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Add-support-for-stepping-part-of-CPU-signatu.patch
687new file mode 100644
688index 0000000..dd02a2a
689--- /dev/null
690+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Add-support-for-stepping-part-of-CPU-signatu.patch
691@@ -0,0 +1,180 @@
692+From c7a27949954d78dc95459758e329fb9c580361bb Mon Sep 17 00:00:00 2001
693+From: Jiri Denemark <jdenemar@redhat.com>
694+Date: Thu, 26 Mar 2020 20:34:56 +0100
695+Subject: [PATCH] cpu_x86: Add support for stepping part of CPU signature
696+MIME-Version: 1.0
697+Content-Type: text/plain; charset=UTF-8
698+Content-Transfer-Encoding: 8bit
699+
700+CPU models defined in the cpu_map can use signature/@stepping attribute
701+to match a limited set of stepping numbers. The value is a bitmap for
702+bits 0..15 each corresponding to a single stepping value. For example,
703+stepping='4-6,9' will match 4, 5, 6, and 9. Omitting the attribute is
704+equivalent to stepping='0-15'.
705+
706+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
707+Reviewed-by: Ján Tomko <jtomko@redhat.com>
708+
709+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=c7a2794995
710+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
711+Last-Update: 2021-04-07
712+
713+---
714+ src/cpu/cpu_x86.c | 60 +++++++++++++++++++++++++++++++++++++++--------
715+ 1 file changed, 50 insertions(+), 10 deletions(-)
716+
717+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
718+index 511c50bf06..9183259bce 100644
719+--- a/src/cpu/cpu_x86.c
720++++ b/src/cpu/cpu_x86.c
721+@@ -125,6 +125,7 @@ typedef struct _virCPUx86Signature virCPUx86Signature;
722+ struct _virCPUx86Signature {
723+ unsigned int family;
724+ unsigned int model;
725++ virBitmapPtr stepping;
726+ };
727+
728+ typedef struct _virCPUx86Signatures virCPUx86Signatures;
729+@@ -732,7 +733,17 @@ x86MakeSignature(unsigned int family,
730+ static uint32_t
731+ virCPUx86SignatureToCPUID(virCPUx86Signature *sig)
732+ {
733+- return x86MakeSignature(sig->family, sig->model, 0);
734++ unsigned int stepping = 0;
735++
736++ if (sig->stepping) {
737++ ssize_t firstBit;
738++
739++ firstBit = virBitmapNextSetBit(sig->stepping, -1);
740++ if (firstBit >= 0)
741++ stepping = firstBit;
742++ }
743++
744++ return x86MakeSignature(sig->family, sig->model, stepping);
745+ }
746+
747+
748+@@ -767,8 +778,8 @@ x86DataToSignatureFull(const virCPUx86Data *data,
749+ }
750+
751+
752+-/* Mask out irrelevant bits (R and Step) from processor signature. */
753+-#define SIGNATURE_MASK 0x0fff3ff0
754++/* Mask out reserved bits from processor signature. */
755++#define SIGNATURE_MASK 0x0fff3fff
756+
757+ static uint32_t
758+ x86DataToSignature(const virCPUx86Data *data)
759+@@ -1134,9 +1145,14 @@ virCPUx86SignaturesNew(size_t count)
760+ static void
761+ virCPUx86SignaturesFree(virCPUx86SignaturesPtr sigs)
762+ {
763++ size_t i;
764++
765+ if (!sigs)
766+ return;
767+
768++ for (i = 0; i < sigs->count; i++)
769++ virBitmapFree(sigs->items[i].stepping);
770++
771+ g_free(sigs->items);
772+ g_free(sigs);
773+ }
774+@@ -1153,8 +1169,12 @@ virCPUx86SignaturesCopy(virCPUx86SignaturesPtr src)
775+
776+ dst = virCPUx86SignaturesNew(src->count);
777+
778+- for (i = 0; i < src->count; i++)
779+- dst->items[i] = src->items[i];
780++ for (i = 0; i < src->count; i++) {
781++ dst->items[i].family = src->items[i].family;
782++ dst->items[i].model = src->items[i].model;
783++ if (src->items[i].stepping)
784++ dst->items[i].stepping = virBitmapNewCopy(src->items[i].stepping);
785++ }
786+
787+ return dst;
788+ }
789+@@ -1176,7 +1196,9 @@ virCPUx86SignaturesMatch(virCPUx86SignaturesPtr sigs,
790+
791+ for (i = 0; i < sigs->count; i++) {
792+ if (sigs->items[i].family == family &&
793+- sigs->items[i].model == model)
794++ sigs->items[i].model == model &&
795++ (!sigs->items[i].stepping ||
796++ virBitmapIsBitSet(sigs->items[i].stepping, stepping)))
797+ return true;
798+ }
799+
800+@@ -1194,9 +1216,15 @@ virCPUx86SignaturesFormat(virCPUx86SignaturesPtr sigs)
801+ return virBufferContentAndReset(&buf);
802+
803+ for (i = 0; i < sigs->count; i++) {
804+- virBufferAsprintf(&buf, "(%u,%u,0), ",
805++ g_autofree char *stepping = NULL;
806++
807++ if (sigs->items[i].stepping)
808++ stepping = virBitmapFormat(sigs->items[i].stepping);
809++
810++ virBufferAsprintf(&buf, "(%u,%u,%s), ",
811+ sigs->items[i].family,
812+- sigs->items[i].model);
813++ sigs->items[i].model,
814++ stepping ? stepping : "0-15");
815+ }
816+
817+ virBufferTrim(&buf, ", ", -1);
818+@@ -1473,6 +1501,7 @@ x86ModelParseSignatures(virCPUx86ModelPtr model,
819+
820+ for (i = 0; i < n; i++) {
821+ virCPUx86Signature *sig = &model->signatures->items[i];
822++ g_autofree char *stepping = NULL;
823+ int rc;
824+
825+ ctxt->node = nodes[i];
826+@@ -1492,6 +1521,11 @@ x86ModelParseSignatures(virCPUx86ModelPtr model,
827+ model->name);
828+ return -1;
829+ }
830++
831++ stepping = virXPathString("string(@stepping)", ctxt);
832++ /* stepping corresponds to 4 bits in 32b signature, see above */
833++ if (stepping && virBitmapParse(stepping, &sig->stepping, 16) < 0)
834++ return -1;
835+ }
836+
837+ ctxt->node = root;
838+@@ -2090,6 +2124,9 @@ x86Decode(virCPUDefPtr cpu,
839+ virDomainCapsCPUModelPtr hvModel = NULL;
840+ g_autofree char *sigs = NULL;
841+ uint32_t signature;
842++ unsigned int sigFamily;
843++ unsigned int sigModel;
844++ unsigned int sigStepping;
845+ ssize_t i;
846+ int rc;
847+
848+@@ -2103,6 +2140,7 @@ x86Decode(virCPUDefPtr cpu,
849+
850+ vendor = x86DataToVendor(&data, map);
851+ signature = x86DataToSignature(&data);
852++ virCPUx86SignatureFromCPUID(signature, &sigFamily, &sigModel, &sigStepping);
853+
854+ x86DataFilterTSX(&data, vendor, map);
855+
856+@@ -2184,8 +2222,10 @@ x86Decode(virCPUDefPtr cpu,
857+
858+ sigs = virCPUx86SignaturesFormat(model->signatures);
859+
860+- VIR_DEBUG("Using CPU model %s (signatures %s) for CPU with signature %06lx",
861+- model->name, NULLSTR(sigs), (unsigned long)signature);
862++ VIR_DEBUG("Using CPU model %s with signatures [%s] for "
863++ "CPU with signature (%u,%u,%u)",
864++ model->name, NULLSTR(sigs),
865++ sigFamily, sigModel, sigStepping);
866+
867+ cpu->model = g_steal_pointer(&cpuModel->model);
868+ cpu->features = g_steal_pointer(&cpuModel->features);
869+--
870+2.31.1
871+
872diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Don-t-check-return-value-of-x86ModelCopy.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Don-t-check-return-value-of-x86ModelCopy.patch
873new file mode 100644
874index 0000000..cd08f7a
875--- /dev/null
876+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Don-t-check-return-value-of-x86ModelCopy.patch
877@@ -0,0 +1,71 @@
878+From 70f3041d39802e53a19901bee040ff33850cd5e0 Mon Sep 17 00:00:00 2001
879+From: Jiri Denemark <jdenemar@redhat.com>
880+Date: Thu, 26 Mar 2020 16:16:49 +0100
881+Subject: [PATCH] cpu_x86: Don't check return value of x86ModelCopy
882+MIME-Version: 1.0
883+Content-Type: text/plain; charset=UTF-8
884+Content-Transfer-Encoding: 8bit
885+
886+Thanks to glib allocation functions which abort on OOM the function
887+cannot ever return NULL.
888+
889+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
890+Reviewed-by: Ján Tomko <jtomko@redhat.com>
891+
892+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=70f3041d39
893+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
894+Last-Update: 2021-04-07
895+
896+---
897+ src/cpu/cpu_x86.c | 14 ++++----------
898+ 1 file changed, 4 insertions(+), 10 deletions(-)
899+
900+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
901+index 5a19cd4120..511c50bf06 100644
902+--- a/src/cpu/cpu_x86.c
903++++ b/src/cpu/cpu_x86.c
904+@@ -1287,9 +1287,6 @@ x86ModelFromCPU(const virCPUDef *cpu,
905+ model = g_new0(virCPUx86Model, 1);
906+ }
907+
908+- if (!model)
909+- return NULL;
910+-
911+ for (i = 0; i < cpu->nfeatures; i++) {
912+ virCPUx86FeaturePtr feature;
913+ virCPUFeaturePolicy fpol;
914+@@ -1869,9 +1866,7 @@ x86Compute(virCPUDefPtr host,
915+ return VIR_CPU_COMPARE_INCOMPATIBLE;
916+ }
917+
918+- if (!(diff = x86ModelCopy(host_model)))
919+- return VIR_CPU_COMPARE_ERROR;
920+-
921++ diff = x86ModelCopy(host_model);
922+ x86DataSubtract(&diff->data, &cpu_optional->data);
923+ x86DataSubtract(&diff->data, &cpu_require->data);
924+ x86DataSubtract(&diff->data, &cpu_disable->data);
925+@@ -1892,8 +1887,7 @@ x86Compute(virCPUDefPtr host,
926+ }
927+
928+ if (guest) {
929+- if (!(guest_model = x86ModelCopy(host_model)))
930+- return VIR_CPU_COMPARE_ERROR;
931++ guest_model = x86ModelCopy(host_model);
932+
933+ if (cpu->vendor && host_model->vendor &&
934+ virCPUx86DataAddItem(&guest_model->data,
935+@@ -3131,8 +3125,8 @@ virCPUx86ExpandFeatures(virCPUDefPtr cpu)
936+ return -1;
937+ }
938+
939+- if (!(model = x86ModelCopy(model)) ||
940+- x86DataToCPUFeatures(expanded, host ? -1 : VIR_CPU_FEATURE_REQUIRE,
941++ model = x86ModelCopy(model);
942++ if (x86DataToCPUFeatures(expanded, host ? -1 : VIR_CPU_FEATURE_REQUIRE,
943+ &model->data, map) < 0)
944+ return -1;
945+
946+--
947+2.31.1
948+
949diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Drop-noTSX-hint-for-incompatible-CPUs.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Drop-noTSX-hint-for-incompatible-CPUs.patch
950new file mode 100644
951index 0000000..fd2d06f
952--- /dev/null
953+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Drop-noTSX-hint-for-incompatible-CPUs.patch
954@@ -0,0 +1,99 @@
955+From 8452779049ef785b1d2e373b4d42633d4a929a60 Mon Sep 17 00:00:00 2001
956+From: Jiri Denemark <jdenemar@redhat.com>
957+Date: Tue, 24 Mar 2020 23:35:44 +0100
958+Subject: [PATCH] cpu_x86: Drop noTSX hint for incompatible CPUs
959+MIME-Version: 1.0
960+Content-Type: text/plain; charset=UTF-8
961+Content-Transfer-Encoding: 8bit
962+
963+The hint was introduced a long time ago when broken TSX implementation
964+was found in Haswell and Broadwell CPUs. Since then many more CPUs with
965+TSX were introduced and and disabled due to TAA vulnerability.
966+
967+Thus the hint is not very useful and I think removing it is a better
968+choice then updating it to cover all current noTSX models.
969+
970+This partially reverts:
971+commit 7f127ded657b24e0e55cd5f3539ef5b2dc935908
972+ cpu: Rework cpuCompare* APIs
973+
974+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
975+Reviewed-by: Ján Tomko <jtomko@redhat.com>
976+
977+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=8452779049
978+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
979+Last-Update: 2021-04-07
980+
981+---
982+ src/cpu/cpu_x86.c | 44 ++++++--------------------------------------
983+ 1 file changed, 6 insertions(+), 38 deletions(-)
984+
985+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
986+index ce15bb0454..08749f87b9 100644
987+--- a/src/cpu/cpu_x86.c
988++++ b/src/cpu/cpu_x86.c
989+@@ -1937,8 +1937,6 @@ virCPUx86Compare(virCPUDefPtr host,
990+ bool failIncompatible)
991+ {
992+ virCPUCompareResult ret = VIR_CPU_COMPARE_ERROR;
993+- virCPUx86MapPtr map;
994+- virCPUx86ModelPtr model = NULL;
995+ char *message = NULL;
996+
997+ if (!host || !host->model) {
998+@@ -1954,46 +1952,16 @@ virCPUx86Compare(virCPUDefPtr host,
999+
1000+ ret = x86Compute(host, cpu, NULL, &message);
1001+
1002+- if (ret == VIR_CPU_COMPARE_INCOMPATIBLE) {
1003+- bool noTSX = false;
1004+-
1005+- if (STREQ_NULLABLE(cpu->model, "Haswell") ||
1006+- STREQ_NULLABLE(cpu->model, "Broadwell")) {
1007+- if (!(map = virCPUx86GetMap()))
1008+- goto cleanup;
1009+-
1010+- if (!(model = x86ModelFromCPU(cpu, map, -1)))
1011+- goto cleanup;
1012+-
1013+- noTSX = !x86FeatureInData("hle", &model->data, map) ||
1014+- !x86FeatureInData("rtm", &model->data, map);
1015+- }
1016+-
1017+- if (failIncompatible) {
1018+- ret = VIR_CPU_COMPARE_ERROR;
1019+- if (message) {
1020+- if (noTSX) {
1021+- virReportError(VIR_ERR_CPU_INCOMPATIBLE,
1022+- _("%s; try using '%s-noTSX' CPU model"),
1023+- message, cpu->model);
1024+- } else {
1025+- virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s", message);
1026+- }
1027+- } else {
1028+- if (noTSX) {
1029+- virReportError(VIR_ERR_CPU_INCOMPATIBLE,
1030+- _("try using '%s-noTSX' CPU model"),
1031+- cpu->model);
1032+- } else {
1033+- virReportError(VIR_ERR_CPU_INCOMPATIBLE, NULL);
1034+- }
1035+- }
1036+- }
1037++ if (ret == VIR_CPU_COMPARE_INCOMPATIBLE && failIncompatible) {
1038++ ret = VIR_CPU_COMPARE_ERROR;
1039++ if (message)
1040++ virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s", message);
1041++ else
1042++ virReportError(VIR_ERR_CPU_INCOMPATIBLE, NULL);
1043+ }
1044+
1045+ cleanup:
1046+ VIR_FREE(message);
1047+- x86ModelFree(model);
1048+ return ret;
1049+ }
1050+
1051+--
1052+2.31.1
1053+
1054diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Introduce-virCPUx86SignatureFromCPUID.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Introduce-virCPUx86SignatureFromCPUID.patch
1055new file mode 100644
1056index 0000000..5c2258b
1057--- /dev/null
1058+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Introduce-virCPUx86SignatureFromCPUID.patch
1059@@ -0,0 +1,68 @@
1060+From 3b474c1f8f3c1f124fab303625733ea79047660c Mon Sep 17 00:00:00 2001
1061+From: Jiri Denemark <jdenemar@redhat.com>
1062+Date: Thu, 26 Mar 2020 14:57:47 +0100
1063+Subject: [PATCH] cpu_x86: Introduce virCPUx86SignatureFromCPUID
1064+MIME-Version: 1.0
1065+Content-Type: text/plain; charset=UTF-8
1066+Content-Transfer-Encoding: 8bit
1067+
1068+It can be used for separating family, model, and stepping numbers from a
1069+single 32b integer as reported by CPUID.
1070+
1071+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
1072+Reviewed-by: Ján Tomko <jtomko@redhat.com>
1073+
1074+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=3b474c1f8f
1075+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
1076+Last-Update: 2021-04-07
1077+
1078+---
1079+ src/cpu/cpu_x86.c | 19 ++++++++++++++-----
1080+ 1 file changed, 14 insertions(+), 5 deletions(-)
1081+
1082+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
1083+index dd936e28a4..6fe9ffe808 100644
1084+--- a/src/cpu/cpu_x86.c
1085++++ b/src/cpu/cpu_x86.c
1086+@@ -717,6 +717,18 @@ x86MakeSignature(unsigned int family,
1087+ }
1088+
1089+
1090++static void
1091++virCPUx86SignatureFromCPUID(uint32_t sig,
1092++ unsigned int *family,
1093++ unsigned int *model,
1094++ unsigned int *stepping)
1095++{
1096++ *family = ((sig >> 20) & 0xff) + ((sig >> 8) & 0xf);
1097++ *model = ((sig >> 12) & 0xf0) + ((sig >> 4) & 0xf);
1098++ *stepping = sig & 0xf;
1099++}
1100++
1101++
1102+ static void
1103+ x86DataToSignatureFull(const virCPUx86Data *data,
1104+ unsigned int *family,
1105+@@ -725,17 +737,14 @@ x86DataToSignatureFull(const virCPUx86Data *data,
1106+ {
1107+ virCPUx86DataItem leaf1 = CPUID(.eax_in = 0x1);
1108+ virCPUx86DataItemPtr item;
1109+- virCPUx86CPUIDPtr cpuid;
1110+
1111+ *family = *model = *stepping = 0;
1112+
1113+ if (!(item = virCPUx86DataGet(data, &leaf1)))
1114+ return;
1115+
1116+- cpuid = &item->data.cpuid;
1117+- *family = ((cpuid->eax >> 20) & 0xff) + ((cpuid->eax >> 8) & 0xf);
1118+- *model = ((cpuid->eax >> 12) & 0xf0) + ((cpuid->eax >> 4) & 0xf);
1119+- *stepping = cpuid->eax & 0xf;
1120++ virCPUx86SignatureFromCPUID(item->data.cpuid.eax,
1121++ family, model, stepping);
1122+ }
1123+
1124+
1125+--
1126+2.31.1
1127+
1128diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Introduce-virCPUx86SignaturesFree.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Introduce-virCPUx86SignaturesFree.patch
1129new file mode 100644
1130index 0000000..4e7faa6
1131--- /dev/null
1132+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Introduce-virCPUx86SignaturesFree.patch
1133@@ -0,0 +1,61 @@
1134+From 372b2cf1ca3f4361546732a3f5f9c0c0be2591e9 Mon Sep 17 00:00:00 2001
1135+From: Jiri Denemark <jdenemar@redhat.com>
1136+Date: Thu, 26 Mar 2020 15:23:28 +0100
1137+Subject: [PATCH] cpu_x86: Introduce virCPUx86SignaturesFree
1138+MIME-Version: 1.0
1139+Content-Type: text/plain; charset=UTF-8
1140+Content-Transfer-Encoding: 8bit
1141+
1142+The function will be used for freeing virCPUx86Signatures structure
1143+introduced later in this series.
1144+
1145+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
1146+Reviewed-by: Ján Tomko <jtomko@redhat.com>
1147+
1148+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=372b2cf1ca
1149+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
1150+Last-Update: 2021-04-07
1151+
1152+---
1153+ src/cpu/cpu_x86.c | 11 +++++++++--
1154+ 1 file changed, 9 insertions(+), 2 deletions(-)
1155+
1156+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
1157+index b6ba26b0d0..dd936e28a4 100644
1158+--- a/src/cpu/cpu_x86.c
1159++++ b/src/cpu/cpu_x86.c
1160+@@ -1090,6 +1090,13 @@ x86FeatureParse(xmlXPathContextPtr ctxt,
1161+ }
1162+
1163+
1164++static void
1165++virCPUx86SignaturesFree(uint32_t *signatures)
1166++{
1167++ g_free(signatures);
1168++}
1169++
1170++
1171+ static int
1172+ virCPUx86SignaturesCopy(virCPUx86ModelPtr dst,
1173+ virCPUx86ModelPtr src)
1174+@@ -1149,7 +1156,7 @@ x86ModelFree(virCPUx86ModelPtr model)
1175+ return;
1176+
1177+ g_free(model->name);
1178+- g_free(model->signatures);
1179++ virCPUx86SignaturesFree(model->signatures);
1180+ virCPUx86DataClear(&model->data);
1181+ g_free(model);
1182+ }
1183+@@ -1414,7 +1421,7 @@ x86ModelParseSignatures(virCPUx86ModelPtr model,
1184+ return n;
1185+
1186+ /* Remove inherited signatures. */
1187+- VIR_FREE(model->signatures);
1188++ virCPUx86SignaturesFree(model->signatures);
1189+
1190+ model->nsignatures = n;
1191+ if (VIR_ALLOC_N(model->signatures, n) < 0)
1192+--
1193+2.31.1
1194+
1195diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Move-and-rename-x86FormatSignatures.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Move-and-rename-x86FormatSignatures.patch
1196new file mode 100644
1197index 0000000..19cd1b7
1198--- /dev/null
1199+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Move-and-rename-x86FormatSignatures.patch
1200@@ -0,0 +1,85 @@
1201+From 7e0d351fa69c468906533b2ac9b24212df13a370 Mon Sep 17 00:00:00 2001
1202+From: Jiri Denemark <jdenemar@redhat.com>
1203+Date: Thu, 26 Mar 2020 15:14:41 +0100
1204+Subject: [PATCH] cpu_x86: Move and rename x86FormatSignatures
1205+MIME-Version: 1.0
1206+Content-Type: text/plain; charset=UTF-8
1207+Content-Transfer-Encoding: 8bit
1208+
1209+Later in this series the function will work on a newly introduced
1210+virCPUx86Signatures structure. Let's move it to the place where all
1211+related functions will be added and rename the function as
1212+virCPUx86SignaturesFormat for easier review of the virCPUx86Signatures
1213+patch.
1214+
1215+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
1216+Reviewed-by: Ján Tomko <jtomko@redhat.com>
1217+
1218+Backport-Note: some noise due to missing 0a125c71
1219+Origin: backport, https://libvirt.org/git/?p=libvirt.git;a=commit;h=7e0d351fa6
1220+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
1221+Last-Update: 2021-04-07
1222+
1223+---
1224+ src/cpu/cpu_x86.c | 36 ++++++++++++++++++------------------
1225+ 1 file changed, 18 insertions(+), 18 deletions(-)
1226+
1227+--- a/src/cpu/cpu_x86.c
1228++++ b/src/cpu/cpu_x86.c
1229+@@ -1125,6 +1125,23 @@ virCPUx86SignaturesMatch(virCPUx86ModelP
1230+ }
1231+
1232+
1233++static char *
1234++virCPUx86SignaturesFormat(virCPUx86ModelPtr model)
1235++{
1236++ virBuffer buf = VIR_BUFFER_INITIALIZER;
1237++ size_t i;
1238++
1239++ for (i = 0; i < model->nsignatures; i++) {
1240++ virBufferAsprintf(&buf, "%06lx,",
1241++ (unsigned long)model->signatures[i]);
1242++ }
1243++
1244++ virBufferTrim(&buf, ",", -1);
1245++
1246++ return virBufferContentAndReset(&buf);
1247++}
1248++
1249++
1250+ static void
1251+ x86ModelFree(virCPUx86ModelPtr model)
1252+ {
1253+@@ -1890,23 +1907,6 @@ virCPUx86Compare(virCPUDefPtr host,
1254+ }
1255+
1256+
1257+-static char *
1258+-x86FormatSignatures(virCPUx86ModelPtr model)
1259+-{
1260+- virBuffer buf = VIR_BUFFER_INITIALIZER;
1261+- size_t i;
1262+-
1263+- for (i = 0; i < model->nsignatures; i++) {
1264+- virBufferAsprintf(&buf, "%06lx,",
1265+- (unsigned long)model->signatures[i]);
1266+- }
1267+-
1268+- virBufferTrim(&buf, ",", -1);
1269+-
1270+- return virBufferContentAndReset(&buf);
1271+-}
1272+-
1273+-
1274+ /*
1275+ * Checks whether a candidate model is a better fit for the CPU data than the
1276+ * current model.
1277+@@ -2134,7 +2134,7 @@ x86Decode(virCPUDefPtr cpu,
1278+ if (vendor)
1279+ cpu->vendor = g_strdup(vendor->name);
1280+
1281+- sigs = x86FormatSignatures(model);
1282++ sigs = virCPUx86SignaturesFormat(model);
1283+
1284+ VIR_DEBUG("Using CPU model %s (signatures %s) for CPU with signature %06lx",
1285+ model->name, NULLSTR(sigs), (unsigned long)signature);
1286diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Move-and-rename-x86ModelCopySignatures.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Move-and-rename-x86ModelCopySignatures.patch
1287new file mode 100644
1288index 0000000..d03aaef
1289--- /dev/null
1290+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Move-and-rename-x86ModelCopySignatures.patch
1291@@ -0,0 +1,97 @@
1292+From a8ec1d746ed41ac76df2e28cbc5683b3e37b9a60 Mon Sep 17 00:00:00 2001
1293+From: Jiri Denemark <jdenemar@redhat.com>
1294+Date: Thu, 26 Mar 2020 15:07:42 +0100
1295+Subject: [PATCH] cpu_x86: Move and rename x86ModelCopySignatures
1296+MIME-Version: 1.0
1297+Content-Type: text/plain; charset=UTF-8
1298+Content-Transfer-Encoding: 8bit
1299+
1300+Later in this series the function will work on a newly introduced
1301+virCPUx86Signatures structure. Let's move it to the place were all
1302+related functions will be added and rename the function as
1303+virCPUx86SignaturesCopy for easier review of the virCPUx86Signatures
1304+patch.
1305+
1306+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
1307+Reviewed-by: Ján Tomko <jtomko@redhat.com>
1308+
1309+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=a8ec1d746e
1310+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
1311+Last-Update: 2021-04-07
1312+
1313+---
1314+ src/cpu/cpu_x86.c | 36 ++++++++++++++++++------------------
1315+ 1 file changed, 18 insertions(+), 18 deletions(-)
1316+
1317+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
1318+index f40609f7e4..50ee9408e6 100644
1319+--- a/src/cpu/cpu_x86.c
1320++++ b/src/cpu/cpu_x86.c
1321+@@ -1090,23 +1090,9 @@ x86FeatureParse(xmlXPathContextPtr ctxt,
1322+ }
1323+
1324+
1325+-static void
1326+-x86ModelFree(virCPUx86ModelPtr model)
1327+-{
1328+- if (!model)
1329+- return;
1330+-
1331+- g_free(model->name);
1332+- g_free(model->signatures);
1333+- virCPUx86DataClear(&model->data);
1334+- g_free(model);
1335+-}
1336+-G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Model, x86ModelFree);
1337+-
1338+-
1339+ static int
1340+-x86ModelCopySignatures(virCPUx86ModelPtr dst,
1341+- virCPUx86ModelPtr src)
1342++virCPUx86SignaturesCopy(virCPUx86ModelPtr dst,
1343++ virCPUx86ModelPtr src)
1344+ {
1345+ size_t i;
1346+
1347+@@ -1124,6 +1110,20 @@ x86ModelCopySignatures(virCPUx86ModelPtr dst,
1348+ }
1349+
1350+
1351++static void
1352++x86ModelFree(virCPUx86ModelPtr model)
1353++{
1354++ if (!model)
1355++ return;
1356++
1357++ g_free(model->name);
1358++ g_free(model->signatures);
1359++ virCPUx86DataClear(&model->data);
1360++ g_free(model);
1361++}
1362++G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Model, x86ModelFree);
1363++
1364++
1365+ static virCPUx86ModelPtr
1366+ x86ModelCopy(virCPUx86ModelPtr model)
1367+ {
1368+@@ -1132,7 +1132,7 @@ x86ModelCopy(virCPUx86ModelPtr model)
1369+ copy = g_new0(virCPUx86Model, 1);
1370+ copy->name = g_strdup(model->name);
1371+
1372+- if (x86ModelCopySignatures(copy, model) < 0) {
1373++ if (virCPUx86SignaturesCopy(copy, model) < 0) {
1374+ x86ModelFree(copy);
1375+ return NULL;
1376+ }
1377+@@ -1360,7 +1360,7 @@ x86ModelParseAncestor(virCPUx86ModelPtr model,
1378+ }
1379+
1380+ model->vendor = ancestor->vendor;
1381+- if (x86ModelCopySignatures(model, ancestor) < 0)
1382++ if (virCPUx86SignaturesCopy(model, ancestor) < 0)
1383+ return -1;
1384+
1385+ x86DataCopy(&model->data, &ancestor->data);
1386+--
1387+2.31.1
1388+
1389diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Move-and-rename-x86ModelHasSignature.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Move-and-rename-x86ModelHasSignature.patch
1390new file mode 100644
1391index 0000000..7ab794e
1392--- /dev/null
1393+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Move-and-rename-x86ModelHasSignature.patch
1394@@ -0,0 +1,98 @@
1395+From 782be9f0af2e02e725fca45b7674e8b2f008dc6c Mon Sep 17 00:00:00 2001
1396+From: Jiri Denemark <jdenemar@redhat.com>
1397+Date: Thu, 26 Mar 2020 15:12:26 +0100
1398+Subject: [PATCH] cpu_x86: Move and rename x86ModelHasSignature
1399+MIME-Version: 1.0
1400+Content-Type: text/plain; charset=UTF-8
1401+Content-Transfer-Encoding: 8bit
1402+
1403+Later in this series the function will work on a newly introduced
1404+virCPUx86Signatures structure. Let's move it to the place were all
1405+related functions will be added and rename the function as
1406+virCPUx86SignaturesMatch for easier review of the virCPUx86Signatures
1407+patch.
1408+
1409+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
1410+Reviewed-by: Ján Tomko <jtomko@redhat.com>
1411+
1412+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=782be9f0af
1413+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
1414+Last-Update: 2021-04-07
1415+
1416+---
1417+ src/cpu/cpu_x86.c | 38 +++++++++++++++++++-------------------
1418+ 1 file changed, 19 insertions(+), 19 deletions(-)
1419+
1420+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
1421+index 50ee9408e6..407a5d54de 100644
1422+--- a/src/cpu/cpu_x86.c
1423++++ b/src/cpu/cpu_x86.c
1424+@@ -1110,6 +1110,21 @@ virCPUx86SignaturesCopy(virCPUx86ModelPtr dst,
1425+ }
1426+
1427+
1428++static bool
1429++virCPUx86SignaturesMatch(virCPUx86ModelPtr model,
1430++ uint32_t signature)
1431++{
1432++ size_t i;
1433++
1434++ for (i = 0; i < model->nsignatures; i++) {
1435++ if (model->signatures[i] == signature)
1436++ return true;
1437++ }
1438++
1439++ return false;
1440++}
1441++
1442++
1443+ static void
1444+ x86ModelFree(virCPUx86ModelPtr model)
1445+ {
1446+@@ -1875,21 +1890,6 @@ virCPUx86Compare(virCPUDefPtr host,
1447+ }
1448+
1449+
1450+-static bool
1451+-x86ModelHasSignature(virCPUx86ModelPtr model,
1452+- uint32_t signature)
1453+-{
1454+- size_t i;
1455+-
1456+- for (i = 0; i < model->nsignatures; i++) {
1457+- if (model->signatures[i] == signature)
1458+- return true;
1459+- }
1460+-
1461+- return false;
1462+-}
1463+-
1464+-
1465+ static char *
1466+ x86FormatSignatures(virCPUx86ModelPtr model)
1467+ {
1468+@@ -1961,8 +1961,8 @@ x86DecodeUseCandidate(virCPUx86ModelPtr current,
1469+ * consider candidates with matching family/model.
1470+ */
1471+ if (signature &&
1472+- x86ModelHasSignature(current, signature) &&
1473+- !x86ModelHasSignature(candidate, signature)) {
1474++ virCPUx86SignaturesMatch(current, signature) &&
1475++ !virCPUx86SignaturesMatch(candidate, signature)) {
1476+ VIR_DEBUG("%s differs in signature from matching %s",
1477+ cpuCandidate->model, cpuCurrent->model);
1478+ return 0;
1479+@@ -1978,8 +1978,8 @@ x86DecodeUseCandidate(virCPUx86ModelPtr current,
1480+ * result in longer list of features.
1481+ */
1482+ if (signature &&
1483+- x86ModelHasSignature(candidate, signature) &&
1484+- !x86ModelHasSignature(current, signature)) {
1485++ virCPUx86SignaturesMatch(candidate, signature) &&
1486++ !virCPUx86SignaturesMatch(current, signature)) {
1487+ VIR_DEBUG("%s provides matching signature", cpuCandidate->model);
1488+ return 1;
1489+ }
1490+--
1491+2.31.1
1492+
1493diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Replace-32b-signatures-in-virCPUx86Model-wit.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Replace-32b-signatures-in-virCPUx86Model-wit.patch
1494new file mode 100644
1495index 0000000..6210254
1496--- /dev/null
1497+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Replace-32b-signatures-in-virCPUx86Model-wit.patch
1498@@ -0,0 +1,317 @@
1499+From 22bded201ffc91661e44065203dcb987e51084ca Mon Sep 17 00:00:00 2001
1500+From: Jiri Denemark <jdenemar@redhat.com>
1501+Date: Thu, 26 Mar 2020 16:16:00 +0100
1502+Subject: [PATCH] cpu_x86: Replace 32b signatures in virCPUx86Model with a
1503+ struct
1504+MIME-Version: 1.0
1505+Content-Type: text/plain; charset=UTF-8
1506+Content-Transfer-Encoding: 8bit
1507+
1508+The CPU models in our cpu_map define their signatures using separate
1509+family and model numbers. Let's store the signatures in the same way in
1510+our runtime representation of the cpu_map.
1511+
1512+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
1513+Reviewed-by: Ján Tomko <jtomko@redhat.com>
1514+
1515+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=22bded201f
1516+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
1517+Last-Update: 2021-04-07
1518+
1519+---
1520+ src/cpu/cpu_x86.c | 149 +++++++++++++++++++++++++++++-----------------
1521+ 1 file changed, 95 insertions(+), 54 deletions(-)
1522+
1523+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
1524+index 6fe9ffe808..5a19cd4120 100644
1525+--- a/src/cpu/cpu_x86.c
1526++++ b/src/cpu/cpu_x86.c
1527+@@ -121,6 +121,19 @@ static virCPUx86Feature x86_kvm_features[] =
1528+ KVM_FEATURE(VIR_CPU_x86_HV_STIMER_DIRECT),
1529+ };
1530+
1531++typedef struct _virCPUx86Signature virCPUx86Signature;
1532++struct _virCPUx86Signature {
1533++ unsigned int family;
1534++ unsigned int model;
1535++};
1536++
1537++typedef struct _virCPUx86Signatures virCPUx86Signatures;
1538++typedef virCPUx86Signatures *virCPUx86SignaturesPtr;
1539++struct _virCPUx86Signatures {
1540++ size_t count;
1541++ virCPUx86Signature *items;
1542++};
1543++
1544+ typedef struct _virCPUx86Model virCPUx86Model;
1545+ typedef virCPUx86Model *virCPUx86ModelPtr;
1546+ struct _virCPUx86Model {
1547+@@ -128,8 +141,7 @@ struct _virCPUx86Model {
1548+ bool decodeHost;
1549+ bool decodeGuest;
1550+ virCPUx86VendorPtr vendor;
1551+- size_t nsignatures;
1552+- uint32_t *signatures;
1553++ virCPUx86SignaturesPtr signatures;
1554+ virCPUx86Data data;
1555+ };
1556+
1557+@@ -717,6 +729,13 @@ x86MakeSignature(unsigned int family,
1558+ }
1559+
1560+
1561++static uint32_t
1562++virCPUx86SignatureToCPUID(virCPUx86Signature *sig)
1563++{
1564++ return x86MakeSignature(sig->family, sig->model, 0);
1565++}
1566++
1567++
1568+ static void
1569+ virCPUx86SignatureFromCPUID(uint32_t sig,
1570+ unsigned int *family,
1571+@@ -1099,41 +1118,65 @@ x86FeatureParse(xmlXPathContextPtr ctxt,
1572+ }
1573+
1574+
1575++static virCPUx86SignaturesPtr
1576++virCPUx86SignaturesNew(size_t count)
1577++{
1578++ virCPUx86SignaturesPtr sigs;
1579++
1580++ sigs = g_new0(virCPUx86Signatures, 1);
1581++ sigs->items = g_new0(virCPUx86Signature, count);
1582++ sigs->count = count;
1583++
1584++ return sigs;
1585++}
1586++
1587++
1588+ static void
1589+-virCPUx86SignaturesFree(uint32_t *signatures)
1590++virCPUx86SignaturesFree(virCPUx86SignaturesPtr sigs)
1591+ {
1592+- g_free(signatures);
1593++ if (!sigs)
1594++ return;
1595++
1596++ g_free(sigs->items);
1597++ g_free(sigs);
1598+ }
1599+
1600+
1601+-static int
1602+-virCPUx86SignaturesCopy(virCPUx86ModelPtr dst,
1603+- virCPUx86ModelPtr src)
1604++static virCPUx86SignaturesPtr
1605++virCPUx86SignaturesCopy(virCPUx86SignaturesPtr src)
1606+ {
1607++ virCPUx86SignaturesPtr dst;
1608+ size_t i;
1609+
1610+- if (src->nsignatures == 0)
1611+- return 0;
1612++ if (!src || src->count == 0)
1613++ return NULL;
1614+
1615+- if (VIR_ALLOC_N(dst->signatures, src->nsignatures) < 0)
1616+- return -1;
1617++ dst = virCPUx86SignaturesNew(src->count);
1618+
1619+- dst->nsignatures = src->nsignatures;
1620+- for (i = 0; i < src->nsignatures; i++)
1621+- dst->signatures[i] = src->signatures[i];
1622++ for (i = 0; i < src->count; i++)
1623++ dst->items[i] = src->items[i];
1624+
1625+- return 0;
1626++ return dst;
1627+ }
1628+
1629+
1630+ static bool
1631+-virCPUx86SignaturesMatch(virCPUx86ModelPtr model,
1632++virCPUx86SignaturesMatch(virCPUx86SignaturesPtr sigs,
1633+ uint32_t signature)
1634+ {
1635+ size_t i;
1636++ unsigned int family;
1637++ unsigned int model;
1638++ unsigned int stepping;
1639+
1640+- for (i = 0; i < model->nsignatures; i++) {
1641+- if (model->signatures[i] == signature)
1642++ if (!sigs)
1643++ return false;
1644++
1645++ virCPUx86SignatureFromCPUID(signature, &family, &model, &stepping);
1646++
1647++ for (i = 0; i < sigs->count; i++) {
1648++ if (sigs->items[i].family == family &&
1649++ sigs->items[i].model == model)
1650+ return true;
1651+ }
1652+
1653+@@ -1142,17 +1185,21 @@ virCPUx86SignaturesMatch(virCPUx86ModelPtr model,
1654+
1655+
1656+ static char *
1657+-virCPUx86SignaturesFormat(virCPUx86ModelPtr model)
1658++virCPUx86SignaturesFormat(virCPUx86SignaturesPtr sigs)
1659+ {
1660+ virBuffer buf = VIR_BUFFER_INITIALIZER;
1661+ size_t i;
1662+
1663+- for (i = 0; i < model->nsignatures; i++) {
1664+- virBufferAsprintf(&buf, "%06lx,",
1665+- (unsigned long)model->signatures[i]);
1666++ if (!sigs)
1667++ return virBufferContentAndReset(&buf);
1668++
1669++ for (i = 0; i < sigs->count; i++) {
1670++ virBufferAsprintf(&buf, "(%u,%u,0), ",
1671++ sigs->items[i].family,
1672++ sigs->items[i].model);
1673+ }
1674+
1675+- virBufferTrim(&buf, ",", -1);
1676++ virBufferTrim(&buf, ", ", -1);
1677+
1678+ return virBufferContentAndReset(&buf);
1679+ }
1680+@@ -1179,16 +1226,11 @@ x86ModelCopy(virCPUx86ModelPtr model)
1681+
1682+ copy = g_new0(virCPUx86Model, 1);
1683+ copy->name = g_strdup(model->name);
1684+-
1685+- if (virCPUx86SignaturesCopy(copy, model) < 0) {
1686+- x86ModelFree(copy);
1687+- return NULL;
1688+- }
1689++ copy->signatures = virCPUx86SignaturesCopy(model->signatures);
1690+ x86DataCopy(&copy->data, &model->data);
1691+-
1692+ copy->vendor = model->vendor;
1693+
1694+- return copy;
1695++ return g_steal_pointer(&copy);
1696+ }
1697+
1698+
1699+@@ -1408,9 +1450,7 @@ x86ModelParseAncestor(virCPUx86ModelPtr model,
1700+ }
1701+
1702+ model->vendor = ancestor->vendor;
1703+- if (virCPUx86SignaturesCopy(model, ancestor) < 0)
1704+- return -1;
1705+-
1706++ model->signatures = virCPUx86SignaturesCopy(ancestor->signatures);
1707+ x86DataCopy(&model->data, &ancestor->data);
1708+
1709+ return 0;
1710+@@ -1432,34 +1472,29 @@ x86ModelParseSignatures(virCPUx86ModelPtr model,
1711+ /* Remove inherited signatures. */
1712+ virCPUx86SignaturesFree(model->signatures);
1713+
1714+- model->nsignatures = n;
1715+- if (VIR_ALLOC_N(model->signatures, n) < 0)
1716+- return -1;
1717++ model->signatures = virCPUx86SignaturesNew(n);
1718+
1719+ for (i = 0; i < n; i++) {
1720+- unsigned int sigFamily = 0;
1721+- unsigned int sigModel = 0;
1722++ virCPUx86Signature *sig = &model->signatures->items[i];
1723+ int rc;
1724+
1725+ ctxt->node = nodes[i];
1726+
1727+- rc = virXPathUInt("string(@family)", ctxt, &sigFamily);
1728+- if (rc < 0 || sigFamily == 0) {
1729++ rc = virXPathUInt("string(@family)", ctxt, &sig->family);
1730++ if (rc < 0 || sig->family == 0) {
1731+ virReportError(VIR_ERR_INTERNAL_ERROR,
1732+ _("Invalid CPU signature family in model %s"),
1733+ model->name);
1734+ return -1;
1735+ }
1736+
1737+- rc = virXPathUInt("string(@model)", ctxt, &sigModel);
1738++ rc = virXPathUInt("string(@model)", ctxt, &sig->model);
1739+ if (rc < 0) {
1740+ virReportError(VIR_ERR_INTERNAL_ERROR,
1741+ _("Invalid CPU signature model in model %s"),
1742+ model->name);
1743+ return -1;
1744+ }
1745+-
1746+- model->signatures[i] = x86MakeSignature(sigFamily, sigModel, 0);
1747+ }
1748+
1749+ ctxt->node = root;
1750+@@ -1865,9 +1900,12 @@ x86Compute(virCPUDefPtr host,
1751+ &host_model->vendor->data) < 0)
1752+ return VIR_CPU_COMPARE_ERROR;
1753+
1754+- if (host_model->signatures &&
1755+- x86DataAddSignature(&guest_model->data, *host_model->signatures) < 0)
1756+- return VIR_CPU_COMPARE_ERROR;
1757++ if (host_model->signatures && host_model->signatures->count > 0) {
1758++ virCPUx86Signature *sig = &host_model->signatures->items[0];
1759++ if (x86DataAddSignature(&guest_model->data,
1760++ virCPUx86SignatureToCPUID(sig)) < 0)
1761++ return VIR_CPU_COMPARE_ERROR;
1762++ }
1763+
1764+ if (cpu->type == VIR_CPU_TYPE_GUEST
1765+ && cpu->match == VIR_CPU_MATCH_EXACT)
1766+@@ -1977,8 +2015,8 @@ x86DecodeUseCandidate(virCPUx86ModelPtr current,
1767+ * consider candidates with matching family/model.
1768+ */
1769+ if (signature &&
1770+- virCPUx86SignaturesMatch(current, signature) &&
1771+- !virCPUx86SignaturesMatch(candidate, signature)) {
1772++ virCPUx86SignaturesMatch(current->signatures, signature) &&
1773++ !virCPUx86SignaturesMatch(candidate->signatures, signature)) {
1774+ VIR_DEBUG("%s differs in signature from matching %s",
1775+ cpuCandidate->model, cpuCurrent->model);
1776+ return 0;
1777+@@ -1994,8 +2032,8 @@ x86DecodeUseCandidate(virCPUx86ModelPtr current,
1778+ * result in longer list of features.
1779+ */
1780+ if (signature &&
1781+- virCPUx86SignaturesMatch(candidate, signature) &&
1782+- !virCPUx86SignaturesMatch(current, signature)) {
1783++ virCPUx86SignaturesMatch(candidate->signatures, signature) &&
1784++ !virCPUx86SignaturesMatch(current->signatures, signature)) {
1785+ VIR_DEBUG("%s provides matching signature", cpuCandidate->model);
1786+ return 1;
1787+ }
1788+@@ -2150,7 +2188,7 @@ x86Decode(virCPUDefPtr cpu,
1789+ if (vendor)
1790+ cpu->vendor = g_strdup(vendor->name);
1791+
1792+- sigs = virCPUx86SignaturesFormat(model);
1793++ sigs = virCPUx86SignaturesFormat(model->signatures);
1794+
1795+ VIR_DEBUG("Using CPU model %s (signatures %s) for CPU with signature %06lx",
1796+ model->name, NULLSTR(sigs), (unsigned long)signature);
1797+@@ -3046,9 +3084,12 @@ virCPUx86Translate(virCPUDefPtr cpu,
1798+ virCPUx86DataAddItem(&model->data, &model->vendor->data) < 0)
1799+ return -1;
1800+
1801+- if (model->signatures &&
1802+- x86DataAddSignature(&model->data, model->signatures[0]) < 0)
1803+- return -1;
1804++ if (model->signatures && model->signatures->count > 0) {
1805++ virCPUx86Signature *sig = &model->signatures->items[0];
1806++ if (x86DataAddSignature(&model->data,
1807++ virCPUx86SignatureToCPUID(sig)) < 0)
1808++ return -1;
1809++ }
1810+
1811+ if (!(translated = virCPUDefCopyWithoutModel(cpu)))
1812+ return -1;
1813+--
1814+2.31.1
1815+
1816diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Baseline.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Baseline.patch
1817new file mode 100644
1818index 0000000..cbd1ecc
1819--- /dev/null
1820+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Baseline.patch
1821@@ -0,0 +1,157 @@
1822+From 5efefe7d7eb129b72bcbbebfbba2d5750ffeeeff Mon Sep 17 00:00:00 2001
1823+From: Jiri Denemark <jdenemar@redhat.com>
1824+Date: Wed, 25 Mar 2020 10:34:09 +0100
1825+Subject: [PATCH] cpu_x86: Use g_auto* in virCPUx86Baseline
1826+MIME-Version: 1.0
1827+Content-Type: text/plain; charset=UTF-8
1828+Content-Transfer-Encoding: 8bit
1829+
1830+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
1831+Reviewed-by: Ján Tomko <jtomko@redhat.com>
1832+
1833+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=5efefe7d7e
1834+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
1835+Last-Update: 2021-04-07
1836+
1837+---
1838+ src/cpu/cpu_x86.c | 46 +++++++++++++++++-----------------------------
1839+ 1 file changed, 17 insertions(+), 29 deletions(-)
1840+
1841+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
1842+index 50fdc76326..3ab70e7c20 100644
1843+--- a/src/cpu/cpu_x86.c
1844++++ b/src/cpu/cpu_x86.c
1845+@@ -2697,21 +2697,20 @@ virCPUx86Baseline(virCPUDefPtr *cpus,
1846+ bool migratable)
1847+ {
1848+ virCPUx86MapPtr map = NULL;
1849+- virCPUx86ModelPtr base_model = NULL;
1850+- virCPUDefPtr cpu = NULL;
1851++ g_autoptr(virCPUx86Model) base_model = NULL;
1852++ g_autoptr(virCPUDef) cpu = NULL;
1853+ size_t i;
1854+ virCPUx86VendorPtr vendor = NULL;
1855+- virCPUx86ModelPtr model = NULL;
1856+ bool outputVendor = true;
1857+ const char *modelName;
1858+ bool matchingNames = true;
1859+- virCPUDataPtr featData = NULL;
1860++ g_autoptr(virCPUData) featData = NULL;
1861+
1862+ if (!(map = virCPUx86GetMap()))
1863+- goto error;
1864++ return NULL;
1865+
1866+ if (!(base_model = x86ModelFromCPU(cpus[0], map, -1)))
1867+- goto error;
1868++ return NULL;
1869+
1870+ cpu = virCPUDefNew();
1871+
1872+@@ -2723,11 +2722,12 @@ virCPUx86Baseline(virCPUDefPtr *cpus,
1873+ } else if (!(vendor = x86VendorFind(map, cpus[0]->vendor))) {
1874+ virReportError(VIR_ERR_OPERATION_FAILED,
1875+ _("Unknown CPU vendor %s"), cpus[0]->vendor);
1876+- goto error;
1877++ return NULL;
1878+ }
1879+
1880+ modelName = cpus[0]->model;
1881+ for (i = 1; i < ncpus; i++) {
1882++ g_autoptr(virCPUx86Model) model = NULL;
1883+ const char *vn = NULL;
1884+
1885+ if (matchingNames && cpus[i]->model) {
1886+@@ -2740,14 +2740,14 @@ virCPUx86Baseline(virCPUDefPtr *cpus,
1887+ }
1888+
1889+ if (!(model = x86ModelFromCPU(cpus[i], map, -1)))
1890+- goto error;
1891++ return NULL;
1892+
1893+ if (cpus[i]->vendor && model->vendor &&
1894+ STRNEQ(cpus[i]->vendor, model->vendor->name)) {
1895+ virReportError(VIR_ERR_OPERATION_FAILED,
1896+ _("CPU vendor %s of model %s differs from vendor %s"),
1897+ model->vendor->name, model->name, cpus[i]->vendor);
1898+- goto error;
1899++ return NULL;
1900+ }
1901+
1902+ if (cpus[i]->vendor) {
1903+@@ -2763,30 +2763,28 @@ virCPUx86Baseline(virCPUDefPtr *cpus,
1904+ if (!(vendor = x86VendorFind(map, vn))) {
1905+ virReportError(VIR_ERR_OPERATION_FAILED,
1906+ _("Unknown CPU vendor %s"), vn);
1907+- goto error;
1908++ return NULL;
1909+ }
1910+ } else if (STRNEQ(vendor->name, vn)) {
1911+ virReportError(VIR_ERR_OPERATION_FAILED,
1912+ "%s", _("CPU vendors do not match"));
1913+- goto error;
1914++ return NULL;
1915+ }
1916+ }
1917+
1918+ x86DataIntersect(&base_model->data, &model->data);
1919+- x86ModelFree(model);
1920+- model = NULL;
1921+ }
1922+
1923+ if (features) {
1924+ virCPUx86FeaturePtr feat;
1925+
1926+ if (!(featData = virCPUDataNew(archs[0])))
1927+- goto cleanup;
1928++ return NULL;
1929+
1930+ for (i = 0; features[i]; i++) {
1931+ if ((feat = x86FeatureFind(map, features[i])) &&
1932+ x86DataAdd(&featData->data.x86, &feat->data) < 0)
1933+- goto cleanup;
1934++ return NULL;
1935+ }
1936+
1937+ x86DataIntersect(&base_model->data, &featData->data.x86);
1938+@@ -2795,15 +2793,15 @@ virCPUx86Baseline(virCPUDefPtr *cpus,
1939+ if (x86DataIsEmpty(&base_model->data)) {
1940+ virReportError(VIR_ERR_OPERATION_FAILED,
1941+ "%s", _("CPUs are incompatible"));
1942+- goto error;
1943++ return NULL;
1944+ }
1945+
1946+ if (vendor &&
1947+ virCPUx86DataAddItem(&base_model->data, &vendor->data) < 0)
1948+- goto error;
1949++ return NULL;
1950+
1951+ if (x86Decode(cpu, &base_model->data, models, modelName, migratable) < 0)
1952+- goto error;
1953++ return NULL;
1954+
1955+ if (STREQ_NULLABLE(cpu->model, modelName))
1956+ cpu->fallback = VIR_CPU_FALLBACK_FORBID;
1957+@@ -2811,17 +2809,7 @@ virCPUx86Baseline(virCPUDefPtr *cpus,
1958+ if (!outputVendor)
1959+ VIR_FREE(cpu->vendor);
1960+
1961+- cleanup:
1962+- x86ModelFree(base_model);
1963+- virCPUx86DataFree(featData);
1964+-
1965+- return cpu;
1966+-
1967+- error:
1968+- x86ModelFree(model);
1969+- virCPUDefFree(cpu);
1970+- cpu = NULL;
1971+- goto cleanup;
1972++ return g_steal_pointer(&cpu);
1973+ }
1974+
1975+
1976+--
1977+2.31.1
1978+
1979diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86CheckFeature.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86CheckFeature.patch
1980new file mode 100644
1981index 0000000..d4b9a38
1982--- /dev/null
1983+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86CheckFeature.patch
1984@@ -0,0 +1,51 @@
1985+From 3b5f1ca58e8f12bc7b768206cb9c7c2ef237e3ff Mon Sep 17 00:00:00 2001
1986+From: Jiri Denemark <jdenemar@redhat.com>
1987+Date: Wed, 25 Mar 2020 11:31:29 +0100
1988+Subject: [PATCH] cpu_x86: Use g_auto* in virCPUx86CheckFeature
1989+MIME-Version: 1.0
1990+Content-Type: text/plain; charset=UTF-8
1991+Content-Transfer-Encoding: 8bit
1992+
1993+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
1994+Reviewed-by: Ján Tomko <jtomko@redhat.com>
1995+
1996+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=3b5f1ca58e
1997+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
1998+Last-Update: 2021-04-07
1999+
2000+---
2001+ src/cpu/cpu_x86.c | 11 +++--------
2002+ 1 file changed, 3 insertions(+), 8 deletions(-)
2003+
2004+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
2005+index afdde24754..3bb212a909 100644
2006+--- a/src/cpu/cpu_x86.c
2007++++ b/src/cpu/cpu_x86.c
2008+@@ -2278,21 +2278,16 @@ static int
2009+ virCPUx86CheckFeature(const virCPUDef *cpu,
2010+ const char *name)
2011+ {
2012+- int ret = -1;
2013+ virCPUx86MapPtr map;
2014+- virCPUx86ModelPtr model = NULL;
2015++ g_autoptr(virCPUx86Model) model = NULL;
2016+
2017+ if (!(map = virCPUx86GetMap()))
2018+ return -1;
2019+
2020+ if (!(model = x86ModelFromCPU(cpu, map, -1)))
2021+- goto cleanup;
2022+-
2023+- ret = x86FeatureInData(name, &model->data, map);
2024++ return -1;
2025+
2026+- cleanup:
2027+- x86ModelFree(model);
2028+- return ret;
2029++ return x86FeatureInData(name, &model->data, map);
2030+ }
2031+
2032+
2033+--
2034+2.31.1
2035+
2036diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Compare.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Compare.patch
2037new file mode 100644
2038index 0000000..317e315
2039--- /dev/null
2040+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Compare.patch
2041@@ -0,0 +1,66 @@
2042+From bc62d7a49141d745b19d066c07599f228020a0b3 Mon Sep 17 00:00:00 2001
2043+From: Jiri Denemark <jdenemar@redhat.com>
2044+Date: Wed, 25 Mar 2020 11:30:24 +0100
2045+Subject: [PATCH] cpu_x86: Use g_auto* in virCPUx86Compare
2046+MIME-Version: 1.0
2047+Content-Type: text/plain; charset=UTF-8
2048+Content-Transfer-Encoding: 8bit
2049+
2050+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2051+Reviewed-by: Ján Tomko <jtomko@redhat.com>
2052+
2053+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=bc62d7a491
2054+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
2055+Last-Update: 2021-04-07
2056+
2057+---
2058+ src/cpu/cpu_x86.c | 16 +++++++---------
2059+ 1 file changed, 7 insertions(+), 9 deletions(-)
2060+
2061+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
2062+index 7a59680516..feefd6cfee 100644
2063+--- a/src/cpu/cpu_x86.c
2064++++ b/src/cpu/cpu_x86.c
2065+@@ -1847,32 +1847,30 @@ virCPUx86Compare(virCPUDefPtr host,
2066+ virCPUDefPtr cpu,
2067+ bool failIncompatible)
2068+ {
2069+- virCPUCompareResult ret = VIR_CPU_COMPARE_ERROR;
2070+- char *message = NULL;
2071++ virCPUCompareResult ret;
2072++ g_autofree char *message = NULL;
2073+
2074+ if (!host || !host->model) {
2075+ if (failIncompatible) {
2076+ virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s",
2077+ _("unknown host CPU"));
2078+- } else {
2079+- VIR_WARN("unknown host CPU");
2080+- ret = VIR_CPU_COMPARE_INCOMPATIBLE;
2081++ return VIR_CPU_COMPARE_ERROR;
2082+ }
2083+- goto cleanup;
2084++
2085++ VIR_WARN("unknown host CPU");
2086++ return VIR_CPU_COMPARE_INCOMPATIBLE;
2087+ }
2088+
2089+ ret = x86Compute(host, cpu, NULL, &message);
2090+
2091+ if (ret == VIR_CPU_COMPARE_INCOMPATIBLE && failIncompatible) {
2092+- ret = VIR_CPU_COMPARE_ERROR;
2093+ if (message)
2094+ virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s", message);
2095+ else
2096+ virReportError(VIR_ERR_CPU_INCOMPATIBLE, NULL);
2097++ return VIR_CPU_COMPARE_ERROR;
2098+ }
2099+
2100+- cleanup:
2101+- VIR_FREE(message);
2102+ return ret;
2103+ }
2104+
2105+--
2106+2.31.1
2107+
2108diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86CopyMigratable.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86CopyMigratable.patch
2109new file mode 100644
2110index 0000000..be23841
2111--- /dev/null
2112+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86CopyMigratable.patch
2113@@ -0,0 +1,51 @@
2114+From a32a3e934f5e7769dc9d12a221f344319200b435 Mon Sep 17 00:00:00 2001
2115+From: Jiri Denemark <jdenemar@redhat.com>
2116+Date: Wed, 25 Mar 2020 18:50:15 +0100
2117+Subject: [PATCH] cpu_x86: Use g_auto* in virCPUx86CopyMigratable
2118+MIME-Version: 1.0
2119+Content-Type: text/plain; charset=UTF-8
2120+Content-Transfer-Encoding: 8bit
2121+
2122+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2123+Reviewed-by: Ján Tomko <jtomko@redhat.com>
2124+
2125+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=a32a3e934f
2126+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
2127+Last-Update: 2021-04-07
2128+
2129+---
2130+ src/cpu/cpu_x86.c | 10 +++-------
2131+ 1 file changed, 3 insertions(+), 7 deletions(-)
2132+
2133+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
2134+index c3b8adaea0..f40609f7e4 100644
2135+--- a/src/cpu/cpu_x86.c
2136++++ b/src/cpu/cpu_x86.c
2137+@@ -3109,7 +3109,7 @@ x86FeatureFilterMigratable(const char *name,
2138+ static virCPUDefPtr
2139+ virCPUx86CopyMigratable(virCPUDefPtr cpu)
2140+ {
2141+- virCPUDefPtr copy;
2142++ g_autoptr(virCPUDef) copy = NULL;
2143+ virCPUx86MapPtr map;
2144+
2145+ if (!(map = virCPUx86GetMap()))
2146+@@ -3120,13 +3120,9 @@ virCPUx86CopyMigratable(virCPUDefPtr cpu)
2147+
2148+ if (virCPUDefCopyModelFilter(copy, cpu, false,
2149+ x86FeatureFilterMigratable, map) < 0)
2150+- goto error;
2151+-
2152+- return copy;
2153++ return NULL;
2154+
2155+- error:
2156+- virCPUDefFree(copy);
2157+- return NULL;
2158++ return g_steal_pointer(&copy);
2159+ }
2160+
2161+
2162+--
2163+2.31.1
2164+
2165diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86DataParse.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86DataParse.patch
2166new file mode 100644
2167index 0000000..80d0f01
2168--- /dev/null
2169+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86DataParse.patch
2170@@ -0,0 +1,84 @@
2171+From c1532711dda6db27c7f6fa7d86ab5ec5d2ab2224 Mon Sep 17 00:00:00 2001
2172+From: Jiri Denemark <jdenemar@redhat.com>
2173+Date: Wed, 25 Mar 2020 10:32:47 +0100
2174+Subject: [PATCH] cpu_x86: Use g_auto* in virCPUx86DataParse
2175+MIME-Version: 1.0
2176+Content-Type: text/plain; charset=UTF-8
2177+Content-Transfer-Encoding: 8bit
2178+
2179+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2180+Reviewed-by: Ján Tomko <jtomko@redhat.com>
2181+
2182+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=c1532711dd
2183+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
2184+Last-Update: 2021-04-07
2185+
2186+---
2187+ src/cpu/cpu_x86.c | 23 ++++++++---------------
2188+ 1 file changed, 8 insertions(+), 15 deletions(-)
2189+
2190+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
2191+index c41c7da594..34b0087857 100644
2192+--- a/src/cpu/cpu_x86.c
2193++++ b/src/cpu/cpu_x86.c
2194+@@ -1636,8 +1636,8 @@ virCPUx86DataFormat(const virCPUData *data)
2195+ static virCPUDataPtr
2196+ virCPUx86DataParse(xmlXPathContextPtr ctxt)
2197+ {
2198+- xmlNodePtr *nodes = NULL;
2199+- virCPUDataPtr cpuData = NULL;
2200++ g_autofree xmlNodePtr *nodes = NULL;
2201++ g_autoptr(virCPUData) cpuData = NULL;
2202+ virCPUx86DataItem item;
2203+ size_t i;
2204+ int n;
2205+@@ -1646,11 +1646,11 @@ virCPUx86DataParse(xmlXPathContextPtr ctxt)
2206+ if (n <= 0) {
2207+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
2208+ _("no x86 CPU data found"));
2209+- goto error;
2210++ return NULL;
2211+ }
2212+
2213+ if (!(cpuData = virCPUDataNew(VIR_ARCH_X86_64)))
2214+- goto error;
2215++ return NULL;
2216+
2217+ for (i = 0; i < n; i++) {
2218+ ctxt->node = nodes[i];
2219+@@ -1658,28 +1658,21 @@ virCPUx86DataParse(xmlXPathContextPtr ctxt)
2220+ if (x86ParseCPUID(ctxt, &item) < 0) {
2221+ virReportError(VIR_ERR_INTERNAL_ERROR,
2222+ _("failed to parse cpuid[%zu]"), i);
2223+- goto error;
2224++ return NULL;
2225+ }
2226+ } else {
2227+ if (x86ParseMSR(ctxt, &item) < 0) {
2228+ virReportError(VIR_ERR_INTERNAL_ERROR,
2229+ _("failed to parse msr[%zu]"), i);
2230+- goto error;
2231++ return NULL;
2232+ }
2233+ }
2234+
2235+ if (virCPUx86DataAdd(cpuData, &item) < 0)
2236+- goto error;
2237++ return NULL;
2238+ }
2239+
2240+- cleanup:
2241+- VIR_FREE(nodes);
2242+- return cpuData;
2243+-
2244+- error:
2245+- virCPUx86DataFree(cpuData);
2246+- cpuData = NULL;
2247+- goto cleanup;
2248++ return g_steal_pointer(&cpuData);
2249+ }
2250+
2251+
2252+--
2253+2.31.1
2254+
2255diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86ExpandFeatures.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86ExpandFeatures.patch
2256new file mode 100644
2257index 0000000..5b5c399
2258--- /dev/null
2259+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86ExpandFeatures.patch
2260@@ -0,0 +1,83 @@
2261+From ff6897c84504a3e663759d710968ad1f72bc9208 Mon Sep 17 00:00:00 2001
2262+From: Jiri Denemark <jdenemar@redhat.com>
2263+Date: Wed, 25 Mar 2020 11:32:57 +0100
2264+Subject: [PATCH] cpu_x86: Use g_auto* in virCPUx86ExpandFeatures
2265+MIME-Version: 1.0
2266+Content-Type: text/plain; charset=UTF-8
2267+Content-Transfer-Encoding: 8bit
2268+
2269+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2270+Reviewed-by: Ján Tomko <jtomko@redhat.com>
2271+
2272+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=ff6897c845
2273+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
2274+Last-Update: 2021-04-07
2275+
2276+---
2277+ src/cpu/cpu_x86.c | 22 ++++++++--------------
2278+ 1 file changed, 8 insertions(+), 14 deletions(-)
2279+
2280+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
2281+index cf573b6711..c3b8adaea0 100644
2282+--- a/src/cpu/cpu_x86.c
2283++++ b/src/cpu/cpu_x86.c
2284+@@ -3055,30 +3055,29 @@ static int
2285+ virCPUx86ExpandFeatures(virCPUDefPtr cpu)
2286+ {
2287+ virCPUx86MapPtr map;
2288+- virCPUDefPtr expanded = NULL;
2289+- virCPUx86ModelPtr model = NULL;
2290++ g_autoptr(virCPUDef) expanded = NULL;
2291++ g_autoptr(virCPUx86Model) model = NULL;
2292+ bool host = cpu->type == VIR_CPU_TYPE_HOST;
2293+ size_t i;
2294+- int ret = -1;
2295+
2296+ if (!(map = virCPUx86GetMap()))
2297+- goto cleanup;
2298++ return -1;
2299+
2300+ if (!(expanded = virCPUDefCopy(cpu)))
2301+- goto cleanup;
2302++ return -1;
2303+
2304+ virCPUDefFreeFeatures(expanded);
2305+
2306+ if (!(model = x86ModelFind(map, cpu->model))) {
2307+ virReportError(VIR_ERR_INTERNAL_ERROR,
2308+ _("unknown CPU model %s"), cpu->model);
2309+- goto cleanup;
2310++ return -1;
2311+ }
2312+
2313+ if (!(model = x86ModelCopy(model)) ||
2314+ x86DataToCPUFeatures(expanded, host ? -1 : VIR_CPU_FEATURE_REQUIRE,
2315+ &model->data, map) < 0)
2316+- goto cleanup;
2317++ return -1;
2318+
2319+ for (i = 0; i < cpu->nfeatures; i++) {
2320+ virCPUFeatureDefPtr f = cpu->features + i;
2321+@@ -3089,17 +3088,12 @@ virCPUx86ExpandFeatures(virCPUDefPtr cpu)
2322+ continue;
2323+
2324+ if (virCPUDefUpdateFeature(expanded, f->name, f->policy) < 0)
2325+- goto cleanup;
2326++ return -1;
2327+ }
2328+
2329+ virCPUDefFreeModel(cpu);
2330+
2331+- ret = virCPUDefCopyModel(cpu, expanded, false);
2332+-
2333+- cleanup:
2334+- virCPUDefFree(expanded);
2335+- x86ModelFree(model);
2336+- return ret;
2337++ return virCPUDefCopyModel(cpu, expanded, false);
2338+ }
2339+
2340+
2341+--
2342+2.31.1
2343+
2344diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86GetHost.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86GetHost.patch
2345new file mode 100644
2346index 0000000..42dae8f
2347--- /dev/null
2348+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86GetHost.patch
2349@@ -0,0 +1,68 @@
2350+From 4a7f6f43a2a6144780d7ab74b8a6f6b008a7aa9d Mon Sep 17 00:00:00 2001
2351+From: Jiri Denemark <jdenemar@redhat.com>
2352+Date: Wed, 25 Mar 2020 10:33:48 +0100
2353+Subject: [PATCH] cpu_x86: Use g_auto* in virCPUx86GetHost
2354+MIME-Version: 1.0
2355+Content-Type: text/plain; charset=UTF-8
2356+Content-Transfer-Encoding: 8bit
2357+
2358+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2359+Reviewed-by: Ján Tomko <jtomko@redhat.com>
2360+
2361+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=4a7f6f43a2
2362+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
2363+Last-Update: 2021-04-07
2364+
2365+---
2366+ src/cpu/cpu_x86.c | 14 ++++++--------
2367+ 1 file changed, 6 insertions(+), 8 deletions(-)
2368+
2369+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
2370+index 3bb212a909..50fdc76326 100644
2371+--- a/src/cpu/cpu_x86.c
2372++++ b/src/cpu/cpu_x86.c
2373+@@ -2637,18 +2637,18 @@ static int
2374+ virCPUx86GetHost(virCPUDefPtr cpu,
2375+ virDomainCapsCPUModelsPtr models)
2376+ {
2377+- virCPUDataPtr cpuData = NULL;
2378+- int ret = -1;
2379++ g_autoptr(virCPUData) cpuData = NULL;
2380++ int ret;
2381+
2382+ if (virCPUx86DriverInitialize() < 0)
2383+- goto cleanup;
2384++ return -1;
2385+
2386+ if (!(cpuData = virCPUDataNew(archs[0])))
2387+- goto cleanup;
2388++ return -1;
2389+
2390+ if (cpuidSet(CPUX86_BASIC, cpuData) < 0 ||
2391+ cpuidSet(CPUX86_EXTENDED, cpuData) < 0)
2392+- goto cleanup;
2393++ return -1;
2394+
2395+ /* Read the IA32_ARCH_CAPABILITIES MSR (0x10a) if supported.
2396+ * This is best effort since there might be no way to read the MSR
2397+@@ -2668,7 +2668,7 @@ virCPUx86GetHost(virCPUDefPtr cpu,
2398+ };
2399+
2400+ if (virCPUx86DataAdd(cpuData, &item) < 0)
2401+- goto cleanup;
2402++ return -1;
2403+ }
2404+ }
2405+
2406+@@ -2684,8 +2684,6 @@ virCPUx86GetHost(virCPUDefPtr cpu,
2407+ VIR_DEBUG("Host CPU does not support invariant TSC");
2408+ }
2409+
2410+- cleanup:
2411+- virCPUx86DataFree(cpuData);
2412+ return ret;
2413+ }
2414+ #endif
2415+--
2416+2.31.1
2417+
2418diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86LoadMap.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86LoadMap.patch
2419new file mode 100644
2420index 0000000..7c7a1f3
2421--- /dev/null
2422+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86LoadMap.patch
2423@@ -0,0 +1,48 @@
2424+From 3c650a8f7a89046b925fb5ddc78c4b6669ed76ef Mon Sep 17 00:00:00 2001
2425+From: Jiri Denemark <jdenemar@redhat.com>
2426+Date: Wed, 25 Mar 2020 14:52:01 +0100
2427+Subject: [PATCH] cpu_x86: Use g_auto* in virCPUx86LoadMap
2428+MIME-Version: 1.0
2429+Content-Type: text/plain; charset=UTF-8
2430+Content-Transfer-Encoding: 8bit
2431+
2432+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2433+Reviewed-by: Ján Tomko <jtomko@redhat.com>
2434+
2435+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=3c650a8f7a
2436+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
2437+Last-Update: 2021-04-07
2438+
2439+---
2440+ src/cpu/cpu_x86.c | 10 +++-------
2441+ 1 file changed, 3 insertions(+), 7 deletions(-)
2442+
2443+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
2444+index 983730f0c2..c41c7da594 100644
2445+--- a/src/cpu/cpu_x86.c
2446++++ b/src/cpu/cpu_x86.c
2447+@@ -1559,18 +1559,14 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Map, x86MapFree);
2448+ static virCPUx86MapPtr
2449+ virCPUx86LoadMap(void)
2450+ {
2451+- virCPUx86MapPtr map;
2452++ g_autoptr(virCPUx86Map) map = NULL;
2453+
2454+ map = g_new0(virCPUx86Map, 1);
2455+
2456+ if (cpuMapLoad("x86", x86VendorParse, x86FeatureParse, x86ModelParse, map) < 0)
2457+- goto error;
2458+-
2459+- return map;
2460++ return NULL;
2461+
2462+- error:
2463+- x86MapFree(map);
2464+- return NULL;
2465++ return g_steal_pointer(&map);
2466+ }
2467+
2468+
2469+--
2470+2.31.1
2471+
2472diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Translate.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Translate.patch
2473new file mode 100644
2474index 0000000..0b37b7d
2475--- /dev/null
2476+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Translate.patch
2477@@ -0,0 +1,82 @@
2478+From dff59020187c34e3f814c2aa24f3832d1d5b34f9 Mon Sep 17 00:00:00 2001
2479+From: Jiri Denemark <jdenemar@redhat.com>
2480+Date: Wed, 25 Mar 2020 11:32:44 +0100
2481+Subject: [PATCH] cpu_x86: Use g_auto* in virCPUx86Translate
2482+MIME-Version: 1.0
2483+Content-Type: text/plain; charset=UTF-8
2484+Content-Transfer-Encoding: 8bit
2485+
2486+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2487+Reviewed-by: Ján Tomko <jtomko@redhat.com>
2488+
2489+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=dff5902018
2490+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
2491+Last-Update: 2021-04-07
2492+
2493+---
2494+ src/cpu/cpu_x86.c | 26 ++++++++++----------------
2495+ 1 file changed, 10 insertions(+), 16 deletions(-)
2496+
2497+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
2498+index 70aadfaa99..cf573b6711 100644
2499+--- a/src/cpu/cpu_x86.c
2500++++ b/src/cpu/cpu_x86.c
2501+@@ -3015,45 +3015,39 @@ static int
2502+ virCPUx86Translate(virCPUDefPtr cpu,
2503+ virDomainCapsCPUModelsPtr models)
2504+ {
2505+- virCPUDefPtr translated = NULL;
2506++ g_autoptr(virCPUDef) translated = NULL;
2507+ virCPUx86MapPtr map;
2508+- virCPUx86ModelPtr model = NULL;
2509++ g_autoptr(virCPUx86Model) model = NULL;
2510+ size_t i;
2511+- int ret = -1;
2512+
2513+ if (!(map = virCPUx86GetMap()))
2514+- goto cleanup;
2515++ return -1;
2516+
2517+ if (!(model = x86ModelFromCPU(cpu, map, -1)))
2518+- goto cleanup;
2519++ return -1;
2520+
2521+ if (model->vendor &&
2522+ virCPUx86DataAddItem(&model->data, &model->vendor->data) < 0)
2523+- goto cleanup;
2524++ return -1;
2525+
2526+ if (model->signatures &&
2527+ x86DataAddSignature(&model->data, model->signatures[0]) < 0)
2528+- goto cleanup;
2529++ return -1;
2530+
2531+ if (!(translated = virCPUDefCopyWithoutModel(cpu)))
2532+- goto cleanup;
2533++ return -1;
2534+
2535+ if (x86Decode(translated, &model->data, models, NULL, false) < 0)
2536+- goto cleanup;
2537++ return -1;
2538+
2539+ for (i = 0; i < cpu->nfeatures; i++) {
2540+ virCPUFeatureDefPtr f = cpu->features + i;
2541+ if (virCPUDefUpdateFeature(translated, f->name, f->policy) < 0)
2542+- goto cleanup;
2543++ return -1;
2544+ }
2545+
2546+ virCPUDefStealModel(cpu, translated, true);
2547+- ret = 0;
2548+-
2549+- cleanup:
2550+- virCPUDefFree(translated);
2551+- x86ModelFree(model);
2552+- return ret;
2553++ return 0;
2554+ }
2555+
2556+
2557+--
2558+2.31.1
2559+
2560diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Update.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Update.patch
2561new file mode 100644
2562index 0000000..7a11331
2563--- /dev/null
2564+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86Update.patch
2565@@ -0,0 +1,70 @@
2566+From e0244a786db265647ab6c1c37ca3852876e4b0a3 Mon Sep 17 00:00:00 2001
2567+From: Jiri Denemark <jdenemar@redhat.com>
2568+Date: Wed, 25 Mar 2020 11:32:09 +0100
2569+Subject: [PATCH] cpu_x86: Use g_auto* in virCPUx86Update
2570+MIME-Version: 1.0
2571+Content-Type: text/plain; charset=UTF-8
2572+Content-Transfer-Encoding: 8bit
2573+
2574+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2575+Reviewed-by: Ján Tomko <jtomko@redhat.com>
2576+
2577+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=e0244a786d
2578+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
2579+Last-Update: 2021-04-07
2580+
2581+---
2582+ src/cpu/cpu_x86.c | 15 +++++----------
2583+ 1 file changed, 5 insertions(+), 10 deletions(-)
2584+
2585+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
2586+index 0300bd08da..0408bb5638 100644
2587+--- a/src/cpu/cpu_x86.c
2588++++ b/src/cpu/cpu_x86.c
2589+@@ -2853,9 +2853,8 @@ static int
2590+ virCPUx86Update(virCPUDefPtr guest,
2591+ const virCPUDef *host)
2592+ {
2593+- virCPUx86ModelPtr model = NULL;
2594++ g_autoptr(virCPUx86Model) model = NULL;
2595+ virCPUx86MapPtr map;
2596+- int ret = -1;
2597+ size_t i;
2598+
2599+ if (!host) {
2600+@@ -2868,14 +2867,14 @@ virCPUx86Update(virCPUDefPtr guest,
2601+ return -1;
2602+
2603+ if (!(model = x86ModelFromCPU(host, map, -1)))
2604+- goto cleanup;
2605++ return -1;
2606+
2607+ for (i = 0; i < guest->nfeatures; i++) {
2608+ if (guest->features[i].policy == VIR_CPU_FEATURE_OPTIONAL) {
2609+ int supported = x86FeatureInData(guest->features[i].name,
2610+ &model->data, map);
2611+ if (supported < 0)
2612+- goto cleanup;
2613++ return -1;
2614+ else if (supported)
2615+ guest->features[i].policy = VIR_CPU_FEATURE_REQUIRE;
2616+ else
2617+@@ -2885,13 +2884,9 @@ virCPUx86Update(virCPUDefPtr guest,
2618+
2619+ if (guest->mode == VIR_CPU_MODE_HOST_MODEL ||
2620+ guest->match == VIR_CPU_MATCH_MINIMUM)
2621+- ret = x86UpdateHostModel(guest, host);
2622+- else
2623+- ret = 0;
2624++ return x86UpdateHostModel(guest, host);
2625+
2626+- cleanup:
2627+- x86ModelFree(model);
2628+- return ret;
2629++ return 0;
2630+ }
2631+
2632+
2633+--
2634+2.31.1
2635+
2636diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86UpdateLive.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86UpdateLive.patch
2637new file mode 100644
2638index 0000000..d7f913a
2639--- /dev/null
2640+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-virCPUx86UpdateLive.patch
2641@@ -0,0 +1,101 @@
2642+From 2748e91c548cbc48a5ea499e06e62de528c10d20 Mon Sep 17 00:00:00 2001
2643+From: Jiri Denemark <jdenemar@redhat.com>
2644+Date: Wed, 25 Mar 2020 10:30:10 +0100
2645+Subject: [PATCH] cpu_x86: Use g_auto* in virCPUx86UpdateLive
2646+MIME-Version: 1.0
2647+Content-Type: text/plain; charset=UTF-8
2648+Content-Transfer-Encoding: 8bit
2649+
2650+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2651+Reviewed-by: Ján Tomko <jtomko@redhat.com>
2652+
2653+Backport-Note: missing ac36a8246 caused some noise in virCPUx86UpdateLive
2654+Origin: backport, https://libvirt.org/git/?p=libvirt.git;a=commit;h=2748e91c54
2655+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
2656+Last-Update: 2021-04-07
2657+
2658+---
2659+ src/cpu/cpu_x86.c | 42 +++++++++++++++---------------------------
2660+ 1 file changed, 15 insertions(+), 27 deletions(-)
2661+
2662+--- a/src/cpu/cpu_x86.c
2663++++ b/src/cpu/cpu_x86.c
2664+@@ -2896,21 +2896,20 @@ virCPUx86UpdateLive(virCPUDefPtr cpu,
2665+ virCPUDataPtr dataDisabled)
2666+ {
2667+ virCPUx86MapPtr map;
2668+- virCPUx86ModelPtr model = NULL;
2669+- virCPUx86Data enabled = VIR_CPU_X86_DATA_INIT;
2670+- virCPUx86Data disabled = VIR_CPU_X86_DATA_INIT;
2671+- virBuffer bufAdded = VIR_BUFFER_INITIALIZER;
2672+- virBuffer bufRemoved = VIR_BUFFER_INITIALIZER;
2673+- char *added = NULL;
2674+- char *removed = NULL;
2675++ g_autoptr(virCPUx86Model) model = NULL;
2676++ g_auto(virCPUx86Data) enabled = VIR_CPU_X86_DATA_INIT;
2677++ g_auto(virCPUx86Data) disabled = VIR_CPU_X86_DATA_INIT;
2678++ g_auto(virBuffer) bufAdded = VIR_BUFFER_INITIALIZER;
2679++ g_auto(virBuffer) bufRemoved = VIR_BUFFER_INITIALIZER;
2680++ g_autofree char *added = NULL;
2681++ g_autofree char *removed = NULL;
2682+ size_t i;
2683+- int ret = -1;
2684+
2685+ if (!(map = virCPUx86GetMap()))
2686+ return -1;
2687+
2688+ if (!(model = x86ModelFromCPU(cpu, map, -1)))
2689+- goto cleanup;
2690++ return -1;
2691+
2692+ if (dataEnabled)
2693+ x86DataCopy(&enabled, &dataEnabled->data.x86);
2694+@@ -2928,7 +2927,7 @@ virCPUx86UpdateLive(virCPUDefPtr cpu,
2695+ virBufferAsprintf(&bufAdded, "%s,", feature->name);
2696+ else if (virCPUDefUpdateFeature(cpu, feature->name,
2697+ VIR_CPU_FEATURE_REQUIRE) < 0)
2698+- goto cleanup;
2699++ return -1;
2700+ }
2701+
2702+ if (x86DataIsSubset(&disabled, &feature->data) ||
2703+@@ -2939,7 +2938,7 @@ virCPUx86UpdateLive(virCPUDefPtr cpu,
2704+ virBufferAsprintf(&bufRemoved, "%s,", feature->name);
2705+ else if (virCPUDefUpdateFeature(cpu, feature->name,
2706+ VIR_CPU_FEATURE_DISABLE) < 0)
2707+- goto cleanup;
2708++ return -1;
2709+ }
2710+ }
2711+
2712+@@ -2965,27 +2964,17 @@ virCPUx86UpdateLive(virCPUDefPtr cpu,
2713+ _("guest CPU doesn't match specification: "
2714+ "missing features: %s"),
2715+ removed);
2716+- goto cleanup;
2717++ return -1;
2718+ }
2719+
2720+ if (cpu->check == VIR_CPU_CHECK_FULL &&
2721+ !x86DataIsEmpty(&disabled)) {
2722+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
2723+ _("guest CPU doesn't match specification"));
2724+- goto cleanup;
2725++ return -1;
2726+ }
2727+
2728+- ret = 0;
2729+-
2730+- cleanup:
2731+- x86ModelFree(model);
2732+- virCPUx86DataClear(&enabled);
2733+- virCPUx86DataClear(&disabled);
2734+- VIR_FREE(added);
2735+- VIR_FREE(removed);
2736+- virBufferFreeAndReset(&bufAdded);
2737+- virBufferFreeAndReset(&bufRemoved);
2738+- return ret;
2739++ return 0;
2740+ }
2741+
2742+
2743diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86Compute.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86Compute.patch
2744new file mode 100644
2745index 0000000..b500637
2746--- /dev/null
2747+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86Compute.patch
2748@@ -0,0 +1,178 @@
2749+From edf3c9045f1742d6c132066e4ba2da25c9ad7b26 Mon Sep 17 00:00:00 2001
2750+From: Jiri Denemark <jdenemar@redhat.com>
2751+Date: Wed, 25 Mar 2020 10:33:03 +0100
2752+Subject: [PATCH] cpu_x86: Use g_auto* in x86Compute
2753+MIME-Version: 1.0
2754+Content-Type: text/plain; charset=UTF-8
2755+Content-Transfer-Encoding: 8bit
2756+
2757+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2758+Reviewed-by: Ján Tomko <jtomko@redhat.com>
2759+
2760+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=edf3c9045f
2761+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
2762+Last-Update: 2021-04-07
2763+
2764+---
2765+ src/cpu/cpu_x86.c | 65 +++++++++++++++++------------------------------
2766+ 1 file changed, 24 insertions(+), 41 deletions(-)
2767+
2768+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
2769+index 34b0087857..7a59680516 100644
2770+--- a/src/cpu/cpu_x86.c
2771++++ b/src/cpu/cpu_x86.c
2772+@@ -1680,7 +1680,6 @@ virCPUx86DataParse(xmlXPathContextPtr ctxt)
2773+ * redundant code:
2774+ * MSG: error message
2775+ * CPU_DEF: a virCPUx86Data pointer with flags that are conflicting
2776+- * RET: return code to set
2777+ *
2778+ * This macro generates the error string outputs it into logs.
2779+ */
2780+@@ -1689,13 +1688,12 @@ virCPUx86DataParse(xmlXPathContextPtr ctxt)
2781+ char *flagsStr = NULL; \
2782+ if (!(flagsStr = x86FeatureNames(map, ", ", (CPU_DEF)))) { \
2783+ virReportOOMError(); \
2784+- goto error; \
2785++ return VIR_CPU_COMPARE_ERROR; \
2786+ } \
2787+ if (message) \
2788+ *message = g_strdup_printf("%s: %s", _(MSG), flagsStr); \
2789+ VIR_DEBUG("%s: %s", MSG, flagsStr); \
2790+ VIR_FREE(flagsStr); \
2791+- ret = VIR_CPU_COMPARE_INCOMPATIBLE; \
2792+ } while (0)
2793+
2794+
2795+@@ -1706,15 +1704,15 @@ x86Compute(virCPUDefPtr host,
2796+ char **message)
2797+ {
2798+ virCPUx86MapPtr map = NULL;
2799+- virCPUx86ModelPtr host_model = NULL;
2800+- virCPUx86ModelPtr cpu_force = NULL;
2801+- virCPUx86ModelPtr cpu_require = NULL;
2802+- virCPUx86ModelPtr cpu_optional = NULL;
2803+- virCPUx86ModelPtr cpu_disable = NULL;
2804+- virCPUx86ModelPtr cpu_forbid = NULL;
2805+- virCPUx86ModelPtr diff = NULL;
2806+- virCPUx86ModelPtr guest_model = NULL;
2807+- virCPUDataPtr guestData = NULL;
2808++ g_autoptr(virCPUx86Model) host_model = NULL;
2809++ g_autoptr(virCPUx86Model) cpu_force = NULL;
2810++ g_autoptr(virCPUx86Model) cpu_require = NULL;
2811++ g_autoptr(virCPUx86Model) cpu_optional = NULL;
2812++ g_autoptr(virCPUx86Model) cpu_disable = NULL;
2813++ g_autoptr(virCPUx86Model) cpu_forbid = NULL;
2814++ g_autoptr(virCPUx86Model) diff = NULL;
2815++ g_autoptr(virCPUx86Model) guest_model = NULL;
2816++ g_autoptr(virCPUData) guestData = NULL;
2817+ virCPUCompareResult ret;
2818+ virCPUx86CompareResult result;
2819+ virArch arch;
2820+@@ -1764,13 +1762,13 @@ x86Compute(virCPUDefPtr host,
2821+ !(cpu_optional = x86ModelFromCPU(cpu, map, VIR_CPU_FEATURE_OPTIONAL)) ||
2822+ !(cpu_disable = x86ModelFromCPU(cpu, map, VIR_CPU_FEATURE_DISABLE)) ||
2823+ !(cpu_forbid = x86ModelFromCPU(cpu, map, VIR_CPU_FEATURE_FORBID)))
2824+- goto error;
2825++ return VIR_CPU_COMPARE_ERROR;
2826+
2827+ x86DataIntersect(&cpu_forbid->data, &host_model->data);
2828+ if (!x86DataIsEmpty(&cpu_forbid->data)) {
2829+ virX86CpuIncompatible(N_("Host CPU provides forbidden features"),
2830+ &cpu_forbid->data);
2831+- goto cleanup;
2832++ return VIR_CPU_COMPARE_INCOMPATIBLE;
2833+ }
2834+
2835+ /* first remove features that were inherited from the CPU model and were
2836+@@ -1785,20 +1783,20 @@ x86Compute(virCPUDefPtr host,
2837+ virX86CpuIncompatible(N_("Host CPU does not provide required "
2838+ "features"),
2839+ &cpu_require->data);
2840+- goto cleanup;
2841++ return VIR_CPU_COMPARE_INCOMPATIBLE;
2842+ }
2843+
2844+- ret = VIR_CPU_COMPARE_IDENTICAL;
2845+-
2846+ if (!(diff = x86ModelCopy(host_model)))
2847+- goto error;
2848++ return VIR_CPU_COMPARE_ERROR;
2849+
2850+ x86DataSubtract(&diff->data, &cpu_optional->data);
2851+ x86DataSubtract(&diff->data, &cpu_require->data);
2852+ x86DataSubtract(&diff->data, &cpu_disable->data);
2853+ x86DataSubtract(&diff->data, &cpu_force->data);
2854+
2855+- if (!x86DataIsEmpty(&diff->data))
2856++ if (x86DataIsEmpty(&diff->data))
2857++ ret = VIR_CPU_COMPARE_IDENTICAL;
2858++ else
2859+ ret = VIR_CPU_COMPARE_SUPERSET;
2860+
2861+ if (ret == VIR_CPU_COMPARE_SUPERSET
2862+@@ -1807,54 +1805,39 @@ x86Compute(virCPUDefPtr host,
2863+ virX86CpuIncompatible(N_("Host CPU does not strictly match guest CPU: "
2864+ "Extra features"),
2865+ &diff->data);
2866+- goto cleanup;
2867++ return VIR_CPU_COMPARE_INCOMPATIBLE;
2868+ }
2869+
2870+ if (guest) {
2871+ if (!(guest_model = x86ModelCopy(host_model)))
2872+- goto error;
2873++ return VIR_CPU_COMPARE_ERROR;
2874+
2875+ if (cpu->vendor && host_model->vendor &&
2876+ virCPUx86DataAddItem(&guest_model->data,
2877+ &host_model->vendor->data) < 0)
2878+- goto error;
2879++ return VIR_CPU_COMPARE_ERROR;
2880+
2881+ if (host_model->signatures &&
2882+ x86DataAddSignature(&guest_model->data, *host_model->signatures) < 0)
2883+- goto error;
2884++ return VIR_CPU_COMPARE_ERROR;
2885+
2886+ if (cpu->type == VIR_CPU_TYPE_GUEST
2887+ && cpu->match == VIR_CPU_MATCH_EXACT)
2888+ x86DataSubtract(&guest_model->data, &diff->data);
2889+
2890+ if (x86DataAdd(&guest_model->data, &cpu_force->data))
2891+- goto error;
2892++ return VIR_CPU_COMPARE_ERROR;
2893+
2894+ x86DataSubtract(&guest_model->data, &cpu_disable->data);
2895+
2896+ if (!(guestData = virCPUDataNew(arch)))
2897+- goto error;
2898++ return VIR_CPU_COMPARE_ERROR;
2899+ x86DataCopy(&guestData->data.x86, &guest_model->data);
2900+
2901+- *guest = guestData;
2902++ *guest = g_steal_pointer(&guestData);
2903+ }
2904+
2905+- cleanup:
2906+- x86ModelFree(host_model);
2907+- x86ModelFree(diff);
2908+- x86ModelFree(cpu_force);
2909+- x86ModelFree(cpu_require);
2910+- x86ModelFree(cpu_optional);
2911+- x86ModelFree(cpu_disable);
2912+- x86ModelFree(cpu_forbid);
2913+- x86ModelFree(guest_model);
2914+-
2915+ return ret;
2916+-
2917+- error:
2918+- virCPUx86DataFree(guestData);
2919+- ret = VIR_CPU_COMPARE_ERROR;
2920+- goto cleanup;
2921+ }
2922+ #undef virX86CpuIncompatible
2923+
2924+--
2925+2.31.1
2926+
2927diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86DataToCPU.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86DataToCPU.patch
2928new file mode 100644
2929index 0000000..ac91559
2930--- /dev/null
2931+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86DataToCPU.patch
2932@@ -0,0 +1,68 @@
2933+From 4f2fdad36db2da1aa139470846b3f60f65da8424 Mon Sep 17 00:00:00 2001
2934+From: Jiri Denemark <jdenemar@redhat.com>
2935+Date: Wed, 25 Mar 2020 10:29:39 +0100
2936+Subject: [PATCH] cpu_x86: Use g_auto* in x86DataToCPU
2937+MIME-Version: 1.0
2938+Content-Type: text/plain; charset=UTF-8
2939+Content-Transfer-Encoding: 8bit
2940+
2941+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2942+Reviewed-by: Ján Tomko <jtomko@redhat.com>
2943+
2944+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=4f2fdad36d
2945+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
2946+Last-Update: 2021-04-07
2947+
2948+---
2949+ src/cpu/cpu_x86.c | 20 ++++++--------------
2950+ 1 file changed, 6 insertions(+), 14 deletions(-)
2951+
2952+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
2953+index 3c08edcd73..be4f40f470 100644
2954+--- a/src/cpu/cpu_x86.c
2955++++ b/src/cpu/cpu_x86.c
2956+@@ -771,9 +771,9 @@ x86DataToCPU(const virCPUx86Data *data,
2957+ virCPUx86MapPtr map,
2958+ virDomainCapsCPUModelPtr hvModel)
2959+ {
2960+- virCPUDefPtr cpu;
2961+- virCPUx86Data copy = VIR_CPU_X86_DATA_INIT;
2962+- virCPUx86Data modelData = VIR_CPU_X86_DATA_INIT;
2963++ g_autoptr(virCPUDef) cpu = NULL;
2964++ g_auto(virCPUx86Data) copy = VIR_CPU_X86_DATA_INIT;
2965++ g_auto(virCPUx86Data) modelData = VIR_CPU_X86_DATA_INIT;
2966+ virCPUx86VendorPtr vendor;
2967+
2968+ cpu = virCPUDefNew();
2969+@@ -801,7 +801,7 @@ x86DataToCPU(const virCPUx86Data *data,
2970+ if ((feature = x86FeatureFind(map, *blocker)) &&
2971+ !x86DataIsSubset(&copy, &feature->data))
2972+ if (x86DataAdd(&modelData, &feature->data) < 0)
2973+- goto error;
2974++ return NULL;
2975+ }
2976+ }
2977+
2978+@@ -810,17 +810,9 @@ x86DataToCPU(const virCPUx86Data *data,
2979+
2980+ if (x86DataToCPUFeatures(cpu, VIR_CPU_FEATURE_REQUIRE, &copy, map) ||
2981+ x86DataToCPUFeatures(cpu, VIR_CPU_FEATURE_DISABLE, &modelData, map))
2982+- goto error;
2983+-
2984+- cleanup:
2985+- virCPUx86DataClear(&modelData);
2986+- virCPUx86DataClear(&copy);
2987+- return cpu;
2988++ return NULL;
2989+
2990+- error:
2991+- virCPUDefFree(cpu);
2992+- cpu = NULL;
2993+- goto cleanup;
2994++ return g_steal_pointer(&cpu);
2995+ }
2996+
2997+
2998+--
2999+2.31.1
3000+
3001diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86Decode.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86Decode.patch
3002new file mode 100644
3003index 0000000..7502be0
3004--- /dev/null
3005+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86Decode.patch
3006@@ -0,0 +1,96 @@
3007+From 9bb9cbf6761ecf985fe9cf8a18030a8aff9b448b Mon Sep 17 00:00:00 2001
3008+From: Jiri Denemark <jdenemar@redhat.com>
3009+Date: Wed, 25 Mar 2020 10:29:54 +0100
3010+Subject: [PATCH] cpu_x86: Use g_auto* in x86Decode
3011+MIME-Version: 1.0
3012+Content-Type: text/plain; charset=UTF-8
3013+Content-Transfer-Encoding: 8bit
3014+
3015+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3016+Reviewed-by: Ján Tomko <jtomko@redhat.com>
3017+
3018+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=9bb9cbf676
3019+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
3020+Last-Update: 2021-04-07
3021+
3022+---
3023+ src/cpu/cpu_x86.c | 24 +++++++-----------------
3024+ 1 file changed, 7 insertions(+), 17 deletions(-)
3025+
3026+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
3027+index feefd6cfee..471ca3e93d 100644
3028+--- a/src/cpu/cpu_x86.c
3029++++ b/src/cpu/cpu_x86.c
3030+@@ -2032,15 +2032,12 @@ x86Decode(virCPUDefPtr cpu,
3031+ const char *preferred,
3032+ bool migratable)
3033+ {
3034+- int ret = -1;
3035+ virCPUx86MapPtr map;
3036+ virCPUx86ModelPtr candidate;
3037+ virCPUDefPtr cpuCandidate;
3038+ virCPUx86ModelPtr model = NULL;
3039+- virCPUDefPtr cpuModel = NULL;
3040+- virCPUx86Data data = VIR_CPU_X86_DATA_INIT;
3041+- virCPUx86Data copy = VIR_CPU_X86_DATA_INIT;
3042+- virCPUx86Data features = VIR_CPU_X86_DATA_INIT;
3043++ g_autoptr(virCPUDef) cpuModel = NULL;
3044++ g_auto(virCPUx86Data) data = VIR_CPU_X86_DATA_INIT;
3045+ virCPUx86VendorPtr vendor;
3046+ virDomainCapsCPUModelPtr hvModel = NULL;
3047+ g_autofree char *sigs = NULL;
3048+@@ -2054,7 +2051,7 @@ x86Decode(virCPUDefPtr cpu,
3049+ x86DataCopy(&data, cpuData);
3050+
3051+ if (!(map = virCPUx86GetMap()))
3052+- goto cleanup;
3053++ return -1;
3054+
3055+ vendor = x86DataToVendor(&data, map);
3056+ signature = x86DataToSignature(&data);
3057+@@ -2073,7 +2070,7 @@ x86Decode(virCPUDefPtr cpu,
3058+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
3059+ _("CPU model %s is not supported by hypervisor"),
3060+ preferred);
3061+- goto cleanup;
3062++ return -1;
3063+ } else {
3064+ VIR_WARN("Preferred CPU model %s not allowed by"
3065+ " hypervisor; closest supported model will be"
3066+@@ -2096,7 +2093,7 @@ x86Decode(virCPUDefPtr cpu,
3067+ }
3068+
3069+ if (!(cpuCandidate = x86DataToCPU(&data, candidate, map, hvModel)))
3070+- goto cleanup;
3071++ return -1;
3072+ cpuCandidate->type = cpu->type;
3073+
3074+ if ((rc = x86DecodeUseCandidate(model, cpuModel,
3075+@@ -2115,7 +2112,7 @@ x86Decode(virCPUDefPtr cpu,
3076+ if (!cpuModel) {
3077+ virReportError(VIR_ERR_INTERNAL_ERROR,
3078+ "%s", _("Cannot find suitable CPU model for given data"));
3079+- goto cleanup;
3080++ return -1;
3081+ }
3082+
3083+ /* Remove non-migratable features if requested
3084+@@ -2149,14 +2146,7 @@ x86Decode(virCPUDefPtr cpu,
3085+ cpu->nfeatures_max = cpuModel->nfeatures_max;
3086+ cpuModel->nfeatures_max = 0;
3087+
3088+- ret = 0;
3089+-
3090+- cleanup:
3091+- virCPUDefFree(cpuModel);
3092+- virCPUx86DataClear(&data);
3093+- virCPUx86DataClear(&copy);
3094+- virCPUx86DataClear(&features);
3095+- return ret;
3096++ return 0;
3097+ }
3098+
3099+ static int
3100+--
3101+2.31.1
3102+
3103diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86Encode.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86Encode.patch
3104new file mode 100644
3105index 0000000..255fbf9
3106--- /dev/null
3107+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86Encode.patch
3108@@ -0,0 +1,138 @@
3109+From e6e54fcebe99f1c07fe905c419cbe5d12f6844b1 Mon Sep 17 00:00:00 2001
3110+From: Jiri Denemark <jdenemar@redhat.com>
3111+Date: Wed, 25 Mar 2020 10:33:27 +0100
3112+Subject: [PATCH] cpu_x86: Use g_auto* in x86Encode
3113+MIME-Version: 1.0
3114+Content-Type: text/plain; charset=UTF-8
3115+Content-Transfer-Encoding: 8bit
3116+
3117+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3118+Reviewed-by: Ján Tomko <jtomko@redhat.com>
3119+
3120+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=e6e54fcebe
3121+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
3122+Last-Update: 2021-04-07
3123+
3124+---
3125+ src/cpu/cpu_x86.c | 51 +++++++++++++++++++----------------------------
3126+ 1 file changed, 21 insertions(+), 30 deletions(-)
3127+
3128+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
3129+index 67387df23e..afdde24754 100644
3130+--- a/src/cpu/cpu_x86.c
3131++++ b/src/cpu/cpu_x86.c
3132+@@ -2188,12 +2188,12 @@ x86Encode(virArch arch,
3133+ virCPUDataPtr *vendor)
3134+ {
3135+ virCPUx86MapPtr map = NULL;
3136+- virCPUDataPtr data_forced = NULL;
3137+- virCPUDataPtr data_required = NULL;
3138+- virCPUDataPtr data_optional = NULL;
3139+- virCPUDataPtr data_disabled = NULL;
3140+- virCPUDataPtr data_forbidden = NULL;
3141+- virCPUDataPtr data_vendor = NULL;
3142++ g_autoptr(virCPUData) data_forced = NULL;
3143++ g_autoptr(virCPUData) data_required = NULL;
3144++ g_autoptr(virCPUData) data_optional = NULL;
3145++ g_autoptr(virCPUData) data_disabled = NULL;
3146++ g_autoptr(virCPUData) data_forbidden = NULL;
3147++ g_autoptr(virCPUData) data_vendor = NULL;
3148+
3149+ if (forced)
3150+ *forced = NULL;
3151+@@ -2209,37 +2209,37 @@ x86Encode(virArch arch,
3152+ *vendor = NULL;
3153+
3154+ if (!(map = virCPUx86GetMap()))
3155+- goto error;
3156++ return -1;
3157+
3158+ if (forced &&
3159+ (!(data_forced = virCPUDataNew(arch)) ||
3160+ x86EncodePolicy(&data_forced->data.x86, cpu, map,
3161+ VIR_CPU_FEATURE_FORCE) < 0))
3162+- goto error;
3163++ return -1;
3164+
3165+ if (required &&
3166+ (!(data_required = virCPUDataNew(arch)) ||
3167+ x86EncodePolicy(&data_required->data.x86, cpu, map,
3168+ VIR_CPU_FEATURE_REQUIRE) < 0))
3169+- goto error;
3170++ return -1;
3171+
3172+ if (optional &&
3173+ (!(data_optional = virCPUDataNew(arch)) ||
3174+ x86EncodePolicy(&data_optional->data.x86, cpu, map,
3175+ VIR_CPU_FEATURE_OPTIONAL) < 0))
3176+- goto error;
3177++ return -1;
3178+
3179+ if (disabled &&
3180+ (!(data_disabled = virCPUDataNew(arch)) ||
3181+ x86EncodePolicy(&data_disabled->data.x86, cpu, map,
3182+ VIR_CPU_FEATURE_DISABLE) < 0))
3183+- goto error;
3184++ return -1;
3185+
3186+ if (forbidden &&
3187+ (!(data_forbidden = virCPUDataNew(arch)) ||
3188+ x86EncodePolicy(&data_forbidden->data.x86, cpu, map,
3189+ VIR_CPU_FEATURE_FORBID) < 0))
3190+- goto error;
3191++ return -1;
3192+
3193+ if (vendor) {
3194+ virCPUx86VendorPtr v = NULL;
3195+@@ -2247,39 +2247,30 @@ x86Encode(virArch arch,
3196+ if (cpu->vendor && !(v = x86VendorFind(map, cpu->vendor))) {
3197+ virReportError(VIR_ERR_OPERATION_FAILED,
3198+ _("CPU vendor %s not found"), cpu->vendor);
3199+- goto error;
3200++ return -1;
3201+ }
3202+
3203+ if (!(data_vendor = virCPUDataNew(arch)))
3204+- goto error;
3205++ return -1;
3206+
3207+ if (v && virCPUx86DataAdd(data_vendor, &v->data) < 0)
3208+- goto error;
3209++ return -1;
3210+ }
3211+
3212+ if (forced)
3213+- *forced = data_forced;
3214++ *forced = g_steal_pointer(&data_forced);
3215+ if (required)
3216+- *required = data_required;
3217++ *required = g_steal_pointer(&data_required);
3218+ if (optional)
3219+- *optional = data_optional;
3220++ *optional = g_steal_pointer(&data_optional);
3221+ if (disabled)
3222+- *disabled = data_disabled;
3223++ *disabled = g_steal_pointer(&data_disabled);
3224+ if (forbidden)
3225+- *forbidden = data_forbidden;
3226++ *forbidden = g_steal_pointer(&data_forbidden);
3227+ if (vendor)
3228+- *vendor = data_vendor;
3229++ *vendor = g_steal_pointer(&data_vendor);
3230+
3231+ return 0;
3232+-
3233+- error:
3234+- virCPUx86DataFree(data_forced);
3235+- virCPUx86DataFree(data_required);
3236+- virCPUx86DataFree(data_optional);
3237+- virCPUx86DataFree(data_disabled);
3238+- virCPUx86DataFree(data_forbidden);
3239+- virCPUx86DataFree(data_vendor);
3240+- return -1;
3241+ }
3242+
3243+
3244+--
3245+2.31.1
3246+
3247diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86EncodePolicy.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86EncodePolicy.patch
3248new file mode 100644
3249index 0000000..d231fc5
3250--- /dev/null
3251+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86EncodePolicy.patch
3252@@ -0,0 +1,43 @@
3253+From 5b45d2cf1ff0d2d972f103a678c01bc0eb7c1e18 Mon Sep 17 00:00:00 2001
3254+From: Jiri Denemark <jdenemar@redhat.com>
3255+Date: Wed, 25 Mar 2020 11:30:43 +0100
3256+Subject: [PATCH] cpu_x86: Use g_auto* in x86EncodePolicy
3257+MIME-Version: 1.0
3258+Content-Type: text/plain; charset=UTF-8
3259+Content-Transfer-Encoding: 8bit
3260+
3261+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3262+Reviewed-by: Ján Tomko <jtomko@redhat.com>
3263+
3264+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=5b45d2cf1f
3265+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
3266+Last-Update: 2021-04-07
3267+
3268+---
3269+ src/cpu/cpu_x86.c | 3 +--
3270+ 1 file changed, 1 insertion(+), 2 deletions(-)
3271+
3272+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
3273+index 471ca3e93d..67387df23e 100644
3274+--- a/src/cpu/cpu_x86.c
3275++++ b/src/cpu/cpu_x86.c
3276+@@ -2164,7 +2164,7 @@ x86EncodePolicy(virCPUx86Data *data,
3277+ virCPUx86MapPtr map,
3278+ virCPUFeaturePolicy policy)
3279+ {
3280+- virCPUx86ModelPtr model;
3281++ g_autoptr(virCPUx86Model) model = NULL;
3282+
3283+ if (!(model = x86ModelFromCPU(cpu, map, policy)))
3284+ return -1;
3285+@@ -2172,7 +2172,6 @@ x86EncodePolicy(virCPUx86Data *data,
3286+ *data = model->data;
3287+ model->data.len = 0;
3288+ model->data.items = NULL;
3289+- x86ModelFree(model);
3290+
3291+ return 0;
3292+ }
3293+--
3294+2.31.1
3295+
3296diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86FeatureParse.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86FeatureParse.patch
3297new file mode 100644
3298index 0000000..f070000
3299--- /dev/null
3300+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86FeatureParse.patch
3301@@ -0,0 +1,112 @@
3302+From 3125688f78f6289e51bfdaa196addb230b0de4e1 Mon Sep 17 00:00:00 2001
3303+From: Jiri Denemark <jdenemar@redhat.com>
3304+Date: Wed, 25 Mar 2020 10:45:40 +0100
3305+Subject: [PATCH] cpu_x86: Use g_auto* in x86FeatureParse
3306+MIME-Version: 1.0
3307+Content-Type: text/plain; charset=UTF-8
3308+Content-Transfer-Encoding: 8bit
3309+
3310+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3311+Reviewed-by: Ján Tomko <jtomko@redhat.com>
3312+
3313+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=3125688f78
3314+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
3315+Last-Update: 2021-04-07
3316+
3317+---
3318+ src/cpu/cpu_x86.c | 31 ++++++++++++-------------------
3319+ 1 file changed, 12 insertions(+), 19 deletions(-)
3320+
3321+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
3322+index 94a5551000..248c774777 100644
3323+--- a/src/cpu/cpu_x86.c
3324++++ b/src/cpu/cpu_x86.c
3325+@@ -1023,13 +1023,12 @@ x86FeatureParse(xmlXPathContextPtr ctxt,
3326+ void *data)
3327+ {
3328+ virCPUx86MapPtr map = data;
3329+- xmlNodePtr *nodes = NULL;
3330+- virCPUx86FeaturePtr feature;
3331++ g_autofree xmlNodePtr *nodes = NULL;
3332++ g_autoptr(virCPUx86Feature) feature = NULL;
3333+ virCPUx86DataItem item;
3334+ size_t i;
3335+ int n;
3336+- char *str = NULL;
3337+- int ret = -1;
3338++ g_autofree char *str = NULL;
3339+
3340+ feature = g_new0(virCPUx86Feature, 1);
3341+ feature->migratable = true;
3342+@@ -1038,7 +1037,7 @@ x86FeatureParse(xmlXPathContextPtr ctxt,
3343+ if (x86FeatureFind(map, feature->name)) {
3344+ virReportError(VIR_ERR_INTERNAL_ERROR,
3345+ _("CPU feature %s already defined"), feature->name);
3346+- goto cleanup;
3347++ return -1;
3348+ }
3349+
3350+ str = virXPathString("string(@migratable)", ctxt);
3351+@@ -1047,13 +1046,13 @@ x86FeatureParse(xmlXPathContextPtr ctxt,
3352+
3353+ n = virXPathNodeSet("./cpuid|./msr", ctxt, &nodes);
3354+ if (n < 0)
3355+- goto cleanup;
3356++ return -1;
3357+
3358+ if (n == 0) {
3359+ virReportError(VIR_ERR_INTERNAL_ERROR,
3360+ _("Missing cpuid or msr element in feature %s"),
3361+ feature->name);
3362+- goto cleanup;
3363++ return -1;
3364+ }
3365+
3366+ for (i = 0; i < n; i++) {
3367+@@ -1063,37 +1062,31 @@ x86FeatureParse(xmlXPathContextPtr ctxt,
3368+ virReportError(VIR_ERR_INTERNAL_ERROR,
3369+ _("Invalid cpuid[%zu] in %s feature"),
3370+ i, feature->name);
3371+- goto cleanup;
3372++ return -1;
3373+ }
3374+ } else {
3375+ if (x86ParseMSR(ctxt, &item) < 0) {
3376+ virReportError(VIR_ERR_INTERNAL_ERROR,
3377+ _("Invalid msr[%zu] in %s feature"),
3378+ i, feature->name);
3379+- goto cleanup;
3380++ return -1;
3381+ }
3382+ }
3383+
3384+ if (virCPUx86DataAddItem(&feature->data, &item))
3385+- goto cleanup;
3386++ return -1;
3387+ }
3388+
3389+ if (!feature->migratable &&
3390+ VIR_APPEND_ELEMENT_COPY(map->migrate_blockers,
3391+ map->nblockers,
3392+ feature) < 0)
3393+- goto cleanup;
3394++ return -1;
3395+
3396+ if (VIR_APPEND_ELEMENT(map->features, map->nfeatures, feature) < 0)
3397+- goto cleanup;
3398+-
3399+- ret = 0;
3400++ return -1;
3401+
3402+- cleanup:
3403+- x86FeatureFree(feature);
3404+- VIR_FREE(nodes);
3405+- VIR_FREE(str);
3406+- return ret;
3407++ return 0;
3408+ }
3409+
3410+
3411+--
3412+2.31.1
3413+
3414diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86ModelFromCPU.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86ModelFromCPU.patch
3415new file mode 100644
3416index 0000000..5feab1f
3417--- /dev/null
3418+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86ModelFromCPU.patch
3419@@ -0,0 +1,71 @@
3420+From 93f173adbecee92f9973745a2aca65a27c4aa8a6 Mon Sep 17 00:00:00 2001
3421+From: Jiri Denemark <jdenemar@redhat.com>
3422+Date: Wed, 25 Mar 2020 11:29:14 +0100
3423+Subject: [PATCH] cpu_x86: Use g_auto* in x86ModelFromCPU
3424+MIME-Version: 1.0
3425+Content-Type: text/plain; charset=UTF-8
3426+Content-Transfer-Encoding: 8bit
3427+
3428+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3429+Reviewed-by: Ján Tomko <jtomko@redhat.com>
3430+
3431+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=93f173adbe
3432+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
3433+Last-Update: 2021-04-07
3434+
3435+---
3436+ src/cpu/cpu_x86.c | 14 +++++---------
3437+ 1 file changed, 5 insertions(+), 9 deletions(-)
3438+
3439+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
3440+index 248c774777..1f76fe1e5c 100644
3441+--- a/src/cpu/cpu_x86.c
3442++++ b/src/cpu/cpu_x86.c
3443+@@ -1173,7 +1173,7 @@ x86ModelFromCPU(const virCPUDef *cpu,
3444+ virCPUx86MapPtr map,
3445+ int policy)
3446+ {
3447+- virCPUx86ModelPtr model = NULL;
3448++ g_autoptr(virCPUx86Model) model = NULL;
3449+ size_t i;
3450+
3451+ /* host CPU only contains required features; requesting other features
3452+@@ -1216,7 +1216,7 @@ x86ModelFromCPU(const virCPUDef *cpu,
3453+ if (!(feature = x86FeatureFind(map, cpu->features[i].name))) {
3454+ virReportError(VIR_ERR_INTERNAL_ERROR,
3455+ _("Unknown CPU feature %s"), cpu->features[i].name);
3456+- goto error;
3457++ return NULL;
3458+ }
3459+
3460+ if (policy == -1) {
3461+@@ -1224,7 +1224,7 @@ x86ModelFromCPU(const virCPUDef *cpu,
3462+ case VIR_CPU_FEATURE_FORCE:
3463+ case VIR_CPU_FEATURE_REQUIRE:
3464+ if (x86DataAdd(&model->data, &feature->data) < 0)
3465+- goto error;
3466++ return NULL;
3467+ break;
3468+
3469+ case VIR_CPU_FEATURE_DISABLE:
3470+@@ -1238,15 +1238,11 @@ x86ModelFromCPU(const virCPUDef *cpu,
3471+ break;
3472+ }
3473+ } else if (x86DataAdd(&model->data, &feature->data) < 0) {
3474+- goto error;
3475++ return NULL;
3476+ }
3477+ }
3478+
3479+- return model;
3480+-
3481+- error:
3482+- x86ModelFree(model);
3483+- return NULL;
3484++ return g_steal_pointer(&model);
3485+ }
3486+
3487+
3488+--
3489+2.31.1
3490+
3491diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86ModelParse.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86ModelParse.patch
3492new file mode 100644
3493index 0000000..5af2631
3494--- /dev/null
3495+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86ModelParse.patch
3496@@ -0,0 +1,77 @@
3497+From b239a60967cc2979f01e4521d6582b7d6acedd72 Mon Sep 17 00:00:00 2001
3498+From: Jiri Denemark <jdenemar@redhat.com>
3499+Date: Wed, 25 Mar 2020 11:29:36 +0100
3500+Subject: [PATCH] cpu_x86: Use g_auto* in x86ModelParse
3501+MIME-Version: 1.0
3502+Content-Type: text/plain; charset=UTF-8
3503+Content-Transfer-Encoding: 8bit
3504+
3505+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3506+Reviewed-by: Ján Tomko <jtomko@redhat.com>
3507+
3508+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=b239a60967
3509+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
3510+Last-Update: 2021-04-07
3511+
3512+---
3513+ src/cpu/cpu_x86.c | 23 +++++++++--------------
3514+ 1 file changed, 9 insertions(+), 14 deletions(-)
3515+
3516+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
3517+index 1f76fe1e5c..983730f0c2 100644
3518+--- a/src/cpu/cpu_x86.c
3519++++ b/src/cpu/cpu_x86.c
3520+@@ -1493,41 +1493,36 @@ x86ModelParse(xmlXPathContextPtr ctxt,
3521+ void *data)
3522+ {
3523+ virCPUx86MapPtr map = data;
3524+- virCPUx86ModelPtr model = NULL;
3525+- int ret = -1;
3526++ g_autoptr(virCPUx86Model) model = NULL;
3527+
3528+ if (x86ModelFind(map, name)) {
3529+ virReportError(VIR_ERR_INTERNAL_ERROR,
3530+ _("Multiple definitions of CPU model '%s'"), name);
3531+- goto cleanup;
3532++ return -1;
3533+ }
3534+
3535+ model = g_new0(virCPUx86Model, 1);
3536+ model->name = g_strdup(name);
3537+
3538+ if (x86ModelParseDecode(model, ctxt) < 0)
3539+- goto cleanup;
3540++ return -1;
3541+
3542+ if (x86ModelParseAncestor(model, ctxt, map) < 0)
3543+- goto cleanup;
3544++ return -1;
3545+
3546+ if (x86ModelParseSignatures(model, ctxt) < 0)
3547+- goto cleanup;
3548++ return -1;
3549+
3550+ if (x86ModelParseVendor(model, ctxt, map) < 0)
3551+- goto cleanup;
3552++ return -1;
3553+
3554+ if (x86ModelParseFeatures(model, ctxt, map) < 0)
3555+- goto cleanup;
3556++ return -1;
3557+
3558+ if (VIR_APPEND_ELEMENT(map->models, map->nmodels, model) < 0)
3559+- goto cleanup;
3560+-
3561+- ret = 0;
3562++ return -1;
3563+
3564+- cleanup:
3565+- x86ModelFree(model);
3566+- return ret;
3567++ return 0;
3568+ }
3569+
3570+
3571+--
3572+2.31.1
3573+
3574diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86UpdateHostModel.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86UpdateHostModel.patch
3575new file mode 100644
3576index 0000000..7e070b6
3577--- /dev/null
3578+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86UpdateHostModel.patch
3579@@ -0,0 +1,68 @@
3580+From 2f9d15b495efdd9e63c07cd6fda611701e71ee46 Mon Sep 17 00:00:00 2001
3581+From: Jiri Denemark <jdenemar@redhat.com>
3582+Date: Wed, 25 Mar 2020 16:06:18 +0100
3583+Subject: [PATCH] cpu_x86: Use g_auto* in x86UpdateHostModel
3584+MIME-Version: 1.0
3585+Content-Type: text/plain; charset=UTF-8
3586+Content-Transfer-Encoding: 8bit
3587+
3588+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3589+Reviewed-by: Ján Tomko <jtomko@redhat.com>
3590+
3591+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=2f9d15b495
3592+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
3593+Last-Update: 2021-04-07
3594+
3595+---
3596+ src/cpu/cpu_x86.c | 14 +++++---------
3597+ 1 file changed, 5 insertions(+), 9 deletions(-)
3598+
3599+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
3600+index 3ab70e7c20..0300bd08da 100644
3601+--- a/src/cpu/cpu_x86.c
3602++++ b/src/cpu/cpu_x86.c
3603+@@ -2817,17 +2817,16 @@ static int
3604+ x86UpdateHostModel(virCPUDefPtr guest,
3605+ const virCPUDef *host)
3606+ {
3607+- virCPUDefPtr updated = NULL;
3608++ g_autoptr(virCPUDef) updated = NULL;
3609+ size_t i;
3610+- int ret = -1;
3611+
3612+ if (!(updated = virCPUDefCopyWithoutModel(host)))
3613+- goto cleanup;
3614++ return -1;
3615+
3616+ updated->type = VIR_CPU_TYPE_GUEST;
3617+ updated->mode = VIR_CPU_MODE_CUSTOM;
3618+ if (virCPUDefCopyModel(updated, host, true) < 0)
3619+- goto cleanup;
3620++ return -1;
3621+
3622+ if (guest->vendor_id) {
3623+ VIR_FREE(updated->vendor_id);
3624+@@ -2838,18 +2837,15 @@ x86UpdateHostModel(virCPUDefPtr guest,
3625+ if (virCPUDefUpdateFeature(updated,
3626+ guest->features[i].name,
3627+ guest->features[i].policy) < 0)
3628+- goto cleanup;
3629++ return -1;
3630+ }
3631+
3632+ virCPUDefStealModel(guest, updated,
3633+ guest->mode == VIR_CPU_MODE_CUSTOM);
3634+ guest->mode = VIR_CPU_MODE_CUSTOM;
3635+ guest->match = VIR_CPU_MATCH_EXACT;
3636+- ret = 0;
3637+
3638+- cleanup:
3639+- virCPUDefFree(updated);
3640+- return ret;
3641++ return 0;
3642+ }
3643+
3644+
3645+--
3646+2.31.1
3647+
3648diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86VendorParse.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86VendorParse.patch
3649new file mode 100644
3650index 0000000..8be2394
3651--- /dev/null
3652+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-g_auto-in-x86VendorParse.patch
3653@@ -0,0 +1,73 @@
3654+From 6a0a7db9041cb1d8d92919bb4adf0d19bdd5dd68 Mon Sep 17 00:00:00 2001
3655+From: Jiri Denemark <jdenemar@redhat.com>
3656+Date: Wed, 25 Mar 2020 10:38:04 +0100
3657+Subject: [PATCH] cpu_x86: Use g_auto* in x86VendorParse
3658+MIME-Version: 1.0
3659+Content-Type: text/plain; charset=UTF-8
3660+Content-Transfer-Encoding: 8bit
3661+
3662+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3663+Reviewed-by: Ján Tomko <jtomko@redhat.com>
3664+
3665+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=6a0a7db904
3666+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
3667+Last-Update: 2021-04-07
3668+
3669+---
3670+ src/cpu/cpu_x86.c | 20 +++++++-------------
3671+ 1 file changed, 7 insertions(+), 13 deletions(-)
3672+
3673+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
3674+index be4f40f470..94a5551000 100644
3675+--- a/src/cpu/cpu_x86.c
3676++++ b/src/cpu/cpu_x86.c
3677+@@ -849,9 +849,8 @@ x86VendorParse(xmlXPathContextPtr ctxt,
3678+ void *data)
3679+ {
3680+ virCPUx86MapPtr map = data;
3681+- virCPUx86VendorPtr vendor = NULL;
3682+- char *string = NULL;
3683+- int ret = -1;
3684++ g_autoptr(virCPUx86Vendor) vendor = NULL;
3685++ g_autofree char *string = NULL;
3686+
3687+ vendor = g_new0(virCPUx86Vendor, 1);
3688+ vendor->name = g_strdup(name);
3689+@@ -859,7 +858,7 @@ x86VendorParse(xmlXPathContextPtr ctxt,
3690+ if (x86VendorFind(map, vendor->name)) {
3691+ virReportError(VIR_ERR_INTERNAL_ERROR,
3692+ _("CPU vendor %s already defined"), vendor->name);
3693+- goto cleanup;
3694++ return -1;
3695+ }
3696+
3697+ string = virXPathString("string(@string)", ctxt);
3698+@@ -867,21 +866,16 @@ x86VendorParse(xmlXPathContextPtr ctxt,
3699+ virReportError(VIR_ERR_INTERNAL_ERROR,
3700+ _("Missing vendor string for CPU vendor %s"),
3701+ vendor->name);
3702+- goto cleanup;
3703++ return -1;
3704+ }
3705+
3706+ if (virCPUx86VendorToData(string, &vendor->data) < 0)
3707+- goto cleanup;
3708++ return -1;
3709+
3710+ if (VIR_APPEND_ELEMENT(map->vendors, map->nvendors, vendor) < 0)
3711+- goto cleanup;
3712+-
3713+- ret = 0;
3714++ return -1;
3715+
3716+- cleanup:
3717+- x86VendorFree(vendor);
3718+- VIR_FREE(string);
3719+- return ret;
3720++ return 0;
3721+ }
3722+
3723+
3724+--
3725+2.31.1
3726+
3727diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPU-x86-Data.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPU-x86-Data.patch
3728new file mode 100644
3729index 0000000..b64b182
3730--- /dev/null
3731+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPU-x86-Data.patch
3732@@ -0,0 +1,142 @@
3733+From 800868583012e20fb60eb4be9fb1ccc018677006 Mon Sep 17 00:00:00 2001
3734+From: Jiri Denemark <jdenemar@redhat.com>
3735+Date: Wed, 25 Mar 2020 10:28:26 +0100
3736+Subject: [PATCH] cpu_x86: Use glib allocation for virCPU{,x86}Data
3737+MIME-Version: 1.0
3738+Content-Type: text/plain; charset=UTF-8
3739+Content-Transfer-Encoding: 8bit
3740+
3741+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3742+Reviewed-by: Ján Tomko <jtomko@redhat.com>
3743+
3744+Backport-Note: some noise missing ac36a8246
3745+Origin: backport, https://libvirt.org/git/?p=libvirt.git;a=commit;h=8008685830
3746+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
3747+Last-Update: 2021-04-07
3748+
3749+---
3750+ src/cpu/cpu_x86.c | 45 ++++++++++++++++++++++-----------------------
3751+ 1 file changed, 22 insertions(+), 23 deletions(-)
3752+
3753+--- a/src/cpu/cpu_x86.c
3754++++ b/src/cpu/cpu_x86.c
3755+@@ -468,8 +468,9 @@ virCPUx86DataClear(virCPUx86Data *data)
3756+ if (!data)
3757+ return;
3758+
3759+- VIR_FREE(data->items);
3760++ g_free(data->items);
3761+ }
3762++G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virCPUx86Data, virCPUx86DataClear);
3763+
3764+
3765+ static void
3766+@@ -481,21 +482,19 @@ virCPUx86DataFree(virCPUDataPtr data)
3767+ virCPUx86DataClear(&data->data.x86);
3768+ VIR_FREE(data);
3769+ }
3770++G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUData, virCPUx86DataFree);
3771+
3772+
3773+-static int
3774++static void
3775+ x86DataCopy(virCPUx86Data *dst, const virCPUx86Data *src)
3776+ {
3777+ size_t i;
3778+
3779+- if (VIR_ALLOC_N(dst->items, src->len) < 0)
3780+- return -1;
3781+-
3782++ dst->items = g_new0(virCPUx86DataItem, src->len);
3783+ dst->len = src->len;
3784++
3785+ for (i = 0; i < src->len; i++)
3786+ dst->items[i] = src->items[i];
3787+-
3788+- return 0;
3789+ }
3790+
3791+
3792+@@ -781,9 +780,8 @@ x86DataToCPU(const virCPUx86Data *data,
3793+
3794+ cpu->model = g_strdup(model->name);
3795+
3796+- if (x86DataCopy(&copy, data) < 0 ||
3797+- x86DataCopy(&modelData, &model->data) < 0)
3798+- goto error;
3799++ x86DataCopy(&copy, data);
3800++ x86DataCopy(&modelData, &model->data);
3801+
3802+ if ((vendor = x86DataToVendor(&copy, map)))
3803+ cpu->vendor = g_strdup(vendor->name);
3804+@@ -1183,11 +1181,11 @@ x86ModelCopy(virCPUx86ModelPtr model)
3805+
3806+ copy->name = g_strdup(model->name);
3807+
3808+- if (x86ModelCopySignatures(copy, model) < 0 ||
3809+- x86DataCopy(&copy->data, &model->data) < 0) {
3810++ if (x86ModelCopySignatures(copy, model) < 0) {
3811+ x86ModelFree(copy);
3812+ return NULL;
3813+ }
3814++ x86DataCopy(&copy->data, &model->data);
3815+
3816+ copy->vendor = model->vendor;
3817+
3818+@@ -1415,10 +1413,11 @@ x86ModelParseAncestor(virCPUx86ModelPtr
3819+ }
3820+
3821+ model->vendor = ancestor->vendor;
3822+- if (x86ModelCopySignatures(model, ancestor) < 0 ||
3823+- x86DataCopy(&model->data, &ancestor->data) < 0)
3824++ if (x86ModelCopySignatures(model, ancestor) < 0)
3825+ return -1;
3826+
3827++ x86DataCopy(&model->data, &ancestor->data);
3828++
3829+ return 0;
3830+ }
3831+
3832+@@ -1904,9 +1903,9 @@ x86Compute(virCPUDefPtr host,
3833+
3834+ x86DataSubtract(&guest_model->data, &cpu_disable->data);
3835+
3836+- if (!(guestData = virCPUDataNew(arch)) ||
3837+- x86DataCopy(&guestData->data.x86, &guest_model->data) < 0)
3838++ if (!(guestData = virCPUDataNew(arch)))
3839+ goto error;
3840++ x86DataCopy(&guestData->data.x86, &guest_model->data);
3841+
3842+ *guest = guestData;
3843+ }
3844+@@ -2139,9 +2138,11 @@ x86Decode(virCPUDefPtr cpu,
3845+ ssize_t i;
3846+ int rc;
3847+
3848+- if (!cpuData || x86DataCopy(&data, cpuData) < 0)
3849++ if (!cpuData)
3850+ return -1;
3851+
3852++ x86DataCopy(&data, cpuData);
3853++
3854+ if (!(map = virCPUx86GetMap()))
3855+ goto cleanup;
3856+
3857+@@ -3049,13 +3050,11 @@ virCPUx86UpdateLive(virCPUDefPtr cpu,
3858+ if (!(model = x86ModelFromCPU(cpu, map, -1)))
3859+ goto cleanup;
3860+
3861+- if (dataEnabled &&
3862+- x86DataCopy(&enabled, &dataEnabled->data.x86) < 0)
3863+- goto cleanup;
3864++ if (dataEnabled)
3865++ x86DataCopy(&enabled, &dataEnabled->data.x86);
3866+
3867+- if (dataDisabled &&
3868+- x86DataCopy(&disabled, &dataDisabled->data.x86) < 0)
3869+- goto cleanup;
3870++ if (dataDisabled)
3871++ x86DataCopy(&disabled, &dataDisabled->data.x86);
3872+
3873+ for (i = 0; i < map->nfeatures; i++) {
3874+ virCPUx86FeaturePtr feature = map->features[i];
3875diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Feature.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Feature.patch
3876new file mode 100644
3877index 0000000..80e04fc
3878--- /dev/null
3879+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Feature.patch
3880@@ -0,0 +1,71 @@
3881+From 51b6e9c1000151cc515804134a00ccb0d7b3e44a Mon Sep 17 00:00:00 2001
3882+From: Jiri Denemark <jdenemar@redhat.com>
3883+Date: Wed, 25 Mar 2020 10:40:29 +0100
3884+Subject: [PATCH] cpu_x86: Use glib allocation for virCPUx86Feature
3885+MIME-Version: 1.0
3886+Content-Type: text/plain; charset=UTF-8
3887+Content-Transfer-Encoding: 8bit
3888+
3889+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3890+Reviewed-by: Ján Tomko <jtomko@redhat.com>
3891+
3892+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=51b6e9c100
3893+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
3894+Last-Update: 2021-04-07
3895+
3896+---
3897+ src/cpu/cpu_x86.c | 22 ++++------------------
3898+ 1 file changed, 4 insertions(+), 18 deletions(-)
3899+
3900+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
3901+index 5ffae3cebe..cf0f8a7120 100644
3902+--- a/src/cpu/cpu_x86.c
3903++++ b/src/cpu/cpu_x86.c
3904+@@ -893,28 +893,17 @@ x86VendorParse(xmlXPathContextPtr ctxt,
3905+ }
3906+
3907+
3908+-static virCPUx86FeaturePtr
3909+-x86FeatureNew(void)
3910+-{
3911+- virCPUx86FeaturePtr feature;
3912+-
3913+- if (VIR_ALLOC(feature) < 0)
3914+- return NULL;
3915+-
3916+- return feature;
3917+-}
3918+-
3919+-
3920+ static void
3921+ x86FeatureFree(virCPUx86FeaturePtr feature)
3922+ {
3923+ if (!feature)
3924+ return;
3925+
3926+- VIR_FREE(feature->name);
3927++ g_free(feature->name);
3928+ virCPUx86DataClear(&feature->data);
3929+- VIR_FREE(feature);
3930++ g_free(feature);
3931+ }
3932++G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Feature, x86FeatureFree);
3933+
3934+
3935+ static int
3936+@@ -1056,11 +1045,8 @@ x86FeatureParse(xmlXPathContextPtr ctxt,
3937+ char *str = NULL;
3938+ int ret = -1;
3939+
3940+- if (!(feature = x86FeatureNew()))
3941+- goto cleanup;
3942+-
3943++ feature = g_new0(virCPUx86Feature, 1);
3944+ feature->migratable = true;
3945+-
3946+ feature->name = g_strdup(name);
3947+
3948+ if (x86FeatureFind(map, feature->name)) {
3949+--
3950+2.31.1
3951+
3952diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Map.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Map.patch
3953new file mode 100644
3954index 0000000..4ed89af
3955--- /dev/null
3956+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Map.patch
3957@@ -0,0 +1,66 @@
3958+From 247e115e2753bde7957cc07a20d5a48a8a6632b0 Mon Sep 17 00:00:00 2001
3959+From: Jiri Denemark <jdenemar@redhat.com>
3960+Date: Wed, 25 Mar 2020 14:49:57 +0100
3961+Subject: [PATCH] cpu_x86: Use glib allocation for virCPUx86Map
3962+MIME-Version: 1.0
3963+Content-Type: text/plain; charset=UTF-8
3964+Content-Transfer-Encoding: 8bit
3965+
3966+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3967+Reviewed-by: Ján Tomko <jtomko@redhat.com>
3968+
3969+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=247e115e27
3970+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
3971+Last-Update: 2021-04-07
3972+
3973+---
3974+ src/cpu/cpu_x86.c | 14 +++++++-------
3975+ 1 file changed, 7 insertions(+), 7 deletions(-)
3976+
3977+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
3978+index 7bad9dbb76..51c2a0ea36 100644
3979+--- a/src/cpu/cpu_x86.c
3980++++ b/src/cpu/cpu_x86.c
3981+@@ -1566,23 +1566,24 @@ x86MapFree(virCPUx86MapPtr map)
3982+
3983+ for (i = 0; i < map->nfeatures; i++)
3984+ x86FeatureFree(map->features[i]);
3985+- VIR_FREE(map->features);
3986++ g_free(map->features);
3987+
3988+ for (i = 0; i < map->nmodels; i++)
3989+ x86ModelFree(map->models[i]);
3990+- VIR_FREE(map->models);
3991++ g_free(map->models);
3992+
3993+ for (i = 0; i < map->nvendors; i++)
3994+ x86VendorFree(map->vendors[i]);
3995+- VIR_FREE(map->vendors);
3996++ g_free(map->vendors);
3997+
3998+ /* migrate_blockers only points to the features from map->features list,
3999+ * which were already freed above
4000+ */
4001+- VIR_FREE(map->migrate_blockers);
4002++ g_free(map->migrate_blockers);
4003+
4004+- VIR_FREE(map);
4005++ g_free(map);
4006+ }
4007++G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Map, x86MapFree);
4008+
4009+
4010+ static virCPUx86MapPtr
4011+@@ -1590,8 +1591,7 @@ virCPUx86LoadMap(void)
4012+ {
4013+ virCPUx86MapPtr map;
4014+
4015+- if (VIR_ALLOC(map) < 0)
4016+- return NULL;
4017++ map = g_new0(virCPUx86Map, 1);
4018+
4019+ if (cpuMapLoad("x86", x86VendorParse, x86FeatureParse, x86ModelParse, map) < 0)
4020+ goto error;
4021+--
4022+2.31.1
4023+
4024diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Model.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Model.patch
4025new file mode 100644
4026index 0000000..e2430aa
4027--- /dev/null
4028+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Model.patch
4029@@ -0,0 +1,100 @@
4030+From ccc0c2e4de58d62308e224076a7aa979ae97b520 Mon Sep 17 00:00:00 2001
4031+From: Jiri Denemark <jdenemar@redhat.com>
4032+Date: Wed, 25 Mar 2020 11:28:13 +0100
4033+Subject: [PATCH] cpu_x86: Use glib allocation for virCPUx86Model
4034+MIME-Version: 1.0
4035+Content-Type: text/plain; charset=UTF-8
4036+Content-Transfer-Encoding: 8bit
4037+
4038+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4039+Reviewed-by: Ján Tomko <jtomko@redhat.com>
4040+
4041+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=ccc0c2e4de
4042+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
4043+Last-Update: 2021-04-07
4044+
4045+---
4046+ src/cpu/cpu_x86.c | 31 ++++++++-----------------------
4047+ 1 file changed, 8 insertions(+), 23 deletions(-)
4048+
4049+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
4050+index cf0f8a7120..7bad9dbb76 100644
4051+--- a/src/cpu/cpu_x86.c
4052++++ b/src/cpu/cpu_x86.c
4053+@@ -1111,29 +1111,18 @@ x86FeatureParse(xmlXPathContextPtr ctxt,
4054+ }
4055+
4056+
4057+-static virCPUx86ModelPtr
4058+-x86ModelNew(void)
4059+-{
4060+- virCPUx86ModelPtr model;
4061+-
4062+- if (VIR_ALLOC(model) < 0)
4063+- return NULL;
4064+-
4065+- return model;
4066+-}
4067+-
4068+-
4069+ static void
4070+ x86ModelFree(virCPUx86ModelPtr model)
4071+ {
4072+ if (!model)
4073+ return;
4074+
4075+- VIR_FREE(model->name);
4076+- VIR_FREE(model->signatures);
4077++ g_free(model->name);
4078++ g_free(model->signatures);
4079+ virCPUx86DataClear(&model->data);
4080+- VIR_FREE(model);
4081++ g_free(model);
4082+ }
4083++G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Model, x86ModelFree);
4084+
4085+
4086+ static int
4087+@@ -1161,9 +1150,7 @@ x86ModelCopy(virCPUx86ModelPtr model)
4088+ {
4089+ virCPUx86ModelPtr copy;
4090+
4091+- if (VIR_ALLOC(copy) < 0)
4092+- return NULL;
4093+-
4094++ copy = g_new0(virCPUx86Model, 1);
4095+ copy->name = g_strdup(model->name);
4096+
4097+ if (x86ModelCopySignatures(copy, model) < 0) {
4098+@@ -1216,7 +1203,7 @@ x86ModelFromCPU(const virCPUDef *cpu,
4099+ if (cpu->type == VIR_CPU_TYPE_HOST &&
4100+ policy != VIR_CPU_FEATURE_REQUIRE &&
4101+ policy != -1)
4102+- return x86ModelNew();
4103++ return g_new0(virCPUx86Model, 1);
4104+
4105+ if (cpu->model &&
4106+ (policy == VIR_CPU_FEATURE_REQUIRE || policy == -1)) {
4107+@@ -1228,7 +1215,7 @@ x86ModelFromCPU(const virCPUDef *cpu,
4108+
4109+ model = x86ModelCopy(model);
4110+ } else {
4111+- model = x86ModelNew();
4112++ model = g_new0(virCPUx86Model, 1);
4113+ }
4114+
4115+ if (!model)
4116+@@ -1540,9 +1527,7 @@ x86ModelParse(xmlXPathContextPtr ctxt,
4117+ goto cleanup;
4118+ }
4119+
4120+- if (!(model = x86ModelNew()))
4121+- goto cleanup;
4122+-
4123++ model = g_new0(virCPUx86Model, 1);
4124+ model->name = g_strdup(name);
4125+
4126+ if (x86ModelParseDecode(model, ctxt) < 0)
4127+--
4128+2.31.1
4129+
4130diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Vendor.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Vendor.patch
4131new file mode 100644
4132index 0000000..41f1dfb
4133--- /dev/null
4134+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-for-virCPUx86Vendor.patch
4135@@ -0,0 +1,50 @@
4136+From 8a41417b23dda97eb09bcd2921c1ab0d5fbce1b6 Mon Sep 17 00:00:00 2001
4137+From: Jiri Denemark <jdenemar@redhat.com>
4138+Date: Wed, 25 Mar 2020 10:37:29 +0100
4139+Subject: [PATCH] cpu_x86: Use glib allocation for virCPUx86Vendor
4140+MIME-Version: 1.0
4141+Content-Type: text/plain; charset=UTF-8
4142+Content-Transfer-Encoding: 8bit
4143+
4144+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4145+Reviewed-by: Ján Tomko <jtomko@redhat.com>
4146+
4147+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=8a41417b23
4148+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
4149+Last-Update: 2021-04-07
4150+
4151+---
4152+ src/cpu/cpu_x86.c | 9 ++++-----
4153+ 1 file changed, 4 insertions(+), 5 deletions(-)
4154+
4155+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
4156+index 9e22c83c4d..5ffae3cebe 100644
4157+--- a/src/cpu/cpu_x86.c
4158++++ b/src/cpu/cpu_x86.c
4159+@@ -830,9 +830,10 @@ x86VendorFree(virCPUx86VendorPtr vendor)
4160+ if (!vendor)
4161+ return;
4162+
4163+- VIR_FREE(vendor->name);
4164+- VIR_FREE(vendor);
4165++ g_free(vendor->name);
4166++ g_free(vendor);
4167+ }
4168++G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Vendor, x86VendorFree);
4169+
4170+
4171+ static virCPUx86VendorPtr
4172+@@ -860,9 +861,7 @@ x86VendorParse(xmlXPathContextPtr ctxt,
4173+ char *string = NULL;
4174+ int ret = -1;
4175+
4176+- if (VIR_ALLOC(vendor) < 0)
4177+- goto cleanup;
4178+-
4179++ vendor = g_new0(virCPUx86Vendor, 1);
4180+ vendor->name = g_strdup(name);
4181+
4182+ if (x86VendorFind(map, vendor->name)) {
4183+--
4184+2.31.1
4185+
4186diff --git a/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-in-virCPUx86GetModels.patch b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-in-virCPUx86GetModels.patch
4187new file mode 100644
4188index 0000000..77c2fee
4189--- /dev/null
4190+++ b/debian/patches/ubuntu/lp-1922907-cpu_x86-Use-glib-allocation-in-virCPUx86GetModels.patch
4191@@ -0,0 +1,49 @@
4192+From e43e2ff7f5b629f979e56387c4be46f2be251b75 Mon Sep 17 00:00:00 2001
4193+From: Jiri Denemark <jdenemar@redhat.com>
4194+Date: Wed, 25 Mar 2020 18:41:48 +0100
4195+Subject: [PATCH] cpu_x86: Use glib allocation in virCPUx86GetModels
4196+MIME-Version: 1.0
4197+Content-Type: text/plain; charset=UTF-8
4198+Content-Transfer-Encoding: 8bit
4199+
4200+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4201+Reviewed-by: Ján Tomko <jtomko@redhat.com>
4202+
4203+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=e43e2ff7f5
4204+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
4205+Last-Update: 2021-04-07
4206+
4207+---
4208+ src/cpu/cpu_x86.c | 10 +---------
4209+ 1 file changed, 1 insertion(+), 9 deletions(-)
4210+
4211+diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
4212+index 51c2a0ea36..3c08edcd73 100644
4213+--- a/src/cpu/cpu_x86.c
4214++++ b/src/cpu/cpu_x86.c
4215+@@ -3121,21 +3121,13 @@ virCPUx86GetModels(char ***models)
4216+ return -1;
4217+
4218+ if (models) {
4219+- if (VIR_ALLOC_N(*models, map->nmodels + 1) < 0)
4220+- goto error;
4221++ *models = g_new0(char *, map->nmodels + 1);
4222+
4223+ for (i = 0; i < map->nmodels; i++)
4224+ (*models)[i] = g_strdup(map->models[i]->name);
4225+ }
4226+
4227+ return map->nmodels;
4228+-
4229+- error:
4230+- if (models) {
4231+- virStringListFree(*models);
4232+- *models = NULL;
4233+- }
4234+- return -1;
4235+ }
4236+
4237+
4238+--
4239+2.31.1
4240+
4241diff --git a/debian/patches/ubuntu/lp-1922907-cputest-Add-data-for-Intel-R-Xeon-R-Gold-6130-CPU.patch b/debian/patches/ubuntu/lp-1922907-cputest-Add-data-for-Intel-R-Xeon-R-Gold-6130-CPU.patch
4242new file mode 100644
4243index 0000000..ad911af
4244--- /dev/null
4245+++ b/debian/patches/ubuntu/lp-1922907-cputest-Add-data-for-Intel-R-Xeon-R-Gold-6130-CPU.patch
4246@@ -0,0 +1,1460 @@
4247+From 3714779b15e594a14de4e6fe49c2e3eafe39b161 Mon Sep 17 00:00:00 2001
4248+From: Jiri Denemark <jdenemar@redhat.com>
4249+Date: Thu, 17 Oct 2019 10:01:29 +0200
4250+Subject: [PATCH] cputest: Add data for Intel(R) Xeon(R) Gold 6130 CPU
4251+MIME-Version: 1.0
4252+Content-Type: text/plain; charset=UTF-8
4253+Content-Transfer-Encoding: 8bit
4254+
4255+Skylake-Server with family 6, model 85, stepping 4, which is currently
4256+mis-detected as Cascadelake-Server CPU model.
4257+
4258+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4259+Reviewed-by: Ján Tomko <jtomko@redhat.com>
4260+
4261+Origin: upstream, https://libvirt.org/git/?p=libvirt.git;a=commit;h=3714779b15
4262+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1922907
4263+Last-Update: 2021-04-07
4264+
4265+---
4266+ tests/cputest.c | 1 +
4267+ .../x86_64-cpuid-Xeon-Gold-6130-disabled.xml | 7 +
4268+ .../x86_64-cpuid-Xeon-Gold-6130-enabled.xml | 9 +
4269+ .../x86_64-cpuid-Xeon-Gold-6130-guest.xml | 33 +
4270+ .../x86_64-cpuid-Xeon-Gold-6130-host.xml | 35 +
4271+ .../x86_64-cpuid-Xeon-Gold-6130-json.xml | 16 +
4272+ .../x86_64-cpuid-Xeon-Gold-6130.json | 1201 +++++++++++++++++
4273+ .../x86_64-cpuid-Xeon-Gold-6130.sig | 4 +
4274+ .../x86_64-cpuid-Xeon-Gold-6130.xml | 54 +
4275+ 9 files changed, 1360 insertions(+)
4276+ create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-disabled.xml
4277+ create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-enabled.xml
4278+ create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-guest.xml
4279+ create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-host.xml
4280+ create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-json.xml
4281+ create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130.json
4282+ create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130.sig
4283+ create mode 100644 tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130.xml
4284+
4285+diff --git a/tests/cputest.c b/tests/cputest.c
4286+index f9f1ca74ff..869d016ffc 100644
4287+--- a/tests/cputest.c
4288++++ b/tests/cputest.c
4289+@@ -1265,6 +1265,7 @@ mymain(void)
4290+ DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7-8890-v3", JSON_MODELS);
4291+ DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-E7540", JSON_MODELS);
4292+ DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-Gold-5115", JSON_MODELS);
4293++ DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-Gold-6130", JSON_MODELS);
4294+ DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-Gold-6148", JSON_HOST);
4295+ DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-Platinum-8268", JSON_HOST);
4296+ DO_TEST_CPUID(VIR_ARCH_X86_64, "Xeon-Platinum-9242", JSON_MODELS);
4297+diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-disabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-disabled.xml
4298+new file mode 100644
4299+index 0000000000..e7c59cef1e
4300+--- /dev/null
4301++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-disabled.xml
4302+@@ -0,0 +1,7 @@
4303++<!-- Features disabled by QEMU -->
4304++<cpudata arch='x86'>
4305++ <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0804c1dc' edx='0xb0600000'/>
4306++ <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x02001000' ecx='0x00000010' edx='0x00000000'/>
4307++ <cpuid eax_in='0x0000000f' ecx_in='0x01' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000006'/>
4308++ <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/>
4309++</cpudata>
4310+diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-enabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-enabled.xml
4311+new file mode 100644
4312+index 0000000000..8610577479
4313+--- /dev/null
4314++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-enabled.xml
4315+@@ -0,0 +1,9 @@
4316++<!-- Features enabled by QEMU -->
4317++<cpudata arch='x86'>
4318++ <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0xf7fa3223' edx='0x0f8bfbff'/>
4319++ <cpuid eax_in='0x00000006' ecx_in='0x00' eax='0x00000004' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/>
4320++ <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0xd19f4fbb' ecx='0x0000000c' edx='0xac000400'/>
4321++ <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x0000000f' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/>
4322++ <cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000121' edx='0x2c100800'/>
4323++ <msr index='0x10a' edx='0x00000000' eax='0x00000008'/>
4324++</cpudata>
4325+diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-guest.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-guest.xml
4326+new file mode 100644
4327+index 0000000000..cfb0eb982d
4328+--- /dev/null
4329++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-guest.xml
4330+@@ -0,0 +1,33 @@
4331++<cpu mode='custom' match='exact'>
4332++ <model fallback='forbid'>Cascadelake-Server</model>
4333++ <vendor>Intel</vendor>
4334++ <feature policy='require' name='ds'/>
4335++ <feature policy='require' name='acpi'/>
4336++ <feature policy='require' name='ss'/>
4337++ <feature policy='require' name='ht'/>
4338++ <feature policy='require' name='tm'/>
4339++ <feature policy='require' name='pbe'/>
4340++ <feature policy='require' name='dtes64'/>
4341++ <feature policy='require' name='monitor'/>
4342++ <feature policy='require' name='ds_cpl'/>
4343++ <feature policy='require' name='vmx'/>
4344++ <feature policy='require' name='smx'/>
4345++ <feature policy='require' name='est'/>
4346++ <feature policy='require' name='tm2'/>
4347++ <feature policy='require' name='xtpr'/>
4348++ <feature policy='require' name='pdcm'/>
4349++ <feature policy='require' name='dca'/>
4350++ <feature policy='require' name='osxsave'/>
4351++ <feature policy='require' name='tsc_adjust'/>
4352++ <feature policy='require' name='cmt'/>
4353++ <feature policy='require' name='intel-pt'/>
4354++ <feature policy='require' name='pku'/>
4355++ <feature policy='require' name='ospke'/>
4356++ <feature policy='require' name='md-clear'/>
4357++ <feature policy='require' name='stibp'/>
4358++ <feature policy='require' name='xsaves'/>
4359++ <feature policy='require' name='mbm_total'/>
4360++ <feature policy='require' name='mbm_local'/>
4361++ <feature policy='require' name='invtsc'/>
4362++ <feature policy='disable' name='avx512vnni'/>
4363++</cpu>
4364+diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-host.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-host.xml
4365+new file mode 100644
4366+index 0000000000..207e9e0ee4
4367+--- /dev/null
4368++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-host.xml
4369+@@ -0,0 +1,35 @@
4370++<cpu>
4371++ <arch>x86_64</arch>
4372++ <model>Skylake-Server-IBRS</model>
4373++ <vendor>Intel</vendor>
4374++ <feature name='ds'/>
4375++ <feature name='acpi'/>
4376++ <feature name='ss'/>
4377++ <feature name='ht'/>
4378++ <feature name='tm'/>
4379++ <feature name='pbe'/>
4380++ <feature name='dtes64'/>
4381++ <feature name='monitor'/>
4382++ <feature name='ds_cpl'/>
4383++ <feature name='vmx'/>
4384++ <feature name='smx'/>
4385++ <feature name='est'/>
4386++ <feature name='tm2'/>
4387++ <feature name='xtpr'/>
4388++ <feature name='pdcm'/>
4389++ <feature name='dca'/>
4390++ <feature name='osxsave'/>
4391++ <feature name='tsc_adjust'/>
4392++ <feature name='cmt'/>
4393++ <feature name='clflushopt'/>
4394++ <feature name='intel-pt'/>
4395++ <feature name='pku'/>
4396++ <feature name='ospke'/>
4397++ <feature name='md-clear'/>
4398++ <feature name='stibp'/>
4399++ <feature name='ssbd'/>
4400++ <feature name='xsaves'/>
4401++ <feature name='mbm_total'/>
4402++ <feature name='mbm_local'/>
4403++ <feature name='invtsc'/>
4404++</cpu>
4405+diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-json.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-json.xml
4406+new file mode 100644
4407+index 0000000000..968d904557
4408+--- /dev/null
4409++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130-json.xml
4410+@@ -0,0 +1,16 @@
4411++<cpu mode='custom' match='exact'>
4412++ <model fallback='forbid'>Cascadelake-Server</model>
4413++ <vendor>Intel</vendor>
4414++ <feature policy='require' name='ss'/>
4415++ <feature policy='require' name='vmx'/>
4416++ <feature policy='require' name='hypervisor'/>
4417++ <feature policy='require' name='tsc_adjust'/>
4418++ <feature policy='require' name='umip'/>
4419++ <feature policy='require' name='pku'/>
4420++ <feature policy='require' name='md-clear'/>
4421++ <feature policy='require' name='stibp'/>
4422++ <feature policy='require' name='arch-capabilities'/>
4423++ <feature policy='require' name='xsaves'/>
4424++ <feature policy='require' name='skip-l1dfl-vmentry'/>
4425++ <feature policy='disable' name='avx512vnni'/>
4426++</cpu>
4427+diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130.json b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130.json
4428+new file mode 100644
4429+index 0000000000..1a22387617
4430+--- /dev/null
4431++++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-6130.json
4432+@@ -0,0 +1,1201 @@
4433++{
4434++ "return": {
4435++ "model": {
4436++ "name": "base",
4437++ "props": {
4438++ "phys-bits": 0,
4439++ "core-id": -1,
4440++ "xlevel": 2147483656,
4441++ "cmov": true,
4442++ "ia64": false,
4443++ "ssb-no": false,
4444++ "aes": true,
4445++ "mmx": true,
4446++ "rdpid": false,
4447++ "arat": true,
4448++ "gfni": false,
4449++ "ibrs-all": false,
4450++ "pause-filter": false,
4451++ "xsavec": true,
4452++ "intel-pt": false,
4453++ "hv-frequencies": false,
4454++ "tsc-frequency": 0,
4455++ "xd": true,
4456++ "x-intel-pt-auto-level": false,
4457++ "hv-vendor-id": "",
4458++ "kvm-asyncpf": true,
4459++ "kvm_asyncpf": true,
4460++ "perfctr_core": false,
4461++ "perfctr-core": false,
4462++ "mpx": true,
4463++ "pbe": false,
4464++ "decodeassists": false,
4465++ "avx512cd": true,
4466++ "sse4_1": true,
4467++ "sse4.1": true,
4468++ "sse4-1": true,
4469++ "family": 6,
4470++ "legacy-cache": true,
4471++ "host-phys-bits-limit": 48,
4472++ "vmware-cpuid-freq": true,
4473++ "wbnoinvd": false,
4474++ "avx512f": true,
4475++ "hv-stimer-direct": false,
4476++ "msr": true,
4477++ "mce": true,
4478++ "mca": true,
4479++ "hv-runtime": false,
4480++ "xcrypt": false,
4481++ "thread-id": -1,
4482++ "min-level": 13,
4483++ "xgetbv1": true,
4484++ "cid": false,
4485++ "hv-relaxed": false,
4486++ "hv-crash": false,
4487++ "ds": false,
4488++ "fxsr": true,
4489++ "xsaveopt": true,
4490++ "xtpr": false,
4491++ "hv-evmcs": false,
4492++ "avx512vl": true,
4493++ "avx512-vpopcntdq": false,
4494++ "phe": false,
4495++ "extapic": false,
4496++ "3dnowprefetch": true,
4497++ "avx512vbmi2": false,
4498++ "cr8legacy": false,
4499++ "stibp": true,
4500++ "cpuid-0xb": true,
4501++ "xcrypt-en": false,
4502++ "kvm_pv_eoi": true,
4503++ "apic-id": 4294967295,
4504++ "rsba": false,
4505++ "pn": false,
4506++ "dca": false,
4507++ "vendor": "GenuineIntel",
4508++ "hv-ipi": false,
4509++ "pku": true,
4510++ "smx": false,
4511++ "cmp_legacy": false,
4512++ "cmp-legacy": false,
4513++ "node-id": -1,
4514++ "avx512-4fmaps": false,
4515++ "vmcb_clean": false,
4516++ "vmcb-clean": false,
4517++ "3dnowext": false,
4518++ "amd-no-ssb": false,
4519++ "hle": true,
4520++ "npt": false,
4521++ "rdctl-no": false,
4522++ "memory": "/machine/unattached/system[0]",
4523++ "clwb": true,
4524++ "lbrv": false,
4525++ "adx": true,
4526++ "ss": true,
4527++ "pni": true,
4528++ "svm_lock": false,
4529++ "svm-lock": false,
4530++ "pfthreshold": false,
4531++ "smep": true,
4532++ "smap": true,
4533++ "x2apic": true,
4534++ "avx512vbmi": false,
4535++ "avx512vnni": false,
4536++ "hv-stimer": false,
4537++ "x-hv-synic-kvm-only": true,
4538++ "i64": true,
4539++ "flushbyasid": false,
4540++ "f16c": true,
4541++ "ace2-en": false,
4542++ "pat": true,
4543++ "pae": true,
4544++ "sse": true,
4545++ "die-id": -1,
4546++ "phe-en": false,
4547++ "kvm_nopiodelay": true,
4548++ "kvm-nopiodelay": true,
4549++ "tm": false,
4550++ "kvmclock-stable-bit": true,
4551++ "hypervisor": true,
4552++ "socket-id": -1,
4553++ "mds-no": false,
4554++ "pcommit": false,
4555++ "syscall": true,
4556++ "level": 13,
4557++ "avx512dq": true,
4558++ "x-migrate-smi-count": false,
4559++ "svm": false,
4560++ "full-cpuid-auto-level": true,
4561++ "hv-reset": false,
4562++ "invtsc": false,
4563++ "sse3": true,
4564++ "sse2": true,
4565++ "ssbd": true,
4566++ "est": false,
4567++ "avx512ifma": false,
4568++ "tm2": false,
4569++ "kvm-pv-ipi": true,
4570++ "kvm-pv-eoi": true,
4571++ "cx8": true,
4572++ "cldemote": false,
4573++ "hv-reenlightenment": false,
4574++ "kvm_mmu": false,
4575++ "kvm-mmu": false,
4576++ "sse4_2": true,
4577++ "sse4.2": true,
4578++ "sse4-2": true,
4579++ "pge": true,
4580++ "fill-mtrr-mask": true,
4581++ "avx512bitalg": false,
4582++ "nodeid_msr": false,
4583++ "pdcm": false,
4584++ "movbe": true,
4585++ "model": 85,
4586++ "nrip_save": false,
4587++ "nrip-save": false,
4588++ "kvm_pv_unhalt": true,
4589++ "ssse3": true,
4590++ "sse4a": false,
4591++ "invpcid": true,
4592++ "pdpe1gb": true,
4593++ "tsc-deadline": true,
4594++ "skip-l1dfl-vmentry": true,
4595++ "fma": true,
4596++ "cx16": true,
4597++ "de": true,
4598++ "enforce": false,
4599++ "stepping": 4,
4600++ "xsave": true,
4601++ "clflush": true,
4602++ "skinit": false,
4603++ "tsc": true,
4604++ "tce": false,
4605++ "fpu": true,
4606++ "ibs": false,
4607++ "ds_cpl": false,
4608++ "ds-cpl": false,
4609++ "host-phys-bits": true,
4610++ "fma4": false,
4611++ "la57": false,
4612++ "osvw": false,
4613++ "check": true,
4614++ "hv-spinlocks": 4294967295,
4615++ "pmu": false,
4616++ "pmm": false,
4617++ "apic": true,
4618++ "spec-ctrl": true,
4619++ "min-xlevel2": 0,
4620++ "tsc-adjust": true,
4621++ "tsc_adjust": true,
4622++ "kvm-steal-time": true,
4623++ "kvm_steal_time": true,
4624++ "kvmclock": true,
4625++ "l3-cache": true,
4626++ "lwp": false,
4627++ "hv-passthrough": false,
4628++ "amd-ssbd": false,
4629++ "ibpb": false,
4630++ "xop": false,
4631++ "avx": true,
4632++ "core-capability": false,
4633++ "movdiri": false,
4634++ "ace2": false,
4635++ "avx512bw": true,
4636++ "acpi": false,
4637++ "hv-vapic": false,
4638++ "fsgsbase": true,
4639++ "ht": false,
4640++ "nx": true,
4641++ "pclmulqdq": true,
4642++ "mmxext": false,
4643++ "vaes": false,
4644++ "popcnt": true,
4645++ "xsaves": true,
4646++ "movdir64b": false,
4647++ "tcg-cpuid": true,
4648++ "lm": true,
4649++ "umip": true,
4650++ "pse": true,
4651++ "avx2": true,
4652++ "sep": true,
4653++ "pclmuldq": true,
4654++ "virt-ssbd": false,
4655++ "x-hv-max-vps": -1,
4656++ "nodeid-msr": false,
4657++ "md-clear": true,
4658++ "split-lock-detect": false,
4659++ "kvm": true,
4660++ "misalignsse": false,
4661++ "min-xlevel": 2147483656,
4662++ "kvm-pv-unhalt": true,
4663++ "bmi2": true,
4664++ "bmi1": true,
4665++ "realized": false,
4666++ "tsc_scale": false,
4667++ "tsc-scale": false,
4668++ "topoext": false,
4669++ "hv-vpindex": false,
4670++ "xlevel2": 0,
4671++ "clflushopt": true,
4672++ "kvm-no-smi-migration": false,
4673++ "monitor": false,
4674++ "avx512er": false,
4675++ "pmm-en": false,
4676++ "pcid": true,
4677++ "arch-capabilities": true,
4678++ "3dnow": false,
4679++ "erms": true,
4680++ "x-force-features": false,
4681++ "lahf-lm": true,
4682++ "lahf_lm": true,
4683++ "vpclmulqdq": false,
4684++ "fxsr-opt": false,
4685++ "hv-synic": false,
4686++ "xstore": false,
4687++ "fxsr_opt": false,
4688++ "kvm-hint-dedicated": false,
4689++ "rtm": true,
4690++ "lmce": true,
4691++ "hv-time": false,
4692++ "perfctr-nb": false,
4693++ "perfctr_nb": false,
4694++ "ffxsr": false,
4695++ "hv-tlbflush": false,
4696++ "rdrand": true,
4697++ "rdseed": true,
4698++ "avx512-4vnniw": false,
4699++ "vmx": true,
4700++ "vme": true,
4701++ "dtes64": false,
4702++ "mtrr": true,
4703++ "rdtscp": true,
4704++ "pse36": true,
4705++ "kvm-pv-tlb-flush": true,
4706++ "tbm": false,
4707++ "wdt": false,
4708++ "pause_filter": false,
4709++ "sha-ni": false,
4710++ "model-id": "Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz",
4711++ "abm": true,
4712++ "avx512pf": false,
4713++ "xstore-en": false
4714++ }
4715++ }
4716++ },
4717++ "id": "model-expansion"
4718++}
4719++
4720++{
4721++ "return": [
4722++ {
4723++ "name": "max",
4724++ "typename": "max-x86_64-cpu",
4725++ "unavailable-features": [],
4726++ "static": false,
4727++ "migration-safe": false
4728++ },
4729++ {
4730++ "name": "host",
4731++ "typename": "host-x86_64-cpu",
4732++ "unavailable-features": [],
4733++ "static": false,
4734++ "migration-safe": false
4735++ },
4736++ {
4737++ "name": "base",
4738++ "typename": "base-x86_64-cpu",
4739++ "unavailable-features": [],
4740++ "static": true,
4741++ "migration-safe": true
4742++ },
4743++ {
4744++ "name": "qemu64-v1",
4745++ "typename": "qemu64-v1-x86_64-cpu",
4746++ "unavailable-features": [],
4747++ "static": false,
4748++ "migration-safe": true
4749++ },
4750++ {
4751++ "name": "qemu64",
4752++ "typename": "qemu64-x86_64-cpu",
4753++ "unavailable-features": [],
4754++ "static": false,
4755++ "migration-safe": true
4756++ },
4757++ {
4758++ "name": "qemu32-v1",
4759++ "typename": "qemu32-v1-x86_64-cpu",
4760++ "unavailable-features": [],
4761++ "static": false,
4762++ "migration-safe": true
4763++ },
4764++ {
4765++ "name": "qemu32",
4766++ "typename": "qemu32-x86_64-cpu",
4767++ "unavailable-features": [],
4768++ "static": false,
4769++ "migration-safe": true
4770++ },
4771++ {
4772++ "name": "phenom-v1",
4773++ "typename": "phenom-v1-x86_64-cpu",
4774++ "unavailable-features": [
4775++ "mmxext",
4776++ "fxsr-opt",
4777++ "3dnowext",
4778++ "3dnow",
4779++ "sse4a",
4780++ "npt"
4781++ ],
4782++ "static": false,
4783++ "migration-safe": true
4784++ },
4785++ {
4786++ "name": "phenom",
4787++ "typename": "phenom-x86_64-cpu",
4788++ "unavailable-features": [
4789++ "mmxext",
4790++ "fxsr-opt",
4791++ "3dnowext",
4792++ "3dnow",
4793++ "sse4a",
4794++ "npt"
4795++ ],
4796++ "static": false,
4797++ "migration-safe": true
4798++ },
4799++ {
4800++ "name": "pentium3-v1",
4801++ "typename": "pentium3-v1-x86_64-cpu",
4802++ "unavailable-features": [],
4803++ "static": false,
4804++ "migration-safe": true
4805++ },
4806++ {
4807++ "name": "pentium3",
4808++ "typename": "pentium3-x86_64-cpu",
4809++ "unavailable-features": [],
4810++ "static": false,
4811++ "migration-safe": true
4812++ },
4813++ {
4814++ "name": "pentium2-v1",
4815++ "typename": "pentium2-v1-x86_64-cpu",
4816++ "unavailable-features": [],
4817++ "static": false,
4818++ "migration-safe": true
4819++ },
4820++ {
4821++ "name": "pentium2",
4822++ "typename": "pentium2-x86_64-cpu",
4823++ "unavailable-features": [],
4824++ "static": false,
4825++ "migration-safe": true
4826++ },
4827++ {
4828++ "name": "pentium-v1",
4829++ "typename": "pentium-v1-x86_64-cpu",
4830++ "unavailable-features": [],
4831++ "static": false,
4832++ "migration-safe": true
4833++ },
4834++ {
4835++ "name": "pentium",
4836++ "typename": "pentium-x86_64-cpu",
4837++ "unavailable-features": [],
4838++ "static": false,
4839++ "migration-safe": true
4840++ },
4841++ {
4842++ "name": "n270-v1",
4843++ "typename": "n270-v1-x86_64-cpu",
4844++ "unavailable-features": [],
4845++ "static": false,
4846++ "migration-safe": true
4847++ },
4848++ {
4849++ "name": "n270",
4850++ "typename": "n270-x86_64-cpu",
4851++ "unavailable-features": [],
4852++ "static": false,
4853++ "migration-safe": true
4854++ },
4855++ {
4856++ "name": "kvm64-v1",
4857++ "typename": "kvm64-v1-x86_64-cpu",
4858++ "unavailable-features": [],
4859++ "static": false,
4860++ "migration-safe": true
4861++ },
4862++ {
4863++ "name": "kvm64",
4864++ "typename": "kvm64-x86_64-cpu",
4865++ "unavailable-features": [],
4866++ "static": false,
4867++ "migration-safe": true
4868++ },
4869++ {
4870++ "name": "kvm32-v1",
4871++ "typename": "kvm32-v1-x86_64-cpu",
4872++ "unavailable-features": [],
4873++ "static": false,
4874++ "migration-safe": true
4875++ },
4876++ {
4877++ "name": "kvm32",
4878++ "typename": "kvm32-x86_64-cpu",
4879++ "unavailable-features": [],
4880++ "static": false,
4881++ "migration-safe": true
4882++ },
4883++ {
4884++ "name": "cpu64-rhel6-v1",
4885++ "typename": "cpu64-rhel6-v1-x86_64-cpu",
4886++ "unavailable-features": [
4887++ "sse4a"
4888++ ],
4889++ "static": false,
4890++ "migration-safe": true
4891++ },
4892++ {
4893++ "name": "cpu64-rhel6",
4894++ "typename": "cpu64-rhel6-x86_64-cpu",
4895++ "unavailable-features": [
4896++ "sse4a"
4897++ ],
4898++ "static": false,
4899++ "migration-safe": true
4900++ },
4901++ {
4902++ "name": "coreduo-v1",
4903++ "typename": "coreduo-v1-x86_64-cpu",
4904++ "unavailable-features": [],
4905++ "static": false,
4906++ "migration-safe": true
4907++ },
4908++ {
4909++ "name": "coreduo",
4910++ "typename": "coreduo-x86_64-cpu",
4911++ "unavailable-features": [],
4912++ "static": false,
4913++ "migration-safe": true
4914++ },
4915++ {
4916++ "name": "core2duo-v1",
4917++ "typename": "core2duo-v1-x86_64-cpu",
4918++ "unavailable-features": [],
4919++ "static": false,
4920++ "migration-safe": true
4921++ },
4922++ {
4923++ "name": "core2duo",
4924++ "typename": "core2duo-x86_64-cpu",
4925++ "unavailable-features": [],
4926++ "static": false,
4927++ "migration-safe": true
4928++ },
4929++ {
4930++ "name": "athlon-v1",
4931++ "typename": "athlon-v1-x86_64-cpu",
4932++ "unavailable-features": [
4933++ "mmxext",
4934++ "3dnowext",
4935++ "3dnow"
4936++ ],
4937++ "static": false,
4938++ "migration-safe": true
4939++ },
4940++ {
4941++ "name": "athlon",
4942++ "typename": "athlon-x86_64-cpu",
4943++ "unavailable-features": [
4944++ "mmxext",
4945++ "3dnowext",
4946++ "3dnow"
4947++ ],
4948++ "static": false,
4949++ "migration-safe": true
4950++ },
4951++ {
4952++ "name": "Westmere-v2",
4953++ "typename": "Westmere-v2-x86_64-cpu",
4954++ "unavailable-features": [],
4955++ "static": false,
4956++ "migration-safe": true
4957++ },
4958++ {
4959++ "name": "Westmere-v1",
4960++ "typename": "Westmere-v1-x86_64-cpu",
4961++ "unavailable-features": [],
4962++ "static": false,
4963++ "migration-safe": true
4964++ },
4965++ {
4966++ "name": "Westmere-IBRS",
4967++ "typename": "Westmere-IBRS-x86_64-cpu",
4968++ "unavailable-features": [],
4969++ "static": false,
4970++ "migration-safe": true
4971++ },
4972++ {
4973++ "name": "Westmere",
4974++ "typename": "Westmere-x86_64-cpu",
4975++ "unavailable-features": [],
4976++ "static": false,
4977++ "migration-safe": true
4978++ },
4979++ {
4980++ "name": "Snowridge-v1",
4981++ "typename": "Snowridge-v1-x86_64-cpu",
4982++ "unavailable-features": [
4983++ "sha-ni",
4984++ "gfni",
4985++ "cldemote",
4986++ "movdiri",
4987++ "movdir64b",
4988++ "core-capability",
4989++ "split-lock-detect"
4990++ ],
4991++ "static": false,
4992++ "migration-safe": true
4993++ },
4994++ {
4995++ "name": "Snowridge",
4996++ "typename": "Snowridge-x86_64-cpu",
4997++ "unavailable-features": [
4998++ "sha-ni",
4999++ "gfni",
5000++ "cldemote",
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches