Merge ~paelzer/ubuntu/+source/qemu:bug-1887490-EPYC-v3-1849644-websocket-1896751-migratereboot into ubuntu/+source/qemu:ubuntu/focal-devel

Proposed by Christian Ehrhardt 
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: a44412a7e164b347646e24a7c3b694cfc6484640
Merge reported by: Christian Ehrhardt 
Merged at revision: a44412a7e164b347646e24a7c3b694cfc6484640
Proposed branch: ~paelzer/ubuntu/+source/qemu:bug-1887490-EPYC-v3-1849644-websocket-1896751-migratereboot
Merge into: ubuntu/+source/qemu:ubuntu/focal-devel
Diff against target: 520 lines (+480/-0)
6 files modified
debian/changelog (+10/-0)
debian/patches/series (+4/-0)
debian/patches/ubuntu/lp-1849644-io-channel-websock-treat-binary-and-no-sub-protocol-.patch (+127/-0)
debian/patches/ubuntu/lp-1882774-i386-Add-2nd-Generation-AMD-EPYC-processors.patch (+191/-0)
debian/patches/ubuntu/lp-1882774-i386-Add-missing-cpu-feature-bits-in-EPYC-model.patch (+76/-0)
debian/patches/ubuntu/lp-1896751-exec-rom_reset-Free-rom-data-during-inmigrate-skip.patch (+72/-0)
Reviewer Review Type Date Requested Status
Robie Basak sru Approve
Canonical Server Pending
git-ubuntu developers Pending
Review via email: mp+391348@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 :

To ssh://git.launchpad.net/~usd-import-team/ubuntu/+source/qemu
 * [new tag] upload/1%4.2-3ubuntu6.7 -> upload/1%4.2-3ubuntu6.7

Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading qemu_4.2-3ubuntu6.7.dsc: done.
  Uploading qemu_4.2-3ubuntu6.7.debian.tar.xz: done.
  Uploading qemu_4.2-3ubuntu6.7_source.buildinfo: done.
  Uploading qemu_4.2-3ubuntu6.7_source.changes: done.
Successfully uploaded packages.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index be7e622..39477a0 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,13 @@
6+qemu (1:4.2-3ubuntu6.7) focal; urgency=medium
7+
8+ * d/p/ubuntu/lp-1882774-*: add newer EPYC processor types (LP: #1887490)
9+ * d/p/u/lp-1896751-exec-rom_reset-Free-rom-data-during-inmigrate-skip.patch:
10+ fix reboot after migration (LP: #1896751)
11+ * d/p/u/lp-1849644-io-channel-websock-treat-binary-and-no-sub-protocol-.patch:
12+ fix websocket compatibility with newer versions of noVNC (LP: #1849644)
13+
14+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Mon, 27 Jul 2020 11:45:26 +0200
15+
16 qemu (1:4.2-3ubuntu6.6) focal-security; urgency=medium
17
18 * SECURITY UPDATE: out-of-bounds read/write in USB emulator
19diff --git a/debian/patches/series b/debian/patches/series
20index 456dc1f..4e3be76 100644
21--- a/debian/patches/series
22+++ b/debian/patches/series
23@@ -225,3 +225,7 @@ ubuntu/lp-1883984-target-s390x-Fix-SQXBR.patch
24 ubuntu/lp-1890154-s390x-protvirt-allow-to-IPL-secure-guests-with-no-re.patch
25 ubuntu/hw-riscv-Allow-64-bit-access-to-SiFive-CLINT.patch
26 ubuntu/CVE-2020-14364.patch
27+ubuntu/lp-1882774-i386-Add-missing-cpu-feature-bits-in-EPYC-model.patch
28+ubuntu/lp-1882774-i386-Add-2nd-Generation-AMD-EPYC-processors.patch
29+ubuntu/lp-1896751-exec-rom_reset-Free-rom-data-during-inmigrate-skip.patch
30+ubuntu/lp-1849644-io-channel-websock-treat-binary-and-no-sub-protocol-.patch
31diff --git a/debian/patches/ubuntu/lp-1849644-io-channel-websock-treat-binary-and-no-sub-protocol-.patch b/debian/patches/ubuntu/lp-1849644-io-channel-websock-treat-binary-and-no-sub-protocol-.patch
32new file mode 100644
33index 0000000..979c67f
34--- /dev/null
35+++ b/debian/patches/ubuntu/lp-1849644-io-channel-websock-treat-binary-and-no-sub-protocol-.patch
36@@ -0,0 +1,127 @@
37+From c64e1e75381d0cb53f9fc8f93245a933b12c68a6 Mon Sep 17 00:00:00 2001
38+From: Yu-Chen Lin <npes87184@gmail.com>
39+Date: Sat, 23 Nov 2019 11:43:06 +0800
40+Subject: [PATCH] io/channel-websock: treat 'binary' and no sub-protocol as the
41+ same
42+MIME-Version: 1.0
43+Content-Type: text/plain; charset=UTF-8
44+Content-Transfer-Encoding: 8bit
45+
46+noVNC doesn't use 'binary' protocol by default after
47+commit c912230309806aacbae4295faf7ad6406da97617.
48+
49+It will cause qemu return 400 when handshaking.
50+
51+To overcome this problem and remain compatibility of
52+older noVNC client.
53+
54+We treat 'binary' and no sub-protocol as the same
55+so that we can support different version of noVNC
56+client.
57+
58+Tested on noVNC before c912230 and after c912230.
59+
60+Buglink: https://bugs.launchpad.net/qemu/+bug/1849644
61+
62+Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
63+Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
64+
65+Origin: upstream, https://git.qemu.org/?p=qemu.git;a=commit;h=c64e1e75381d
66+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1849644
67+Last-Update: 2020-09-24
68+
69+---
70+ io/channel-websock.c | 36 ++++++++++++++++++++++++------------
71+ 1 file changed, 24 insertions(+), 12 deletions(-)
72+
73+diff --git a/io/channel-websock.c b/io/channel-websock.c
74+index fc36d44eba..47a0e941d9 100644
75+--- a/io/channel-websock.c
76++++ b/io/channel-websock.c
77+@@ -49,13 +49,20 @@
78+ "Server: QEMU VNC\r\n" \
79+ "Date: %s\r\n"
80+
81++#define QIO_CHANNEL_WEBSOCK_HANDSHAKE_WITH_PROTO_RES_OK \
82++ "HTTP/1.1 101 Switching Protocols\r\n" \
83++ QIO_CHANNEL_WEBSOCK_HANDSHAKE_RES_COMMON \
84++ "Upgrade: websocket\r\n" \
85++ "Connection: Upgrade\r\n" \
86++ "Sec-WebSocket-Accept: %s\r\n" \
87++ "Sec-WebSocket-Protocol: binary\r\n" \
88++ "\r\n"
89+ #define QIO_CHANNEL_WEBSOCK_HANDSHAKE_RES_OK \
90+ "HTTP/1.1 101 Switching Protocols\r\n" \
91+ QIO_CHANNEL_WEBSOCK_HANDSHAKE_RES_COMMON \
92+ "Upgrade: websocket\r\n" \
93+ "Connection: Upgrade\r\n" \
94+ "Sec-WebSocket-Accept: %s\r\n" \
95+- "Sec-WebSocket-Protocol: binary\r\n" \
96+ "\r\n"
97+ #define QIO_CHANNEL_WEBSOCK_HANDSHAKE_RES_NOT_FOUND \
98+ "HTTP/1.1 404 Not Found\r\n" \
99+@@ -336,6 +343,7 @@ qio_channel_websock_find_header(QIOChannelWebsockHTTPHeader *hdrs,
100+
101+ static void qio_channel_websock_handshake_send_res_ok(QIOChannelWebsock *ioc,
102+ const char *key,
103++ const bool use_protocols,
104+ Error **errp)
105+ {
106+ char combined_key[QIO_CHANNEL_WEBSOCK_CLIENT_KEY_LEN +
107+@@ -361,8 +369,14 @@ static void qio_channel_websock_handshake_send_res_ok(QIOChannelWebsock *ioc,
108+ }
109+
110+ date = qio_channel_websock_date_str();
111+- qio_channel_websock_handshake_send_res(
112+- ioc, QIO_CHANNEL_WEBSOCK_HANDSHAKE_RES_OK, date, accept);
113++ if (use_protocols) {
114++ qio_channel_websock_handshake_send_res(
115++ ioc, QIO_CHANNEL_WEBSOCK_HANDSHAKE_WITH_PROTO_RES_OK,
116++ date, accept);
117++ } else {
118++ qio_channel_websock_handshake_send_res(
119++ ioc, QIO_CHANNEL_WEBSOCK_HANDSHAKE_RES_OK, date, accept);
120++ }
121+
122+ g_free(date);
123+ g_free(accept);
124+@@ -387,10 +401,6 @@ static void qio_channel_websock_handshake_process(QIOChannelWebsock *ioc,
125+
126+ protocols = qio_channel_websock_find_header(
127+ hdrs, nhdrs, QIO_CHANNEL_WEBSOCK_HEADER_PROTOCOL);
128+- if (!protocols) {
129+- error_setg(errp, "Missing websocket protocol header data");
130+- goto bad_request;
131+- }
132+
133+ version = qio_channel_websock_find_header(
134+ hdrs, nhdrs, QIO_CHANNEL_WEBSOCK_HEADER_VERSION);
135+@@ -430,10 +440,12 @@ static void qio_channel_websock_handshake_process(QIOChannelWebsock *ioc,
136+ trace_qio_channel_websock_http_request(ioc, protocols, version,
137+ host, connection, upgrade, key);
138+
139+- if (!g_strrstr(protocols, QIO_CHANNEL_WEBSOCK_PROTOCOL_BINARY)) {
140+- error_setg(errp, "No '%s' protocol is supported by client '%s'",
141+- QIO_CHANNEL_WEBSOCK_PROTOCOL_BINARY, protocols);
142+- goto bad_request;
143++ if (protocols) {
144++ if (!g_strrstr(protocols, QIO_CHANNEL_WEBSOCK_PROTOCOL_BINARY)) {
145++ error_setg(errp, "No '%s' protocol is supported by client '%s'",
146++ QIO_CHANNEL_WEBSOCK_PROTOCOL_BINARY, protocols);
147++ goto bad_request;
148++ }
149+ }
150+
151+ if (!g_str_equal(version, QIO_CHANNEL_WEBSOCK_SUPPORTED_VERSION)) {
152+@@ -467,7 +479,7 @@ static void qio_channel_websock_handshake_process(QIOChannelWebsock *ioc,
153+ goto bad_request;
154+ }
155+
156+- qio_channel_websock_handshake_send_res_ok(ioc, key, errp);
157++ qio_channel_websock_handshake_send_res_ok(ioc, key, !!protocols, errp);
158+ return;
159+
160+ bad_request:
161+--
162+2.28.0
163+
164diff --git a/debian/patches/ubuntu/lp-1882774-i386-Add-2nd-Generation-AMD-EPYC-processors.patch b/debian/patches/ubuntu/lp-1882774-i386-Add-2nd-Generation-AMD-EPYC-processors.patch
165new file mode 100644
166index 0000000..2b2328d
167--- /dev/null
168+++ b/debian/patches/ubuntu/lp-1882774-i386-Add-2nd-Generation-AMD-EPYC-processors.patch
169@@ -0,0 +1,191 @@
170+From 143c30d4d346831a09e59e9af45afdca0331e819 Mon Sep 17 00:00:00 2001
171+From: "Moger, Babu" <Babu.Moger@amd.com>
172+Date: Thu, 7 Nov 2019 18:01:04 +0000
173+Subject: [PATCH] i386: Add 2nd Generation AMD EPYC processors
174+
175+Adds the support for 2nd Gen AMD EPYC Processors. The model display
176+name will be EPYC-Rome.
177+
178+Adds the following new feature bits on top of the feature bits from the
179+first generation EPYC models.
180+perfctr-core : core performance counter extensions support. Enables the VM to
181+ use extended performance counter support. It enables six
182+ programmable counters instead of four counters.
183+clzero : instruction zeroes out the 64 byte cache line specified in RAX.
184+xsaveerptr : XSAVE, XSAVE, FXSAVEOPT, XSAVEC, XSAVES always save error
185+ pointers and FXRSTOR, XRSTOR, XRSTORS always restore error
186+ pointers.
187+wbnoinvd : Write back and do not invalidate cache
188+ibpb : Indirect Branch Prediction Barrier
189+amd-stibp : Single Thread Indirect Branch Predictor
190+clwb : Cache Line Write Back and Retain
191+xsaves : XSAVES, XRSTORS and IA32_XSS support
192+rdpid : Read Processor ID instruction support
193+umip : User-Mode Instruction Prevention support
194+
195+The Reference documents are available at
196+https://developer.amd.com/wp-content/resources/55803_0.54-PUB.pdf
197+https://www.amd.com/system/files/TechDocs/24594.pdf
198+
199+Depends on following kernel commits:
200+40bc47b08b6e ("kvm: x86: Enumerate support for CLZERO instruction")
201+504ce1954fba ("KVM: x86: Expose XSAVEERPTR to the guest")
202+6d61e3c32248 ("kvm: x86: Expose RDPID in KVM_GET_SUPPORTED_CPUID")
203+52297436199d ("kvm: svm: Update svm_xsaves_supported")
204+
205+Signed-off-by: Babu Moger <babu.moger@amd.com>
206+Message-Id: <157314966312.23828.17684821666338093910.stgit@naples-babu.amd.com>
207+Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
208+
209+Origin: upstream, https://git.qemu.org/?p=qemu.git;a=commit;h=143c30d4d346831a09e59e9af45afdca0331e819
210+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1882774
211+Last-Update: 2020-07-27
212+
213+---
214+ target/i386/cpu.c | 102 +++++++++++++++++++++++++++++++++++++++++++++-
215+ target/i386/cpu.h | 2 +
216+ 2 files changed, 103 insertions(+), 1 deletion(-)
217+
218+diff --git a/target/i386/cpu.c b/target/i386/cpu.c
219+index 54f42dcd25..350b51b346 100644
220+--- a/target/i386/cpu.c
221++++ b/target/i386/cpu.c
222+@@ -1133,7 +1133,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
223+ "clzero", NULL, "xsaveerptr", NULL,
224+ NULL, NULL, NULL, NULL,
225+ NULL, "wbnoinvd", NULL, NULL,
226+- "ibpb", NULL, NULL, NULL,
227++ "ibpb", NULL, NULL, "amd-stibp",
228+ NULL, NULL, NULL, NULL,
229+ NULL, NULL, NULL, NULL,
230+ "amd-ssbd", "virt-ssbd", "amd-no-ssb", NULL,
231+@@ -1798,6 +1798,56 @@ static CPUCaches epyc_cache_info = {
232+ },
233+ };
234+
235++static CPUCaches epyc_rome_cache_info = {
236++ .l1d_cache = &(CPUCacheInfo) {
237++ .type = DATA_CACHE,
238++ .level = 1,
239++ .size = 32 * KiB,
240++ .line_size = 64,
241++ .associativity = 8,
242++ .partitions = 1,
243++ .sets = 64,
244++ .lines_per_tag = 1,
245++ .self_init = 1,
246++ .no_invd_sharing = true,
247++ },
248++ .l1i_cache = &(CPUCacheInfo) {
249++ .type = INSTRUCTION_CACHE,
250++ .level = 1,
251++ .size = 32 * KiB,
252++ .line_size = 64,
253++ .associativity = 8,
254++ .partitions = 1,
255++ .sets = 64,
256++ .lines_per_tag = 1,
257++ .self_init = 1,
258++ .no_invd_sharing = true,
259++ },
260++ .l2_cache = &(CPUCacheInfo) {
261++ .type = UNIFIED_CACHE,
262++ .level = 2,
263++ .size = 512 * KiB,
264++ .line_size = 64,
265++ .associativity = 8,
266++ .partitions = 1,
267++ .sets = 1024,
268++ .lines_per_tag = 1,
269++ },
270++ .l3_cache = &(CPUCacheInfo) {
271++ .type = UNIFIED_CACHE,
272++ .level = 3,
273++ .size = 16 * MiB,
274++ .line_size = 64,
275++ .associativity = 16,
276++ .partitions = 1,
277++ .sets = 16384,
278++ .lines_per_tag = 1,
279++ .self_init = true,
280++ .inclusive = true,
281++ .complex_indexing = true,
282++ },
283++};
284++
285+ /* The following VMX features are not supported by KVM and are left out in the
286+ * CPU definitions:
287+ *
288+@@ -4030,6 +4080,56 @@ static X86CPUDefinition builtin_x86_defs[] = {
289+ .model_id = "Hygon Dhyana Processor",
290+ .cache_info = &epyc_cache_info,
291+ },
292++ {
293++ .name = "EPYC-Rome",
294++ .level = 0xd,
295++ .vendor = CPUID_VENDOR_AMD,
296++ .family = 23,
297++ .model = 49,
298++ .stepping = 0,
299++ .features[FEAT_1_EDX] =
300++ CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX | CPUID_CLFLUSH |
301++ CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA | CPUID_PGE |
302++ CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 | CPUID_MCE |
303++ CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE | CPUID_DE |
304++ CPUID_VME | CPUID_FP87,
305++ .features[FEAT_1_ECX] =
306++ CPUID_EXT_RDRAND | CPUID_EXT_F16C | CPUID_EXT_AVX |
307++ CPUID_EXT_XSAVE | CPUID_EXT_AES | CPUID_EXT_POPCNT |
308++ CPUID_EXT_MOVBE | CPUID_EXT_SSE42 | CPUID_EXT_SSE41 |
309++ CPUID_EXT_CX16 | CPUID_EXT_FMA | CPUID_EXT_SSSE3 |
310++ CPUID_EXT_MONITOR | CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3,
311++ .features[FEAT_8000_0001_EDX] =
312++ CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_PDPE1GB |
313++ CPUID_EXT2_FFXSR | CPUID_EXT2_MMXEXT | CPUID_EXT2_NX |
314++ CPUID_EXT2_SYSCALL,
315++ .features[FEAT_8000_0001_ECX] =
316++ CPUID_EXT3_OSVW | CPUID_EXT3_3DNOWPREFETCH |
317++ CPUID_EXT3_MISALIGNSSE | CPUID_EXT3_SSE4A | CPUID_EXT3_ABM |
318++ CPUID_EXT3_CR8LEG | CPUID_EXT3_SVM | CPUID_EXT3_LAHF_LM |
319++ CPUID_EXT3_TOPOEXT | CPUID_EXT3_PERFCORE,
320++ .features[FEAT_8000_0008_EBX] =
321++ CPUID_8000_0008_EBX_CLZERO | CPUID_8000_0008_EBX_XSAVEERPTR |
322++ CPUID_8000_0008_EBX_WBNOINVD | CPUID_8000_0008_EBX_IBPB |
323++ CPUID_8000_0008_EBX_STIBP,
324++ .features[FEAT_7_0_EBX] =
325++ CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_AVX2 |
326++ CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_RDSEED |
327++ CPUID_7_0_EBX_ADX | CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_CLFLUSHOPT |
328++ CPUID_7_0_EBX_SHA_NI | CPUID_7_0_EBX_CLWB,
329++ .features[FEAT_7_0_ECX] =
330++ CPUID_7_0_ECX_UMIP | CPUID_7_0_ECX_RDPID,
331++ .features[FEAT_XSAVE] =
332++ CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC |
333++ CPUID_XSAVE_XGETBV1 | CPUID_XSAVE_XSAVES,
334++ .features[FEAT_6_EAX] =
335++ CPUID_6_EAX_ARAT,
336++ .features[FEAT_SVM] =
337++ CPUID_SVM_NPT | CPUID_SVM_NRIPSAVE,
338++ .xlevel = 0x8000001E,
339++ .model_id = "AMD EPYC-Rome Processor",
340++ .cache_info = &epyc_rome_cache_info,
341++ },
342+ };
343+
344+ /* KVM-specific features that are automatically added/removed
345+diff --git a/target/i386/cpu.h b/target/i386/cpu.h
346+index 576f309bbf..68b186d258 100644
347+--- a/target/i386/cpu.h
348++++ b/target/i386/cpu.h
349+@@ -792,6 +792,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS];
350+ #define CPUID_8000_0008_EBX_WBNOINVD (1U << 9)
351+ /* Indirect Branch Prediction Barrier */
352+ #define CPUID_8000_0008_EBX_IBPB (1U << 12)
353++/* Single Thread Indirect Branch Predictors */
354++#define CPUID_8000_0008_EBX_STIBP (1U << 15)
355+
356+ #define CPUID_XSAVE_XSAVEOPT (1U << 0)
357+ #define CPUID_XSAVE_XSAVEC (1U << 1)
358+--
359+2.27.0
360+
361diff --git a/debian/patches/ubuntu/lp-1882774-i386-Add-missing-cpu-feature-bits-in-EPYC-model.patch b/debian/patches/ubuntu/lp-1882774-i386-Add-missing-cpu-feature-bits-in-EPYC-model.patch
362new file mode 100644
363index 0000000..db0b681
364--- /dev/null
365+++ b/debian/patches/ubuntu/lp-1882774-i386-Add-missing-cpu-feature-bits-in-EPYC-model.patch
366@@ -0,0 +1,76 @@
367+From a16e8dbc043720abcb37fc7dca313e720b4e0f0c Mon Sep 17 00:00:00 2001
368+From: "Moger, Babu" <Babu.Moger@amd.com>
369+Date: Thu, 7 Nov 2019 18:00:57 +0000
370+Subject: [PATCH] i386: Add missing cpu feature bits in EPYC model
371+
372+Adds the following missing CPUID bits:
373+perfctr-core : core performance counter extensions support. Enables the VM
374+ to use extended performance counter support. It enables six
375+ programmable counters instead of 4 counters.
376+clzero : instruction zeroes out the 64 byte cache line specified in RAX.
377+xsaveerptr : XSAVE, XSAVE, FXSAVEOPT, XSAVEC, XSAVES always save error
378+ pointers and FXRSTOR, XRSTOR, XRSTORS always restore error
379+ pointers.
380+ibpb : Indirect Branch Prediction Barrie.
381+xsaves : XSAVES, XRSTORS and IA32_XSS supported.
382+
383+Depends on following kernel commits:
384+40bc47b08b6e ("kvm: x86: Enumerate support for CLZERO instruction")
385+504ce1954fba ("KVM: x86: Expose XSAVEERPTR to the guest")
386+52297436199d ("kvm: svm: Update svm_xsaves_supported")
387+
388+These new features will be added in EPYC-v3. The -cpu help output after the change.
389+x86 EPYC-v1 AMD EPYC Processor
390+x86 EPYC-v2 AMD EPYC Processor (with IBPB)
391+x86 EPYC-v3 AMD EPYC Processor
392+
393+Signed-off-by: Babu Moger <babu.moger@amd.com>
394+Message-Id: <157314965662.23828.3063243729449408327.stgit@naples-babu.amd.com>
395+Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
396+
397+Origin: upstream, https://git.qemu.org/?p=qemu.git;a=commit;h=a16e8dbc043720abcb37fc7dca313e720b4e0f0c
398+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1882774
399+Last-Update: 2020-07-27
400+
401+---
402+ target/i386/cpu.c | 17 +++++++++++++----
403+ 1 file changed, 13 insertions(+), 4 deletions(-)
404+
405+diff --git a/target/i386/cpu.c b/target/i386/cpu.c
406+index dc78494167..54f42dcd25 100644
407+--- a/target/i386/cpu.c
408++++ b/target/i386/cpu.c
409+@@ -3942,10 +3942,6 @@ static X86CPUDefinition builtin_x86_defs[] = {
410+ CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_RDSEED |
411+ CPUID_7_0_EBX_ADX | CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_CLFLUSHOPT |
412+ CPUID_7_0_EBX_SHA_NI,
413+- /* Missing: XSAVES (not supported by some Linux versions,
414+- * including v4.1 to v4.12).
415+- * KVM doesn't yet expose any XSAVES state save component.
416+- */
417+ .features[FEAT_XSAVE] =
418+ CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC |
419+ CPUID_XSAVE_XGETBV1,
420+@@ -3968,6 +3964,19 @@ static X86CPUDefinition builtin_x86_defs[] = {
421+ { /* end of list */ }
422+ }
423+ },
424++ {
425++ .version = 3,
426++ .props = (PropValue[]) {
427++ { "ibpb", "on" },
428++ { "perfctr-core", "on" },
429++ { "clzero", "on" },
430++ { "xsaveerptr", "on" },
431++ { "xsaves", "on" },
432++ { "model-id",
433++ "AMD EPYC Processor" },
434++ { /* end of list */ }
435++ }
436++ },
437+ { /* end of list */ }
438+ }
439+ },
440+--
441+2.27.0
442+
443diff --git a/debian/patches/ubuntu/lp-1896751-exec-rom_reset-Free-rom-data-during-inmigrate-skip.patch b/debian/patches/ubuntu/lp-1896751-exec-rom_reset-Free-rom-data-during-inmigrate-skip.patch
444new file mode 100644
445index 0000000..75f4cff
446--- /dev/null
447+++ b/debian/patches/ubuntu/lp-1896751-exec-rom_reset-Free-rom-data-during-inmigrate-skip.patch
448@@ -0,0 +1,72 @@
449+From 5073b5d3ea303d37f4a8e2ea451d7a2eb1817448 Mon Sep 17 00:00:00 2001
450+From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
451+Date: Fri, 13 Mar 2020 15:59:39 +0000
452+Subject: [PATCH] exec/rom_reset: Free rom data during inmigrate skip
453+
454+Commit 355477f8c73e9 skips rom reset when we're an incoming migration
455+so as not to overwrite shared ram in the ignore-shared migration
456+optimisation.
457+However, it's got an unexpected side effect that because it skips
458+freeing the ROM data, when rom_reset gets called later on, after
459+migration (e.g. during a reboot), the ROM does get reset to the original
460+file contents. Because of seabios/x86's weird reboot process
461+this confuses a reboot into hanging after a migration.
462+
463+Fixes: 355477f8c73e9 ("migration: do not rom_reset() during incoming migration")
464+https://bugzilla.redhat.com/show_bug.cgi?id=1809380
465+
466+Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
467+Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
468+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
469+
470+Origin: upstream, https://git.qemu.org/?p=qemu.git;a=commit;h=5073b5d3ea303d37
471+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1896751
472+Last-Update: 2020-09-24
473+
474+---
475+ hw/core/loader.c | 25 ++++++++++++++++---------
476+ 1 file changed, 16 insertions(+), 9 deletions(-)
477+
478+diff --git a/hw/core/loader.c b/hw/core/loader.c
479+index d1b78f60cd..eeef6da9a1 100644
480+--- a/hw/core/loader.c
481++++ b/hw/core/loader.c
482+@@ -1119,19 +1119,26 @@ static void rom_reset(void *unused)
483+ {
484+ Rom *rom;
485+
486+- /*
487+- * We don't need to fill in the RAM with ROM data because we'll fill
488+- * the data in during the next incoming migration in all cases. Note
489+- * that some of those RAMs can actually be modified by the guest on ARM
490+- * so this is probably the only right thing to do here.
491+- */
492+- if (runstate_check(RUN_STATE_INMIGRATE))
493+- return;
494+-
495+ QTAILQ_FOREACH(rom, &roms, next) {
496+ if (rom->fw_file) {
497+ continue;
498+ }
499++ /*
500++ * We don't need to fill in the RAM with ROM data because we'll fill
501++ * the data in during the next incoming migration in all cases. Note
502++ * that some of those RAMs can actually be modified by the guest.
503++ */
504++ if (runstate_check(RUN_STATE_INMIGRATE)) {
505++ if (rom->data && rom->isrom) {
506++ /*
507++ * Free it so that a rom_reset after migration doesn't
508++ * overwrite a potentially modified 'rom'.
509++ */
510++ rom_free_data(rom);
511++ }
512++ continue;
513++ }
514++
515+ if (rom->data == NULL) {
516+ continue;
517+ }
518+--
519+2.28.0
520+

Subscribers

People subscribed via source and target branches