diff options
-rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/0001-target-i386-fix-avx2-instructions-vzeroall-and-vperm.patch | 58 |
2 files changed, 59 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index a7f1099dd5..80b5d966e4 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
@@ -43,6 +43,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
43 | file://CVE-2023-3354.patch \ | 43 | file://CVE-2023-3354.patch \ |
44 | file://CVE-2023-3180.patch \ | 44 | file://CVE-2023-3180.patch \ |
45 | file://CVE-2023-42467.patch \ | 45 | file://CVE-2023-42467.patch \ |
46 | file://0001-target-i386-fix-avx2-instructions-vzeroall-and-vperm.patch \ | ||
46 | " | 47 | " |
47 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 48 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
48 | 49 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/0001-target-i386-fix-avx2-instructions-vzeroall-and-vperm.patch b/meta/recipes-devtools/qemu/qemu/0001-target-i386-fix-avx2-instructions-vzeroall-and-vperm.patch new file mode 100644 index 0000000000..a687862445 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/0001-target-i386-fix-avx2-instructions-vzeroall-and-vperm.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | From 06690248bdb917f71b673183de9334c92f4a1eaa Mon Sep 17 00:00:00 2001 | ||
2 | From: Xinyu Li <lixinyu20s@ict.ac.cn> | ||
3 | Date: Wed, 10 May 2023 22:52:22 +0800 | ||
4 | Subject: [PATCH] target/i386: fix avx2 instructions vzeroall and vpermdq | ||
5 | |||
6 | vzeroall: xmm_regs should be used instead of xmm_t0 | ||
7 | vpermdq: bit 3 and 7 of imm should be considered | ||
8 | |||
9 | Upstream-Status: Backport from | ||
10 | [https://gitlab.com/qemu-project/qemu/-/commit/48b60eb6c917646df9efa7ddb4c25929f358d647] | ||
11 | |||
12 | Signed-off-by: Xinyu Li <lixinyu20s@ict.ac.cn> | ||
13 | Message-Id: <20230510145222.586487-1-lixinyu20s@ict.ac.cn> | ||
14 | Cc: qemu-stable@nongnu.org | ||
15 | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> | ||
16 | (cherry picked from commit 056d649007bc9fdae9f1d576e77c1316e9a34468) | ||
17 | Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> | ||
18 | Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com> | ||
19 | --- | ||
20 | target/i386/ops_sse.h | 8 ++++++++ | ||
21 | target/i386/tcg/emit.c.inc | 2 +- | ||
22 | 2 files changed, 9 insertions(+), 1 deletion(-) | ||
23 | |||
24 | diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h | ||
25 | index 3cbc36a59d..44c1e70093 100644 | ||
26 | --- a/target/i386/ops_sse.h | ||
27 | +++ b/target/i386/ops_sse.h | ||
28 | @@ -2493,6 +2493,14 @@ void helper_vpermdq_ymm(Reg *d, Reg *v, Reg *s, uint32_t order) | ||
29 | d->Q(1) = r1; | ||
30 | d->Q(2) = r2; | ||
31 | d->Q(3) = r3; | ||
32 | + if (order & 0x8) { | ||
33 | + d->Q(0) = 0; | ||
34 | + d->Q(1) = 0; | ||
35 | + } | ||
36 | + if (order & 0x80) { | ||
37 | + d->Q(2) = 0; | ||
38 | + d->Q(3) = 0; | ||
39 | + } | ||
40 | } | ||
41 | |||
42 | void helper_vpermq_ymm(Reg *d, Reg *s, uint32_t order) | ||
43 | diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc | ||
44 | index 7037ff91c6..34028a7475 100644 | ||
45 | --- a/target/i386/tcg/emit.c.inc | ||
46 | +++ b/target/i386/tcg/emit.c.inc | ||
47 | @@ -2283,7 +2283,7 @@ static void gen_VZEROALL(DisasContext *s, CPUX86State *env, X86DecodedInsn *deco | ||
48 | { | ||
49 | TCGv_ptr ptr = tcg_temp_new_ptr(); | ||
50 | |||
51 | - tcg_gen_addi_ptr(ptr, cpu_env, offsetof(CPUX86State, xmm_t0)); | ||
52 | + tcg_gen_addi_ptr(ptr, cpu_env, offsetof(CPUX86State, xmm_regs)); | ||
53 | gen_helper_memset(ptr, ptr, tcg_constant_i32(0), | ||
54 | tcg_constant_ptr(CPU_NB_REGS * sizeof(ZMMReg))); | ||
55 | tcg_temp_free_ptr(ptr); | ||
56 | -- | ||
57 | 2.25.1 | ||
58 | |||