1 | The following changes since commit c4e42a9c2b714de5cddabffe46c7789fcff49c30: | 1 | v3: One more try to fix macos issues. |
---|---|---|---|
2 | 2 | ||
3 | Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20190701' into staging (2019-07-02 12:58:32 +0100) | 3 | |
4 | r~ | ||
5 | |||
6 | |||
7 | |||
8 | The following changes since commit e0209297cddd5e10a07e15fac5cca7aa1a8e0e59: | ||
9 | |||
10 | Merge tag 'pull-ufs-20250217' of https://gitlab.com/jeuk20.kim/qemu into staging (2025-02-18 10:58:48 +0800) | ||
4 | 11 | ||
5 | are available in the Git repository at: | 12 | are available in the Git repository at: |
6 | 13 | ||
7 | https://github.com/rth7680/qemu.git tags/pull-tcg-20190702 | 14 | https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20250215-3 |
8 | 15 | ||
9 | for you to fetch changes up to 0c3c385c62759e1427f88c5fc5b0d9741a456807: | 16 | for you to fetch changes up to e726f65867087d86436de05e9f372a86ec1381a6: |
10 | 17 | ||
11 | tcg: Fix expansion of INDEX_op_not_vec (2019-07-02 15:59:42 +0200) | 18 | tcg: Remove TCG_TARGET_HAS_{br,set}cond2 from riscv and loongarch64 (2025-02-18 08:29:03 -0800) |
12 | 19 | ||
13 | ---------------------------------------------------------------- | 20 | ---------------------------------------------------------------- |
14 | Queued tcg bug fixes | 21 | tcg: Remove last traces of TCG_TARGET_NEED_POOL_LABELS |
22 | tcg: Cleanups after disallowing 64-on-32 | ||
23 | tcg: Introduce constraint for zero register | ||
24 | tcg: Remove TCG_TARGET_HAS_{br,set}cond2 from riscv and loongarch64 | ||
25 | tcg/i386: Use tcg_{high,unsigned}_cond in tcg_out_brcond2 | ||
26 | linux-user: Move TARGET_SA_RESTORER out of generic/signal.h | ||
27 | linux-user: Fix alignment when unmapping excess reservation | ||
28 | target/sparc: Fix register selection for all F*TOx and FxTO* instructions | ||
29 | target/sparc: Fix gdbstub incorrectly handling registers f32-f62 | ||
30 | target/sparc: fake UltraSPARC T1 PCR and PIC registers | ||
15 | 31 | ||
16 | ---------------------------------------------------------------- | 32 | ---------------------------------------------------------------- |
17 | Alistair Francis (1): | 33 | Andreas Schwab (1): |
18 | tcg/riscv: Fix RISC-VH host build failure | 34 | linux-user: Move TARGET_SA_RESTORER out of generic/signal.h |
19 | 35 | ||
20 | Richard Henderson (2): | 36 | Artyom Tarasenko (1): |
21 | tcg: Fix mmap lock assert on translation failure | 37 | target/sparc: fake UltraSPARC T1 PCR and PIC registers |
22 | tcg: Fix expansion of INDEX_op_not_vec | ||
23 | 38 | ||
24 | include/exec/cpu-all.h | 1 + | 39 | Fabiano Rosas (1): |
25 | include/exec/cpu_ldst_useronly_template.h | 8 ++++++-- | 40 | elfload: Fix alignment when unmapping excess reservation |
26 | accel/tcg/translate-all.c | 29 +++++++++++++++++++++++++++++ | ||
27 | tcg/riscv/tcg-target.inc.c | 4 ++-- | ||
28 | tcg/tcg-op-vec.c | 6 ++++++ | ||
29 | 5 files changed, 44 insertions(+), 4 deletions(-) | ||
30 | 41 | ||
42 | Mikael Szreder (2): | ||
43 | target/sparc: Fix register selection for all F*TOx and FxTO* instructions | ||
44 | target/sparc: Fix gdbstub incorrectly handling registers f32-f62 | ||
45 | |||
46 | Richard Henderson (23): | ||
47 | tcg: Remove last traces of TCG_TARGET_NEED_POOL_LABELS | ||
48 | tcg: Remove TCG_OVERSIZED_GUEST | ||
49 | tcg: Drop support for two address registers in gen_ldst | ||
50 | tcg: Merge INDEX_op_qemu_*_{a32,a64}_* | ||
51 | tcg/arm: Drop addrhi from prepare_host_addr | ||
52 | tcg/i386: Drop addrhi from prepare_host_addr | ||
53 | tcg/mips: Drop addrhi from prepare_host_addr | ||
54 | tcg/ppc: Drop addrhi from prepare_host_addr | ||
55 | tcg: Replace addr{lo,hi}_reg with addr_reg in TCGLabelQemuLdst | ||
56 | plugins: Fix qemu_plugin_read_memory_vaddr parameters | ||
57 | accel/tcg: Fix tlb_set_page_with_attrs, tlb_set_page | ||
58 | target/loongarch: Use VADDR_PRIx for logging pc_next | ||
59 | target/mips: Use VADDR_PRIx for logging pc_next | ||
60 | include/exec: Change vaddr to uintptr_t | ||
61 | include/exec: Use uintptr_t in CPUTLBEntry | ||
62 | tcg: Introduce the 'z' constraint for a hardware zero register | ||
63 | tcg/aarch64: Use 'z' constraint | ||
64 | tcg/loongarch64: Use 'z' constraint | ||
65 | tcg/mips: Use 'z' constraint | ||
66 | tcg/riscv: Use 'z' constraint | ||
67 | tcg/sparc64: Use 'z' constraint | ||
68 | tcg/i386: Use tcg_{high,unsigned}_cond in tcg_out_brcond2 | ||
69 | tcg: Remove TCG_TARGET_HAS_{br,set}cond2 from riscv and loongarch64 | ||
70 | |||
71 | include/exec/tlb-common.h | 10 +- | ||
72 | include/exec/vaddr.h | 16 +- | ||
73 | include/qemu/atomic.h | 18 +- | ||
74 | include/tcg/oversized-guest.h | 23 --- | ||
75 | include/tcg/tcg-opc.h | 28 +-- | ||
76 | include/tcg/tcg.h | 3 +- | ||
77 | linux-user/aarch64/target_signal.h | 2 + | ||
78 | linux-user/arm/target_signal.h | 2 + | ||
79 | linux-user/generic/signal.h | 1 - | ||
80 | linux-user/i386/target_signal.h | 2 + | ||
81 | linux-user/m68k/target_signal.h | 1 + | ||
82 | linux-user/microblaze/target_signal.h | 2 + | ||
83 | linux-user/ppc/target_signal.h | 2 + | ||
84 | linux-user/s390x/target_signal.h | 2 + | ||
85 | linux-user/sh4/target_signal.h | 2 + | ||
86 | linux-user/x86_64/target_signal.h | 2 + | ||
87 | linux-user/xtensa/target_signal.h | 2 + | ||
88 | tcg/aarch64/tcg-target-con-set.h | 12 +- | ||
89 | tcg/aarch64/tcg-target.h | 2 + | ||
90 | tcg/loongarch64/tcg-target-con-set.h | 15 +- | ||
91 | tcg/loongarch64/tcg-target-con-str.h | 1 - | ||
92 | tcg/loongarch64/tcg-target-has.h | 2 - | ||
93 | tcg/loongarch64/tcg-target.h | 2 + | ||
94 | tcg/mips/tcg-target-con-set.h | 26 +-- | ||
95 | tcg/mips/tcg-target-con-str.h | 1 - | ||
96 | tcg/mips/tcg-target.h | 2 + | ||
97 | tcg/riscv/tcg-target-con-set.h | 10 +- | ||
98 | tcg/riscv/tcg-target-con-str.h | 1 - | ||
99 | tcg/riscv/tcg-target-has.h | 2 - | ||
100 | tcg/riscv/tcg-target.h | 2 + | ||
101 | tcg/sparc64/tcg-target-con-set.h | 12 +- | ||
102 | tcg/sparc64/tcg-target-con-str.h | 1 - | ||
103 | tcg/sparc64/tcg-target.h | 3 +- | ||
104 | tcg/tci/tcg-target.h | 1 - | ||
105 | accel/tcg/cputlb.c | 32 +--- | ||
106 | accel/tcg/tcg-all.c | 9 +- | ||
107 | linux-user/elfload.c | 4 +- | ||
108 | plugins/api.c | 2 +- | ||
109 | target/arm/ptw.c | 34 ---- | ||
110 | target/loongarch/tcg/translate.c | 2 +- | ||
111 | target/mips/tcg/octeon_translate.c | 4 +- | ||
112 | target/riscv/cpu_helper.c | 13 +- | ||
113 | target/sparc/gdbstub.c | 18 +- | ||
114 | target/sparc/translate.c | 19 +++ | ||
115 | tcg/optimize.c | 21 +-- | ||
116 | tcg/tcg-op-ldst.c | 103 +++-------- | ||
117 | tcg/tcg.c | 97 +++++------ | ||
118 | tcg/tci.c | 119 +++---------- | ||
119 | docs/devel/multi-thread-tcg.rst | 1 - | ||
120 | docs/devel/tcg-ops.rst | 4 +- | ||
121 | target/loongarch/tcg/insn_trans/trans_atomic.c.inc | 2 +- | ||
122 | target/sparc/insns.decode | 19 ++- | ||
123 | tcg/aarch64/tcg-target.c.inc | 86 ++++------ | ||
124 | tcg/arm/tcg-target.c.inc | 114 ++++--------- | ||
125 | tcg/i386/tcg-target.c.inc | 190 +++++---------------- | ||
126 | tcg/loongarch64/tcg-target.c.inc | 72 +++----- | ||
127 | tcg/mips/tcg-target.c.inc | 169 ++++++------------ | ||
128 | tcg/ppc/tcg-target.c.inc | 164 +++++------------- | ||
129 | tcg/riscv/tcg-target.c.inc | 56 +++--- | ||
130 | tcg/s390x/tcg-target.c.inc | 40 ++--- | ||
131 | tcg/sparc64/tcg-target.c.inc | 45 ++--- | ||
132 | tcg/tci/tcg-target.c.inc | 60 ++----- | ||
133 | 62 files changed, 550 insertions(+), 1162 deletions(-) | ||
134 | delete mode 100644 include/tcg/oversized-guest.h | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Check page flags before letting an invalid pc cause a SIGSEGV. | ||
2 | 1 | ||
3 | Prepare for eventially validating PROT_EXEC. The current wrinkle being | ||
4 | that we have a problem with our implementation of signals. We should | ||
5 | be using a vdso like the kernel, but we instead put the trampoline on | ||
6 | the stack. In the meantime, let PROT_READ match PROT_EXEC. | ||
7 | |||
8 | Fixes: https://bugs.launchpad.net/qemu/+bug/1832353 | ||
9 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
10 | --- | ||
11 | include/exec/cpu-all.h | 1 + | ||
12 | include/exec/cpu_ldst_useronly_template.h | 8 +++++-- | ||
13 | accel/tcg/translate-all.c | 29 +++++++++++++++++++++++ | ||
14 | 3 files changed, 36 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/include/exec/cpu-all.h | ||
19 | +++ b/include/exec/cpu-all.h | ||
20 | @@ -XXX,XX +XXX,XX @@ int walk_memory_regions(void *, walk_memory_regions_fn); | ||
21 | int page_get_flags(target_ulong address); | ||
22 | void page_set_flags(target_ulong start, target_ulong end, int flags); | ||
23 | int page_check_range(target_ulong start, target_ulong len, int flags); | ||
24 | +void validate_exec_access(CPUArchState *env, target_ulong s, target_ulong l); | ||
25 | #endif | ||
26 | |||
27 | CPUArchState *cpu_copy(CPUArchState *env); | ||
28 | diff --git a/include/exec/cpu_ldst_useronly_template.h b/include/exec/cpu_ldst_useronly_template.h | ||
29 | index XXXXXXX..XXXXXXX 100644 | ||
30 | --- a/include/exec/cpu_ldst_useronly_template.h | ||
31 | +++ b/include/exec/cpu_ldst_useronly_template.h | ||
32 | @@ -XXX,XX +XXX,XX @@ | ||
33 | static inline RES_TYPE | ||
34 | glue(glue(cpu_ld, USUFFIX), MEMSUFFIX)(CPUArchState *env, abi_ptr ptr) | ||
35 | { | ||
36 | -#if !defined(CODE_ACCESS) | ||
37 | +#ifdef CODE_ACCESS | ||
38 | + validate_exec_access(env, ptr, DATA_SIZE); | ||
39 | +#else | ||
40 | trace_guest_mem_before_exec( | ||
41 | env_cpu(env), ptr, | ||
42 | trace_mem_build_info(SHIFT, false, MO_TE, false)); | ||
43 | @@ -XXX,XX +XXX,XX @@ glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, | ||
44 | static inline int | ||
45 | glue(glue(cpu_lds, SUFFIX), MEMSUFFIX)(CPUArchState *env, abi_ptr ptr) | ||
46 | { | ||
47 | -#if !defined(CODE_ACCESS) | ||
48 | +#ifdef CODE_ACCESS | ||
49 | + validate_exec_access(env, ptr, DATA_SIZE); | ||
50 | +#else | ||
51 | trace_guest_mem_before_exec( | ||
52 | env_cpu(env), ptr, | ||
53 | trace_mem_build_info(SHIFT, true, MO_TE, false)); | ||
54 | diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c | ||
55 | index XXXXXXX..XXXXXXX 100644 | ||
56 | --- a/accel/tcg/translate-all.c | ||
57 | +++ b/accel/tcg/translate-all.c | ||
58 | @@ -XXX,XX +XXX,XX @@ int page_check_range(target_ulong start, target_ulong len, int flags) | ||
59 | } | ||
60 | } | ||
61 | } | ||
62 | + /* | ||
63 | + * FIXME: We place the signal trampoline on the stack, | ||
64 | + * even when the guest expects that to be in the vdso. | ||
65 | + * Until we fix that, allow execute on any readable page. | ||
66 | + */ | ||
67 | + if ((flags & PAGE_EXEC) && !(p->flags & (PAGE_EXEC | PAGE_READ))) { | ||
68 | + return -1; | ||
69 | + } | ||
70 | } | ||
71 | return 0; | ||
72 | } | ||
73 | |||
74 | +/* | ||
75 | + * Called for each code read, longjmp out to issue SIGSEGV if the page(s) | ||
76 | + * do not have execute access. | ||
77 | + */ | ||
78 | +void validate_exec_access(CPUArchState *env, | ||
79 | + target_ulong ptr, target_ulong len) | ||
80 | +{ | ||
81 | + if (page_check_range(ptr, len, PAGE_EXEC) < 0) { | ||
82 | + CPUState *cs = env_cpu(env); | ||
83 | + CPUClass *cc = CPU_GET_CLASS(cs); | ||
84 | + | ||
85 | + /* Like tb_gen_code, release the memory lock before cpu_loop_exit. */ | ||
86 | + assert_memory_lock(); | ||
87 | + mmap_unlock(); | ||
88 | + | ||
89 | + /* This is user-only. The target must raise an exception. */ | ||
90 | + cc->tlb_fill(cs, ptr, 0, MMU_INST_FETCH, MMU_USER_IDX, false, 0); | ||
91 | + g_assert_not_reached(); | ||
92 | + } | ||
93 | +} | ||
94 | + | ||
95 | /* called from signal handler: invalidate the code and unprotect the | ||
96 | * page. Return 0 if the fault was not handled, 1 if it was handled, | ||
97 | * and 2 if it was handled but the caller must cause the TB to be | ||
98 | -- | ||
99 | 2.17.1 | ||
100 | |||
101 | diff view generated by jsdifflib |
1 | From: Alistair Francis <alistair.francis@wdc.com> | 1 | DisasContextBase.pc_next has type vaddr; use the correct log format. |
---|---|---|---|
2 | 2 | ||
3 | Commit 269bd5d8 "cpu: Move the softmmu tlb to CPUNegativeOffsetState' | 3 | Fixes: 85c19af63e7 ("include/exec: Use vaddr in DisasContextBase for virtual addresses") |
4 | broke the RISC-V host build as there are two variables that are used but | ||
5 | not defined. | ||
6 | |||
7 | This patch renames the undefined variables mask_off and table_off to the | ||
8 | existing (but unused) mask_ofs and table_ofs variables. | ||
9 | |||
10 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
11 | Message-Id: <79729cc88ca509e08b5c4aa0aa8a52847af70c0f.1561039316.git.alistair.francis@wdc.com> | ||
12 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
13 | --- | 5 | --- |
14 | tcg/riscv/tcg-target.inc.c | 4 ++-- | 6 | target/mips/tcg/octeon_translate.c | 4 ++-- |
15 | 1 file changed, 2 insertions(+), 2 deletions(-) | 7 | 1 file changed, 2 insertions(+), 2 deletions(-) |
16 | 8 | ||
17 | diff --git a/tcg/riscv/tcg-target.inc.c b/tcg/riscv/tcg-target.inc.c | 9 | diff --git a/target/mips/tcg/octeon_translate.c b/target/mips/tcg/octeon_translate.c |
18 | index XXXXXXX..XXXXXXX 100644 | 10 | index XXXXXXX..XXXXXXX 100644 |
19 | --- a/tcg/riscv/tcg-target.inc.c | 11 | --- a/target/mips/tcg/octeon_translate.c |
20 | +++ b/tcg/riscv/tcg-target.inc.c | 12 | +++ b/target/mips/tcg/octeon_translate.c |
21 | @@ -XXX,XX +XXX,XX @@ static void tcg_out_tlb_load(TCGContext *s, TCGReg addrl, | 13 | @@ -XXX,XX +XXX,XX @@ static bool trans_BBIT(DisasContext *ctx, arg_BBIT *a) |
22 | int table_ofs = fast_ofs + offsetof(CPUTLBDescFast, table); | 14 | TCGv p; |
23 | TCGReg mask_base = TCG_AREG0, table_base = TCG_AREG0; | 15 | |
24 | 16 | if (ctx->hflags & MIPS_HFLAG_BMASK) { | |
25 | - tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP0, mask_base, mask_off); | 17 | - LOG_DISAS("Branch in delay / forbidden slot at PC 0x" |
26 | - tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, table_base, table_off); | 18 | - TARGET_FMT_lx "\n", ctx->base.pc_next); |
27 | + tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP0, mask_base, mask_ofs); | 19 | + LOG_DISAS("Branch in delay / forbidden slot at PC 0x%" VADDR_PRIx "\n", |
28 | + tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TMP1, table_base, table_ofs); | 20 | + ctx->base.pc_next); |
29 | 21 | generate_exception_end(ctx, EXCP_RI); | |
30 | tcg_out_opc_imm(s, OPC_SRLI, TCG_REG_TMP2, addrl, | 22 | return true; |
31 | TARGET_PAGE_BITS - CPU_TLB_ENTRY_BITS); | 23 | } |
32 | -- | 24 | -- |
33 | 2.17.1 | 25 | 2.43.0 |
34 | |||
35 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | This operation can always be emitted, even if we need to | ||
2 | fall back to xor. Adjust the assertions to match. | ||
3 | 1 | ||
4 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | --- | ||
6 | tcg/tcg-op-vec.c | 6 ++++++ | ||
7 | 1 file changed, 6 insertions(+) | ||
8 | |||
9 | diff --git a/tcg/tcg-op-vec.c b/tcg/tcg-op-vec.c | ||
10 | index XXXXXXX..XXXXXXX 100644 | ||
11 | --- a/tcg/tcg-op-vec.c | ||
12 | +++ b/tcg/tcg-op-vec.c | ||
13 | @@ -XXX,XX +XXX,XX @@ bool tcg_can_emit_vecop_list(const TCGOpcode *list, | ||
14 | case INDEX_op_bitsel_vec: | ||
15 | /* These opcodes are mandatory and should not be listed. */ | ||
16 | g_assert_not_reached(); | ||
17 | + case INDEX_op_not_vec: | ||
18 | + /* These opcodes have generic expansions using the above. */ | ||
19 | + g_assert_not_reached(); | ||
20 | default: | ||
21 | break; | ||
22 | } | ||
23 | @@ -XXX,XX +XXX,XX @@ static bool do_op2(unsigned vece, TCGv_vec r, TCGv_vec a, TCGOpcode opc) | ||
24 | |||
25 | void tcg_gen_not_vec(unsigned vece, TCGv_vec r, TCGv_vec a) | ||
26 | { | ||
27 | + const TCGOpcode *hold_list = tcg_swap_vecop_list(NULL); | ||
28 | + | ||
29 | if (!TCG_TARGET_HAS_not_vec || !do_op2(vece, r, a, INDEX_op_not_vec)) { | ||
30 | TCGv_vec t = tcg_const_ones_vec_matching(r); | ||
31 | tcg_gen_xor_vec(0, r, a, t); | ||
32 | tcg_temp_free_vec(t); | ||
33 | } | ||
34 | + tcg_swap_vecop_list(hold_list); | ||
35 | } | ||
36 | |||
37 | void tcg_gen_neg_vec(unsigned vece, TCGv_vec r, TCGv_vec a) | ||
38 | -- | ||
39 | 2.17.1 | ||
40 | |||
41 | diff view generated by jsdifflib |