Merge ~paelzer/ubuntu/+source/qemu:lp-2011832-emulation-issues-lp-1999885-tod-in-pv-JAMMY into ubuntu/+source/qemu:ubuntu/jammy-devel

Proposed by Christian Ehrhardt 
Status: Merged
Approved by: git-ubuntu bot
Approved revision: not available
Merged at revision: a180b2b72215fdfcbfa3e543afc117ac0e1f5f7e
Proposed branch: ~paelzer/ubuntu/+source/qemu:lp-2011832-emulation-issues-lp-1999885-tod-in-pv-JAMMY
Merge into: ubuntu/+source/qemu:ubuntu/jammy-devel
Diff against target: 305 lines (+265/-0)
6 files modified
debian/changelog (+8/-0)
debian/patches/series (+4/-0)
debian/patches/ubuntu/lp-1999885-s390x-tod-kvm-don-t-save-restore-the-TOD-in-PV-guest.patch (+62/-0)
debian/patches/ubuntu/lp-2011832-target-mips-Fix-FTRUNC_S-and-FTRUNC_U-trans-helper.patch (+43/-0)
debian/patches/ubuntu/lp-2011832-target-mips-Fix-df_extract_val-and-df_extract_df-dfe.patch (+54/-0)
debian/patches/ubuntu/lp-2011832-target-ppc-Fix-xs-max-min-cj-dp-to-use-VSX-registers.patch (+94/-0)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Miriam España Acebal (community) Approve
Canonical Server Reporter Pending
Review via email: mp+439682@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
Miriam España Acebal (mirespace) wrote :

* Changelog checked ...OK
  - version: OK
  - series: OK
  - Entries: OK
    + All files reflected ... OK
    + Size... OK (the patch's name is so large that exceeds 80 characters... but life happens).

* Patches... OK
   - Patches present in series file ... OK
   - DEP-3 Headers in patches present ... OK
     + Required fields present (Description/subject, Origin or Author)...OK
     + Field bug-ubuntu ...OK

* The package builds... OK
  - no changes outside debian folder ... OK
  - in PPA... OK
  - install/uninstall ... OK (tested in the bug)
  - DEP8 test ... I cannot run it in https://autopkgtest.ubuntu.com/ :(
  - Fix the bug ... OK (tested in the bug)

* Git ...OK
   - changelog is the last commit ... OK
   - A commit per logical change... OK

* SRU paperwork ... OK
  - Steps to reproduce in place .. OK

Thanks for your work!

P.S.: The only thing is that the patch

ubuntu/lp-2011832-target-ppc-Fix-xs-max-min-cj-dp-to-use-VSX-registers.patch

is not being used in Kinetic. I only write this to notice it just in case it is not needed in the Kinetic version or is missed there.

review: Approve
Revision history for this message
git-ubuntu bot (git-ubuntu-bot) wrote :

Approvers: paelzer, mirespace
Uploaders: paelzer
MP auto-approved

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

The former SRUs cleared, now uploaded to -unapproved

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 87128ee..89921af 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+qemu (1:6.2+dfsg-2ubuntu6.8) jammy; urgency=medium
7+
8+ * d/p/u/lp-1999885-s390x-tod-kvm-don-t-save-restore-the-TOD-in-PV-guest.patch:
9+ avoid timer issues in s390x secure execution guests (LP: #1999885)
10+ * d/p/u/lp-2011832-*: fix emulation issues in mips and powerpc (LP: #2011832)
11+
12+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Thu, 23 Mar 2023 08:18:28 +0100
13+
14 qemu (1:6.2+dfsg-2ubuntu6.7) jammy; urgency=medium
15
16 [ Brett Milford ]
17diff --git a/debian/patches/series b/debian/patches/series
18index 9283b19..e8c1d3d 100644
19--- a/debian/patches/series
20+++ b/debian/patches/series
21@@ -52,3 +52,7 @@ CVE-2022-0216-2.patch
22 CVE-2022-3165.patch
23 ubuntu/lp1994002-migration-Read-state-once.patch
24 ubuntu/lp2009048-vfio_map_dma_einval_amd_iommu_1tb.patch
25+ubuntu/lp-1999885-s390x-tod-kvm-don-t-save-restore-the-TOD-in-PV-guest.patch
26+ubuntu/lp-2011832-target-ppc-Fix-xs-max-min-cj-dp-to-use-VSX-registers.patch
27+ubuntu/lp-2011832-target-mips-Fix-df_extract_val-and-df_extract_df-dfe.patch
28+ubuntu/lp-2011832-target-mips-Fix-FTRUNC_S-and-FTRUNC_U-trans-helper.patch
29diff --git a/debian/patches/ubuntu/lp-1999885-s390x-tod-kvm-don-t-save-restore-the-TOD-in-PV-guest.patch b/debian/patches/ubuntu/lp-1999885-s390x-tod-kvm-don-t-save-restore-the-TOD-in-PV-guest.patch
30new file mode 100644
31index 0000000..dc78dea
32--- /dev/null
33+++ b/debian/patches/ubuntu/lp-1999885-s390x-tod-kvm-don-t-save-restore-the-TOD-in-PV-guest.patch
34@@ -0,0 +1,62 @@
35+From 38621181ae3cbec62e3490fbc14f6ac01642d07a Mon Sep 17 00:00:00 2001
36+From: Nico Boehr <nrb@linux.ibm.com>
37+Date: Wed, 12 Oct 2022 14:32:29 +0200
38+Subject: [PATCH] s390x/tod-kvm: don't save/restore the TOD in PV guests
39+
40+Under PV, the guest's TOD clock is under control of the ultravisor and the
41+hypervisor cannot change it.
42+
43+With upcoming kernel changes[1], the Linux kernel will reject QEMU's
44+request to adjust the guest's clock in this case, so don't attempt to set
45+the clock.
46+
47+This avoids the following warning message on save/restore of a PV guest:
48+
49+warning: Unable to set KVM guest TOD clock: Operation not supported
50+
51+[1] https://lore.kernel.org/all/20221011160712.928239-2-nrb@linux.ibm.com/
52+
53+Fixes: c3347ed0d2ee ("s390x: protvirt: Support unpack facility")
54+Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
55+Message-Id: <20221012123229.1196007-1-nrb@linux.ibm.com>
56+[thuth: Add curly braces]
57+Signed-off-by: Thomas Huth <thuth@redhat.com>
58+
59+Origin: upstream, https://gitlab.com/qemu-project/qemu/-/commit/38621181ae3
60+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1999885
61+Last-Update: 2023-03-23
62+
63+---
64+ hw/s390x/tod-kvm.c | 9 +++++++++
65+ 1 file changed, 9 insertions(+)
66+
67+diff --git a/hw/s390x/tod-kvm.c b/hw/s390x/tod-kvm.c
68+index 9d0cbfbce2b..e2202dae2dc 100644
69+--- a/hw/s390x/tod-kvm.c
70++++ b/hw/s390x/tod-kvm.c
71+@@ -13,6 +13,7 @@
72+ #include "qemu/module.h"
73+ #include "sysemu/runstate.h"
74+ #include "hw/s390x/tod.h"
75++#include "hw/s390x/pv.h"
76+ #include "kvm/kvm_s390x.h"
77+
78+ static void kvm_s390_get_tod_raw(S390TOD *tod, Error **errp)
79+@@ -84,6 +85,14 @@ static void kvm_s390_tod_vm_state_change(void *opaque, bool running,
80+ S390TODState *td = opaque;
81+ Error *local_err = NULL;
82+
83++ /*
84++ * Under PV, the clock is under ultravisor control, hence we cannot restore
85++ * it on resume.
86++ */
87++ if (s390_is_pv()) {
88++ return;
89++ }
90++
91+ if (running && td->stopped) {
92+ /* Set the old TOD when running the VM - start the TOD clock. */
93+ kvm_s390_set_tod_raw(&td->base, &local_err);
94+--
95+2.40.0
96+
97diff --git a/debian/patches/ubuntu/lp-2011832-target-mips-Fix-FTRUNC_S-and-FTRUNC_U-trans-helper.patch b/debian/patches/ubuntu/lp-2011832-target-mips-Fix-FTRUNC_S-and-FTRUNC_U-trans-helper.patch
98new file mode 100644
99index 0000000..9863740
100--- /dev/null
101+++ b/debian/patches/ubuntu/lp-2011832-target-mips-Fix-FTRUNC_S-and-FTRUNC_U-trans-helper.patch
102@@ -0,0 +1,43 @@
103+From 1d29f899e7f2ae9bd1bc3eb0c59e72fe932f53a6 Mon Sep 17 00:00:00 2001
104+From: Ni Hui <shuizhuyuanluo@126.com>
105+Date: Tue, 3 May 2022 22:42:41 +0800
106+Subject: [PATCH] target/mips: Fix FTRUNC_S and FTRUNC_U trans helper
107+MIME-Version: 1.0
108+Content-Type: text/plain; charset=UTF-8
109+Content-Transfer-Encoding: 8bit
110+
111+Fix the FTRUNC_S and FTRUNC_U trans helper problem.
112+
113+Fixes: 5c5b64000c ("target/mips: Convert MSA 2RF instruction format to decodetree")
114+Signed-off-by: nihui <shuizhuyuanluo@126.com>
115+Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
116+Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
117+Message-Id: <20220503144241.289239-1-shuizhuyuanluo@126.com>
118+Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
119+
120+Origin: upstream, https://gitlab.com/qemu-project/qemu/-/commit/1d29f899e7f
121+Bug-Ubuntu: https://bugs.launchpad.net/bugs/2011832
122+Last-Update: 2023-03-23
123+
124+---
125+ target/mips/tcg/msa_translate.c | 4 ++--
126+ 1 file changed, 2 insertions(+), 2 deletions(-)
127+
128+diff --git a/target/mips/tcg/msa_translate.c b/target/mips/tcg/msa_translate.c
129+index 0b3dd0957c2..1bcdbb11215 100644
130+--- a/target/mips/tcg/msa_translate.c
131++++ b/target/mips/tcg/msa_translate.c
132+@@ -752,8 +752,8 @@ static bool trans_msa_2rf(DisasContext *ctx, arg_msa_r *a,
133+ }
134+
135+ TRANS(FCLASS, trans_msa_2rf, gen_helper_msa_fclass_df);
136+-TRANS(FTRUNC_S, trans_msa_2rf, gen_helper_msa_fclass_df);
137+-TRANS(FTRUNC_U, trans_msa_2rf, gen_helper_msa_ftrunc_s_df);
138++TRANS(FTRUNC_S, trans_msa_2rf, gen_helper_msa_ftrunc_s_df);
139++TRANS(FTRUNC_U, trans_msa_2rf, gen_helper_msa_ftrunc_u_df);
140+ TRANS(FSQRT, trans_msa_2rf, gen_helper_msa_fsqrt_df);
141+ TRANS(FRSQRT, trans_msa_2rf, gen_helper_msa_frsqrt_df);
142+ TRANS(FRCP, trans_msa_2rf, gen_helper_msa_frcp_df);
143+--
144+2.40.0
145+
146diff --git a/debian/patches/ubuntu/lp-2011832-target-mips-Fix-df_extract_val-and-df_extract_df-dfe.patch b/debian/patches/ubuntu/lp-2011832-target-mips-Fix-df_extract_val-and-df_extract_df-dfe.patch
147new file mode 100644
148index 0000000..6cb49c5
149--- /dev/null
150+++ b/debian/patches/ubuntu/lp-2011832-target-mips-Fix-df_extract_val-and-df_extract_df-dfe.patch
151@@ -0,0 +1,54 @@
152+From 7fc235c67f6c136ceba2305bcf2609c46a74620d Mon Sep 17 00:00:00 2001
153+From: Ni Hui <shuizhuyuanluo@126.com>
154+Date: Tue, 3 May 2022 21:07:06 +0800
155+Subject: [PATCH] target/mips: Fix df_extract_val() and df_extract_df() dfe
156+ lookup
157+MIME-Version: 1.0
158+Content-Type: text/plain; charset=UTF-8
159+Content-Transfer-Encoding: 8bit
160+
161+Actually look into dfe structure data so that df_extract_val() and
162+df_extract_df() can return immediate and datafield other than BYTE.
163+
164+Fixes: 4701d23aef ("target/mips: Convert MSA BIT instruction format to decodetree")
165+Signed-off-by: Ni Hui <shuizhuyuanluo@126.com>
166+Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
167+Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
168+Message-Id: <20220503130708.272850-2-shuizhuyuanluo@126.com>
169+Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
170+
171+Origin: upstream, https://gitlab.com/qemu-project/qemu/-/commit/7fc235c67f6
172+Bug-Ubuntu: https://bugs.launchpad.net/bugs/2011832
173+Last-Update: 2023-03-23
174+
175+---
176+ target/mips/tcg/msa_translate.c | 6 +++---
177+ 1 file changed, 3 insertions(+), 3 deletions(-)
178+
179+diff --git a/target/mips/tcg/msa_translate.c b/target/mips/tcg/msa_translate.c
180+index 76307102f29..aa45bae0aa5 100644
181+--- a/target/mips/tcg/msa_translate.c
182++++ b/target/mips/tcg/msa_translate.c
183+@@ -68,8 +68,8 @@ struct dfe {
184+ static int df_extract_val(DisasContext *ctx, int x, const struct dfe *s)
185+ {
186+ for (unsigned i = 0; i < 4; i++) {
187+- if (extract32(x, s->start, s->length) == s->mask) {
188+- return extract32(x, 0, s->start);
189++ if (extract32(x, s[i].start, s[i].length) == s[i].mask) {
190++ return extract32(x, 0, s[i].start);
191+ }
192+ }
193+ return -1;
194+@@ -82,7 +82,7 @@ static int df_extract_val(DisasContext *ctx, int x, const struct dfe *s)
195+ static int df_extract_df(DisasContext *ctx, int x, const struct dfe *s)
196+ {
197+ for (unsigned i = 0; i < 4; i++) {
198+- if (extract32(x, s->start, s->length) == s->mask) {
199++ if (extract32(x, s[i].start, s[i].length) == s[i].mask) {
200+ return i;
201+ }
202+ }
203+--
204+2.40.0
205+
206diff --git a/debian/patches/ubuntu/lp-2011832-target-ppc-Fix-xs-max-min-cj-dp-to-use-VSX-registers.patch b/debian/patches/ubuntu/lp-2011832-target-ppc-Fix-xs-max-min-cj-dp-to-use-VSX-registers.patch
207new file mode 100644
208index 0000000..a49dbbd
209--- /dev/null
210+++ b/debian/patches/ubuntu/lp-2011832-target-ppc-Fix-xs-max-min-cj-dp-to-use-VSX-registers.patch
211@@ -0,0 +1,94 @@
212+From 201fc774e0e1cc76ec23b595968004a7b14fb6e8 Mon Sep 17 00:00:00 2001
213+From: Victor Colombo <victor.colombo@eldorado.org.br>
214+Date: Fri, 17 Dec 2021 17:57:18 +0100
215+Subject: [PATCH] target/ppc: Fix xs{max, min}[cj]dp to use VSX registers
216+MIME-Version: 1.0
217+Content-Type: text/plain; charset=UTF-8
218+Content-Transfer-Encoding: 8bit
219+
220+PPC instruction xsmaxcdp, xsmincdp, xsmaxjdp, and xsminjdp are using
221+vector registers when they should be using VSX ones. This happens
222+because the instructions are using GEN_VSX_HELPER_R3, which adds 32
223+to the register numbers, effectively making them vector registers.
224+
225+This patch fixes it by changing these instructions to use
226+GEN_VSX_HELPER_X3.
227+
228+Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
229+Signed-off-by: Victor Colombo <victor.colombo@eldorado.org.br>
230+Message-Id: <20211213120958.24443-2-victor.colombo@eldorado.org.br>
231+Signed-off-by: Cédric Le Goater <clg@kaod.org>
232+
233+Origin: upstream, https://gitlab.com/qemu-project/qemu/-/commit/201fc774e0e
234+Bug-Ubuntu: https://bugs.launchpad.net/bugs/2011832
235+Last-Update: 2023-03-22
236+
237+---
238+ target/ppc/fpu_helper.c | 4 ++--
239+ target/ppc/helper.h | 8 ++++----
240+ target/ppc/translate/vsx-impl.c.inc | 8 ++++----
241+ 3 files changed, 10 insertions(+), 10 deletions(-)
242+
243+diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c
244+index 1e9a1615403..d144f21dc04 100644
245+--- a/target/ppc/fpu_helper.c
246++++ b/target/ppc/fpu_helper.c
247+@@ -2495,7 +2495,7 @@ VSX_MAX_MIN(xvmindp, minnum, 2, float64, VsrD(i))
248+ VSX_MAX_MIN(xvminsp, minnum, 4, float32, VsrW(i))
249+
250+ #define VSX_MAX_MINC(name, max) \
251+-void helper_##name(CPUPPCState *env, uint32_t opcode, \
252++void helper_##name(CPUPPCState *env, \
253+ ppc_vsr_t *xt, ppc_vsr_t *xa, ppc_vsr_t *xb) \
254+ { \
255+ ppc_vsr_t t = *xt; \
256+@@ -2530,7 +2530,7 @@ VSX_MAX_MINC(xsmaxcdp, 1);
257+ VSX_MAX_MINC(xsmincdp, 0);
258+
259+ #define VSX_MAX_MINJ(name, max) \
260+-void helper_##name(CPUPPCState *env, uint32_t opcode, \
261++void helper_##name(CPUPPCState *env, \
262+ ppc_vsr_t *xt, ppc_vsr_t *xa, ppc_vsr_t *xb) \
263+ { \
264+ ppc_vsr_t t = *xt; \
265+diff --git a/target/ppc/helper.h b/target/ppc/helper.h
266+index 72b2c70ac1f..fb946dc9742 100644
267+--- a/target/ppc/helper.h
268++++ b/target/ppc/helper.h
269+@@ -403,10 +403,10 @@ DEF_HELPER_4(xscmpoqp, void, env, i32, vsr, vsr)
270+ DEF_HELPER_4(xscmpuqp, void, env, i32, vsr, vsr)
271+ DEF_HELPER_4(xsmaxdp, void, env, vsr, vsr, vsr)
272+ DEF_HELPER_4(xsmindp, void, env, vsr, vsr, vsr)
273+-DEF_HELPER_5(xsmaxcdp, void, env, i32, vsr, vsr, vsr)
274+-DEF_HELPER_5(xsmincdp, void, env, i32, vsr, vsr, vsr)
275+-DEF_HELPER_5(xsmaxjdp, void, env, i32, vsr, vsr, vsr)
276+-DEF_HELPER_5(xsminjdp, void, env, i32, vsr, vsr, vsr)
277++DEF_HELPER_4(xsmaxcdp, void, env, vsr, vsr, vsr)
278++DEF_HELPER_4(xsmincdp, void, env, vsr, vsr, vsr)
279++DEF_HELPER_4(xsmaxjdp, void, env, vsr, vsr, vsr)
280++DEF_HELPER_4(xsminjdp, void, env, vsr, vsr, vsr)
281+ DEF_HELPER_3(xscvdphp, void, env, vsr, vsr)
282+ DEF_HELPER_4(xscvdpqp, void, env, i32, vsr, vsr)
283+ DEF_HELPER_3(xscvdpsp, void, env, vsr, vsr)
284+diff --git a/target/ppc/translate/vsx-impl.c.inc b/target/ppc/translate/vsx-impl.c.inc
285+index c0e38060b45..02df75339ed 100644
286+--- a/target/ppc/translate/vsx-impl.c.inc
287++++ b/target/ppc/translate/vsx-impl.c.inc
288+@@ -1098,10 +1098,10 @@ GEN_VSX_HELPER_R2_AB(xscmpoqp, 0x04, 0x04, 0, PPC2_VSX)
289+ GEN_VSX_HELPER_R2_AB(xscmpuqp, 0x04, 0x14, 0, PPC2_VSX)
290+ GEN_VSX_HELPER_X3(xsmaxdp, 0x00, 0x14, 0, PPC2_VSX)
291+ GEN_VSX_HELPER_X3(xsmindp, 0x00, 0x15, 0, PPC2_VSX)
292+-GEN_VSX_HELPER_R3(xsmaxcdp, 0x00, 0x10, 0, PPC2_ISA300)
293+-GEN_VSX_HELPER_R3(xsmincdp, 0x00, 0x11, 0, PPC2_ISA300)
294+-GEN_VSX_HELPER_R3(xsmaxjdp, 0x00, 0x12, 0, PPC2_ISA300)
295+-GEN_VSX_HELPER_R3(xsminjdp, 0x00, 0x12, 0, PPC2_ISA300)
296++GEN_VSX_HELPER_X3(xsmaxcdp, 0x00, 0x10, 0, PPC2_ISA300)
297++GEN_VSX_HELPER_X3(xsmincdp, 0x00, 0x11, 0, PPC2_ISA300)
298++GEN_VSX_HELPER_X3(xsmaxjdp, 0x00, 0x12, 0, PPC2_ISA300)
299++GEN_VSX_HELPER_X3(xsminjdp, 0x00, 0x12, 0, PPC2_ISA300)
300+ GEN_VSX_HELPER_X2(xscvdphp, 0x16, 0x15, 0x11, PPC2_ISA300)
301+ GEN_VSX_HELPER_X2(xscvdpsp, 0x12, 0x10, 0, PPC2_VSX)
302+ GEN_VSX_HELPER_R2(xscvdpqp, 0x04, 0x1A, 0x16, PPC2_ISA300)
303+--
304+2.40.0
305+

Subscribers

People subscribed via source and target branches