1 | The following changes since commit 67e41fe0cfb62e6cdfa659f0155417d17e5274ea: | 1 | v2: Drop a few patches, which showed regressions in CI |
---|---|---|---|
2 | for jobs that are not run for forks. :-/ | ||
2 | 3 | ||
3 | Merge tag 'pull-ppc-20220104' of https://github.com/legoater/qemu into staging (2022-01-04 07:23:27 -0800) | 4 | |
5 | r~ | ||
6 | |||
7 | |||
8 | The following changes since commit f9d58e0ca53b3f470b84725a7b5e47fcf446a2ea: | ||
9 | |||
10 | Merge tag 'pull-9p-20230516' of https://github.com/cschoenebeck/qemu into staging (2023-05-16 10:21:44 -0700) | ||
4 | 11 | ||
5 | are available in the Git repository at: | 12 | are available in the Git repository at: |
6 | 13 | ||
7 | https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20220104 | 14 | https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20230516-2 |
8 | 15 | ||
9 | for you to fetch changes up to d7478d4229f0a2b2817a55487e6b17081099fae4: | 16 | for you to fetch changes up to 44fe8f47fce3bdc8dcf49e3f001519a375ecc88a: |
10 | 17 | ||
11 | common-user: Fix tail calls to safe_syscall_set_errno_tail (2022-01-04 15:41:03 -0800) | 18 | tcg: Split out exec/user/guest-base.h (2023-05-16 16:31:05 -0700) |
12 | 19 | ||
13 | ---------------------------------------------------------------- | 20 | ---------------------------------------------------------------- |
14 | Fix for safe_syscall_base. | 21 | tcg/i386: Fix tcg_out_addi_ptr for win64 |
15 | Fix for folding of vector add/sub. | 22 | tcg: Implement atomicity for TCGv_i128 |
16 | Fix build on loongarch64 with gcc 8. | 23 | tcg: First quarter of cleanups for building tcg once |
17 | Remove decl for qemu_run_machine_init_done_notifiers. | ||
18 | 24 | ||
19 | ---------------------------------------------------------------- | 25 | ---------------------------------------------------------------- |
20 | Philippe Mathieu-Daudé (1): | 26 | Richard Henderson (74): |
21 | linux-user: Fix trivial build error on loongarch64 hosts | 27 | tcg/i386: Set P_REXW in tcg_out_addi_ptr |
28 | include/exec/memop: Add MO_ATOM_* | ||
29 | accel/tcg: Honor atomicity of loads | ||
30 | accel/tcg: Honor atomicity of stores | ||
31 | tcg: Unify helper_{be,le}_{ld,st}* | ||
32 | accel/tcg: Implement helper_{ld,st}*_mmu for user-only | ||
33 | tcg/tci: Use helper_{ld,st}*_mmu for user-only | ||
34 | tcg: Add 128-bit guest memory primitives | ||
35 | meson: Detect atomic128 support with optimization | ||
36 | tcg/i386: Add have_atomic16 | ||
37 | tcg/aarch64: Detect have_lse, have_lse2 for linux | ||
38 | tcg/aarch64: Detect have_lse, have_lse2 for darwin | ||
39 | tcg/i386: Use full load/store helpers in user-only mode | ||
40 | tcg/aarch64: Use full load/store helpers in user-only mode | ||
41 | tcg/ppc: Use full load/store helpers in user-only mode | ||
42 | tcg/loongarch64: Use full load/store helpers in user-only mode | ||
43 | tcg/riscv: Use full load/store helpers in user-only mode | ||
44 | tcg/arm: Adjust constraints on qemu_ld/st | ||
45 | tcg/arm: Use full load/store helpers in user-only mode | ||
46 | tcg/mips: Use full load/store helpers in user-only mode | ||
47 | tcg/s390x: Use full load/store helpers in user-only mode | ||
48 | tcg/sparc64: Allocate %g2 as a third temporary | ||
49 | tcg/sparc64: Rename tcg_out_movi_imm13 to tcg_out_movi_s13 | ||
50 | target/sparc64: Remove tcg_out_movi_s13 case from tcg_out_movi_imm32 | ||
51 | tcg/sparc64: Rename tcg_out_movi_imm32 to tcg_out_movi_u32 | ||
52 | tcg/sparc64: Split out tcg_out_movi_s32 | ||
53 | tcg/sparc64: Use standard slow path for softmmu | ||
54 | accel/tcg: Remove helper_unaligned_{ld,st} | ||
55 | tcg/loongarch64: Check the host supports unaligned accesses | ||
56 | tcg/loongarch64: Support softmmu unaligned accesses | ||
57 | tcg/riscv: Support softmmu unaligned accesses | ||
58 | tcg: Introduce tcg_target_has_memory_bswap | ||
59 | tcg: Add INDEX_op_qemu_{ld,st}_i128 | ||
60 | tcg: Introduce tcg_out_movext3 | ||
61 | tcg: Merge tcg_out_helper_load_regs into caller | ||
62 | tcg: Support TCG_TYPE_I128 in tcg_out_{ld,st}_helper_{args,ret} | ||
63 | tcg: Introduce atom_and_align_for_opc | ||
64 | tcg/i386: Use atom_and_align_for_opc | ||
65 | tcg/aarch64: Use atom_and_align_for_opc | ||
66 | tcg/arm: Use atom_and_align_for_opc | ||
67 | tcg/loongarch64: Use atom_and_align_for_opc | ||
68 | tcg/mips: Use atom_and_align_for_opc | ||
69 | tcg/ppc: Use atom_and_align_for_opc | ||
70 | tcg/riscv: Use atom_and_align_for_opc | ||
71 | tcg/s390x: Use atom_and_align_for_opc | ||
72 | tcg/sparc64: Use atom_and_align_for_opc | ||
73 | tcg: Split out memory ops to tcg-op-ldst.c | ||
74 | tcg: Widen gen_insn_data to uint64_t | ||
75 | accel/tcg: Widen tcg-ldst.h addresses to uint64_t | ||
76 | tcg: Widen helper_{ld,st}_i128 addresses to uint64_t | ||
77 | tcg: Widen helper_atomic_* addresses to uint64_t | ||
78 | tcg: Widen tcg_gen_code pc_start argument to uint64_t | ||
79 | accel/tcg: Merge gen_mem_wrapped with plugin_gen_empty_mem_callback | ||
80 | accel/tcg: Merge do_gen_mem_cb into caller | ||
81 | tcg: Reduce copies for plugin_gen_mem_callbacks | ||
82 | accel/tcg: Widen plugin_gen_empty_mem_callback to i64 | ||
83 | tcg: Add addr_type to TCGContext | ||
84 | tcg: Remove TCGv from tcg_gen_qemu_{ld,st}_* | ||
85 | tcg: Remove TCGv from tcg_gen_atomic_* | ||
86 | tcg: Split INDEX_op_qemu_{ld,st}* for guest address size | ||
87 | tcg/tci: Elimnate TARGET_LONG_BITS, target_ulong | ||
88 | tcg/i386: Always enable TCG_TARGET_HAS_extr[lh]_i64_i32 | ||
89 | tcg/i386: Conditionalize tcg_out_extu_i32_i64 | ||
90 | tcg/i386: Adjust type of tlb_mask | ||
91 | tcg/i386: Remove TARGET_LONG_BITS, TCG_TYPE_TL | ||
92 | tcg/arm: Remove TARGET_LONG_BITS | ||
93 | tcg/aarch64: Remove USE_GUEST_BASE | ||
94 | tcg/aarch64: Remove TARGET_LONG_BITS, TCG_TYPE_TL | ||
95 | tcg/loongarch64: Remove TARGET_LONG_BITS, TCG_TYPE_TL | ||
96 | tcg/mips: Remove TARGET_LONG_BITS, TCG_TYPE_TL | ||
97 | tcg: Remove TARGET_LONG_BITS, TCG_TYPE_TL | ||
98 | tcg: Add page_bits and page_mask to TCGContext | ||
99 | tcg: Add tlb_dyn_max_bits to TCGContext | ||
100 | tcg: Split out exec/user/guest-base.h | ||
22 | 101 | ||
23 | Richard Henderson (2): | 102 | docs/devel/loads-stores.rst | 36 +- |
24 | tcg/optimize: Fix folding of vector ops | 103 | docs/devel/tcg-ops.rst | 11 +- |
25 | common-user: Fix tail calls to safe_syscall_set_errno_tail | 104 | meson.build | 52 +- |
26 | 105 | accel/tcg/tcg-runtime.h | 49 +- | |
27 | Xiaoyao Li (1): | 106 | include/exec/cpu-all.h | 5 +- |
28 | sysemu: Cleanup qemu_run_machine_init_done_notifiers() | 107 | include/exec/memop.h | 37 ++ |
29 | 108 | include/exec/plugin-gen.h | 4 +- | |
30 | include/sysemu/sysemu.h | 1 - | 109 | include/exec/user/guest-base.h | 12 + |
31 | linux-user/host/loongarch64/host-signal.h | 4 +-- | 110 | include/qemu/cpuid.h | 18 + |
32 | tcg/optimize.c | 49 +++++++++++++++++++++++------- | 111 | include/tcg/tcg-ldst.h | 72 +-- |
33 | common-user/host/i386/safe-syscall.inc.S | 1 + | 112 | include/tcg/tcg-op.h | 273 ++++++--- |
34 | common-user/host/mips/safe-syscall.inc.S | 1 + | 113 | include/tcg/tcg-opc.h | 41 +- |
35 | common-user/host/x86_64/safe-syscall.inc.S | 1 + | 114 | include/tcg/tcg.h | 39 +- |
36 | 6 files changed, 42 insertions(+), 15 deletions(-) | 115 | tcg/aarch64/tcg-target.h | 6 +- |
37 | 116 | tcg/arm/tcg-target-con-set.h | 16 +- | |
117 | tcg/arm/tcg-target-con-str.h | 5 +- | ||
118 | tcg/arm/tcg-target.h | 3 +- | ||
119 | tcg/i386/tcg-target.h | 12 +- | ||
120 | tcg/loongarch64/tcg-target.h | 3 +- | ||
121 | tcg/mips/tcg-target.h | 4 +- | ||
122 | tcg/ppc/tcg-target.h | 3 +- | ||
123 | tcg/riscv/tcg-target.h | 4 +- | ||
124 | tcg/s390x/tcg-target.h | 4 +- | ||
125 | tcg/sparc64/tcg-target-con-set.h | 2 - | ||
126 | tcg/sparc64/tcg-target-con-str.h | 1 - | ||
127 | tcg/sparc64/tcg-target.h | 4 +- | ||
128 | tcg/tcg-internal.h | 2 + | ||
129 | tcg/tci/tcg-target.h | 4 +- | ||
130 | accel/tcg/cputlb.c | 839 ++++++++++++++++--------- | ||
131 | accel/tcg/plugin-gen.c | 68 +- | ||
132 | accel/tcg/translate-all.c | 35 +- | ||
133 | accel/tcg/user-exec.c | 488 ++++++++++----- | ||
134 | tcg/optimize.c | 19 +- | ||
135 | tcg/tcg-op-ldst.c | 1234 +++++++++++++++++++++++++++++++++++++ | ||
136 | tcg/tcg-op.c | 864 -------------------------- | ||
137 | tcg/tcg.c | 631 +++++++++++++++---- | ||
138 | tcg/tci.c | 243 +++----- | ||
139 | accel/tcg/atomic_common.c.inc | 14 +- | ||
140 | accel/tcg/ldst_atomicity.c.inc | 1262 ++++++++++++++++++++++++++++++++++++++ | ||
141 | tcg/aarch64/tcg-target.c.inc | 207 +++---- | ||
142 | tcg/arm/tcg-target.c.inc | 246 +++----- | ||
143 | tcg/i386/tcg-target.c.inc | 240 ++++---- | ||
144 | tcg/loongarch64/tcg-target.c.inc | 123 ++-- | ||
145 | tcg/mips/tcg-target.c.inc | 216 +++---- | ||
146 | tcg/ppc/tcg-target.c.inc | 189 +++--- | ||
147 | tcg/riscv/tcg-target.c.inc | 161 ++--- | ||
148 | tcg/s390x/tcg-target.c.inc | 104 +--- | ||
149 | tcg/sparc64/tcg-target.c.inc | 731 ++++++++-------------- | ||
150 | tcg/tci/tcg-target.c.inc | 58 +- | ||
151 | tcg/meson.build | 1 + | ||
152 | 50 files changed, 5345 insertions(+), 3350 deletions(-) | ||
153 | create mode 100644 include/exec/user/guest-base.h | ||
154 | create mode 100644 tcg/tcg-op-ldst.c | ||
155 | create mode 100644 accel/tcg/ldst_atomicity.c.inc | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Bitwise operations are easy to fold, because the operation is | ||
2 | identical regardless of element size. But add and sub need | ||
3 | extra element size info that is not currently propagated. | ||
4 | 1 | ||
5 | Fixes: 2f9f08ba43d | ||
6 | Cc: qemu-stable@nongnu.org | ||
7 | Resolves: https://gitlab.com/qemu-project/qemu/-/issues/799 | ||
8 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
9 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
10 | --- | ||
11 | tcg/optimize.c | 49 ++++++++++++++++++++++++++++++++++++++----------- | ||
12 | 1 file changed, 38 insertions(+), 11 deletions(-) | ||
13 | |||
14 | diff --git a/tcg/optimize.c b/tcg/optimize.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/tcg/optimize.c | ||
17 | +++ b/tcg/optimize.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static uint64_t do_constant_folding_2(TCGOpcode op, uint64_t x, uint64_t y) | ||
19 | CASE_OP_32_64(mul): | ||
20 | return x * y; | ||
21 | |||
22 | - CASE_OP_32_64(and): | ||
23 | + CASE_OP_32_64_VEC(and): | ||
24 | return x & y; | ||
25 | |||
26 | - CASE_OP_32_64(or): | ||
27 | + CASE_OP_32_64_VEC(or): | ||
28 | return x | y; | ||
29 | |||
30 | - CASE_OP_32_64(xor): | ||
31 | + CASE_OP_32_64_VEC(xor): | ||
32 | return x ^ y; | ||
33 | |||
34 | case INDEX_op_shl_i32: | ||
35 | @@ -XXX,XX +XXX,XX @@ static uint64_t do_constant_folding_2(TCGOpcode op, uint64_t x, uint64_t y) | ||
36 | case INDEX_op_rotl_i64: | ||
37 | return rol64(x, y & 63); | ||
38 | |||
39 | - CASE_OP_32_64(not): | ||
40 | + CASE_OP_32_64_VEC(not): | ||
41 | return ~x; | ||
42 | |||
43 | CASE_OP_32_64(neg): | ||
44 | return -x; | ||
45 | |||
46 | - CASE_OP_32_64(andc): | ||
47 | + CASE_OP_32_64_VEC(andc): | ||
48 | return x & ~y; | ||
49 | |||
50 | - CASE_OP_32_64(orc): | ||
51 | + CASE_OP_32_64_VEC(orc): | ||
52 | return x | ~y; | ||
53 | |||
54 | CASE_OP_32_64(eqv): | ||
55 | @@ -XXX,XX +XXX,XX @@ static bool fold_const2(OptContext *ctx, TCGOp *op) | ||
56 | return false; | ||
57 | } | ||
58 | |||
59 | +static bool fold_commutative(OptContext *ctx, TCGOp *op) | ||
60 | +{ | ||
61 | + swap_commutative(op->args[0], &op->args[1], &op->args[2]); | ||
62 | + return false; | ||
63 | +} | ||
64 | + | ||
65 | static bool fold_const2_commutative(OptContext *ctx, TCGOp *op) | ||
66 | { | ||
67 | swap_commutative(op->args[0], &op->args[1], &op->args[2]); | ||
68 | @@ -XXX,XX +XXX,XX @@ static bool fold_add(OptContext *ctx, TCGOp *op) | ||
69 | return false; | ||
70 | } | ||
71 | |||
72 | +/* We cannot as yet do_constant_folding with vectors. */ | ||
73 | +static bool fold_add_vec(OptContext *ctx, TCGOp *op) | ||
74 | +{ | ||
75 | + if (fold_commutative(ctx, op) || | ||
76 | + fold_xi_to_x(ctx, op, 0)) { | ||
77 | + return true; | ||
78 | + } | ||
79 | + return false; | ||
80 | +} | ||
81 | + | ||
82 | static bool fold_addsub2(OptContext *ctx, TCGOp *op, bool add) | ||
83 | { | ||
84 | if (arg_is_const(op->args[2]) && arg_is_const(op->args[3]) && | ||
85 | @@ -XXX,XX +XXX,XX @@ static bool fold_sub_to_neg(OptContext *ctx, TCGOp *op) | ||
86 | return false; | ||
87 | } | ||
88 | |||
89 | -static bool fold_sub(OptContext *ctx, TCGOp *op) | ||
90 | +/* We cannot as yet do_constant_folding with vectors. */ | ||
91 | +static bool fold_sub_vec(OptContext *ctx, TCGOp *op) | ||
92 | { | ||
93 | - if (fold_const2(ctx, op) || | ||
94 | - fold_xx_to_i(ctx, op, 0) || | ||
95 | + if (fold_xx_to_i(ctx, op, 0) || | ||
96 | fold_xi_to_x(ctx, op, 0) || | ||
97 | fold_sub_to_neg(ctx, op)) { | ||
98 | return true; | ||
99 | @@ -XXX,XX +XXX,XX @@ static bool fold_sub(OptContext *ctx, TCGOp *op) | ||
100 | return false; | ||
101 | } | ||
102 | |||
103 | +static bool fold_sub(OptContext *ctx, TCGOp *op) | ||
104 | +{ | ||
105 | + return fold_const2(ctx, op) || fold_sub_vec(ctx, op); | ||
106 | +} | ||
107 | + | ||
108 | static bool fold_sub2(OptContext *ctx, TCGOp *op) | ||
109 | { | ||
110 | return fold_addsub2(ctx, op, false); | ||
111 | @@ -XXX,XX +XXX,XX @@ void tcg_optimize(TCGContext *s) | ||
112 | * Sorted alphabetically by opcode as much as possible. | ||
113 | */ | ||
114 | switch (opc) { | ||
115 | - CASE_OP_32_64_VEC(add): | ||
116 | + CASE_OP_32_64(add): | ||
117 | done = fold_add(&ctx, op); | ||
118 | break; | ||
119 | + case INDEX_op_add_vec: | ||
120 | + done = fold_add_vec(&ctx, op); | ||
121 | + break; | ||
122 | CASE_OP_32_64(add2): | ||
123 | done = fold_add2(&ctx, op); | ||
124 | break; | ||
125 | @@ -XXX,XX +XXX,XX @@ void tcg_optimize(TCGContext *s) | ||
126 | CASE_OP_32_64(sextract): | ||
127 | done = fold_sextract(&ctx, op); | ||
128 | break; | ||
129 | - CASE_OP_32_64_VEC(sub): | ||
130 | + CASE_OP_32_64(sub): | ||
131 | done = fold_sub(&ctx, op); | ||
132 | break; | ||
133 | + case INDEX_op_sub_vec: | ||
134 | + done = fold_sub_vec(&ctx, op); | ||
135 | + break; | ||
136 | CASE_OP_32_64(sub2): | ||
137 | done = fold_sub2(&ctx, op); | ||
138 | break; | ||
139 | -- | ||
140 | 2.25.1 | ||
141 | |||
142 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
2 | 1 | ||
3 | When building using GCC 8.3.0 on loongarch64 (Loongnix) we get: | ||
4 | |||
5 | In file included from ../linux-user/signal.c:33: | ||
6 | ../linux-user/host/loongarch64/host-signal.h: In function ‘host_signal_write’: | ||
7 | ../linux-user/host/loongarch64/host-signal.h:57:9: error: a label can only be part of a statement and a declaration is not a statement | ||
8 | uint32_t sel = (insn >> 15) & 0b11111111111; | ||
9 | ^~~~~~~~ | ||
10 | |||
11 | We don't use the 'sel' variable more than once, so drop it. | ||
12 | |||
13 | Meson output for the record: | ||
14 | |||
15 | Host machine cpu family: loongarch64 | ||
16 | Host machine cpu: loongarch64 | ||
17 | C compiler for the host machine: cc (gcc 8.3.0 "cc (Loongnix 8.3.0-6.lnd.vec.27) 8.3.0") | ||
18 | C linker for the host machine: cc ld.bfd 2.31.1-system | ||
19 | |||
20 | Fixes: ad812c3bd65 ("linux-user: Implement CPU-specific signal handler for loongarch64 hosts") | ||
21 | Reported-by: Song Gao <gaosong@loongson.cn> | ||
22 | Suggested-by: Song Gao <gaosong@loongson.cn> | ||
23 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
24 | Reviewed-by: WANG Xuerui <git@xen0n.name> | ||
25 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
26 | Message-Id: <20220104215027.2180972-1-f4bug@amsat.org> | ||
27 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
28 | --- | ||
29 | linux-user/host/loongarch64/host-signal.h | 4 +--- | ||
30 | 1 file changed, 1 insertion(+), 3 deletions(-) | ||
31 | |||
32 | diff --git a/linux-user/host/loongarch64/host-signal.h b/linux-user/host/loongarch64/host-signal.h | ||
33 | index XXXXXXX..XXXXXXX 100644 | ||
34 | --- a/linux-user/host/loongarch64/host-signal.h | ||
35 | +++ b/linux-user/host/loongarch64/host-signal.h | ||
36 | @@ -XXX,XX +XXX,XX @@ static inline bool host_signal_write(siginfo_t *info, ucontext_t *uc) | ||
37 | } | ||
38 | break; | ||
39 | case 0b001110: /* indexed, atomic, bounds-checking memory operations */ | ||
40 | - uint32_t sel = (insn >> 15) & 0b11111111111; | ||
41 | - | ||
42 | - switch (sel) { | ||
43 | + switch ((insn >> 15) & 0b11111111111) { | ||
44 | case 0b00000100000: /* stx.b */ | ||
45 | case 0b00000101000: /* stx.h */ | ||
46 | case 0b00000110000: /* stx.w */ | ||
47 | -- | ||
48 | 2.25.1 | ||
49 | |||
50 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Xiaoyao Li <xiaoyao.li@intel.com> | ||
2 | 1 | ||
3 | Remove qemu_run_machine_init_done_notifiers() since no implementation | ||
4 | and user. | ||
5 | |||
6 | Fixes: f66dc8737c9 ("vl: move all generic initialization out of vl.c") | ||
7 | Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com> | ||
8 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
9 | Message-Id: <20220104024136.1433545-1-xiaoyao.li@intel.com> | ||
10 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
11 | --- | ||
12 | include/sysemu/sysemu.h | 1 - | ||
13 | 1 file changed, 1 deletion(-) | ||
14 | |||
15 | diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/include/sysemu/sysemu.h | ||
18 | +++ b/include/sysemu/sysemu.h | ||
19 | @@ -XXX,XX +XXX,XX @@ extern bool qemu_uuid_set; | ||
20 | void qemu_add_exit_notifier(Notifier *notify); | ||
21 | void qemu_remove_exit_notifier(Notifier *notify); | ||
22 | |||
23 | -void qemu_run_machine_init_done_notifiers(void); | ||
24 | void qemu_add_machine_init_done_notifier(Notifier *notify); | ||
25 | void qemu_remove_machine_init_done_notifier(Notifier *notify); | ||
26 | |||
27 | -- | ||
28 | 2.25.1 | ||
29 | |||
30 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | For the ABIs in which the syscall return register is not | ||
2 | also the first function argument register, move the errno | ||
3 | value into the correct place. | ||
4 | 1 | ||
5 | Fixes: a3310c0397e2 ("linux-user: Move syscall error detection into safe_syscall_base") | ||
6 | Reported-by: Laurent Vivier <laurent@vivier.eu> | ||
7 | Tested-by: Laurent Vivier <laurent@vivier.eu> | ||
8 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
9 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
10 | Message-Id: <20220104190454.542225-1-richard.henderson@linaro.org> | ||
11 | --- | ||
12 | common-user/host/i386/safe-syscall.inc.S | 1 + | ||
13 | common-user/host/mips/safe-syscall.inc.S | 1 + | ||
14 | common-user/host/x86_64/safe-syscall.inc.S | 1 + | ||
15 | 3 files changed, 3 insertions(+) | ||
16 | |||
17 | diff --git a/common-user/host/i386/safe-syscall.inc.S b/common-user/host/i386/safe-syscall.inc.S | ||
18 | index XXXXXXX..XXXXXXX 100644 | ||
19 | --- a/common-user/host/i386/safe-syscall.inc.S | ||
20 | +++ b/common-user/host/i386/safe-syscall.inc.S | ||
21 | @@ -XXX,XX +XXX,XX @@ safe_syscall_end: | ||
22 | pop %ebp | ||
23 | .cfi_adjust_cfa_offset -4 | ||
24 | .cfi_restore ebp | ||
25 | + mov %eax, (%esp) | ||
26 | jmp safe_syscall_set_errno_tail | ||
27 | |||
28 | .cfi_endproc | ||
29 | diff --git a/common-user/host/mips/safe-syscall.inc.S b/common-user/host/mips/safe-syscall.inc.S | ||
30 | index XXXXXXX..XXXXXXX 100644 | ||
31 | --- a/common-user/host/mips/safe-syscall.inc.S | ||
32 | +++ b/common-user/host/mips/safe-syscall.inc.S | ||
33 | @@ -XXX,XX +XXX,XX @@ safe_syscall_end: | ||
34 | 1: USE_ALT_CP(t0) | ||
35 | SETUP_GPX(t1) | ||
36 | SETUP_GPX64(t0, t1) | ||
37 | + move a0, v0 | ||
38 | PTR_LA t9, safe_syscall_set_errno_tail | ||
39 | jr t9 | ||
40 | |||
41 | diff --git a/common-user/host/x86_64/safe-syscall.inc.S b/common-user/host/x86_64/safe-syscall.inc.S | ||
42 | index XXXXXXX..XXXXXXX 100644 | ||
43 | --- a/common-user/host/x86_64/safe-syscall.inc.S | ||
44 | +++ b/common-user/host/x86_64/safe-syscall.inc.S | ||
45 | @@ -XXX,XX +XXX,XX @@ safe_syscall_end: | ||
46 | 1: pop %rbp | ||
47 | .cfi_def_cfa_offset 8 | ||
48 | .cfi_restore rbp | ||
49 | + mov %eax, %edi | ||
50 | jmp safe_syscall_set_errno_tail | ||
51 | .cfi_endproc | ||
52 | |||
53 | -- | ||
54 | 2.25.1 | ||
55 | |||
56 | diff view generated by jsdifflib |