1
The following changes since commit 05de778b5b8ab0b402996769117b88c7ea5c7c61:
1
v2: Remove poisoned symbol CONFIG_RISCV_DIS from disas.c.
2
Wasn't visible from x86 with gcc or clang;
3
was visible from macos clang;
4
was visible from native riscv clang.
2
5
3
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2021-07-09 14:30:01 +0100)
6
7
r~
8
9
10
The following changes since commit fff86d48a2cdcdfa75f845cac3e0d3cdd848d9e4:
11
12
Merge tag 'migration-20230509-pull-request' of https://gitlab.com/juan.quintela/qemu into staging (2023-05-11 05:55:12 +0100)
4
13
5
are available in the Git repository at:
14
are available in the Git repository at:
6
15
7
https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20210710
16
https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20230511-2
8
17
9
for you to fetch changes up to ad1a706f386c2281adb0b09257d892735e405834:
18
for you to fetch changes up to 335dfd253fc242b009a1b9b5d4fffbf4ea52928d:
10
19
11
cpu: Add breakpoint tracepoints (2021-07-09 21:31:11 -0700)
20
target/loongarch: Do not include tcg-ldst.h (2023-05-11 09:53:41 +0100)
12
21
13
----------------------------------------------------------------
22
----------------------------------------------------------------
14
Add translator_use_goto_tb.
23
target/m68k: Fix gen_load_fp regression
15
Cleanups in prep of breakpoint fixes.
24
accel/tcg: Ensure fairness with icount
16
Misc fixes.
25
disas: Move disas.c into the target-independent source sets
26
tcg: Use common routines for calling slow path helpers
27
tcg/*: Cleanups to qemu_ld/st constraints
28
tcg: Remove TARGET_ALIGNED_ONLY
29
accel/tcg: Reorg system mode load/store helpers
17
30
18
----------------------------------------------------------------
31
----------------------------------------------------------------
19
Liren Wei (2):
32
Jamie Iles (2):
20
accel/tcg: Hoist tcg_tb_insert() up above tb_link_page()
33
cpu: expose qemu_cpu_list_lock for lock-guard use
21
tcg: Bake tb_destroy() into tcg_region_tree
34
accel/tcg/tcg-accel-ops-rr: ensure fairness with icount
22
35
23
Philippe Mathieu-Daudé (1):
36
Richard Henderson (49):
24
tcg: Avoid including 'trace-tcg.h' in target translate.c
37
target/m68k: Fix gen_load_fp for OS_LONG
38
accel/tcg: Fix atomic_mmu_lookup for reads
39
disas: Fix tabs and braces in disas.c
40
disas: Move disas.c to disas/
41
disas: Remove target_ulong from the interface
42
disas: Remove target-specific headers
43
tcg/i386: Introduce prepare_host_addr
44
tcg/i386: Use indexed addressing for softmmu fast path
45
tcg/aarch64: Introduce prepare_host_addr
46
tcg/arm: Introduce prepare_host_addr
47
tcg/loongarch64: Introduce prepare_host_addr
48
tcg/mips: Introduce prepare_host_addr
49
tcg/ppc: Introduce prepare_host_addr
50
tcg/riscv: Introduce prepare_host_addr
51
tcg/s390x: Introduce prepare_host_addr
52
tcg: Add routines for calling slow-path helpers
53
tcg/i386: Convert tcg_out_qemu_ld_slow_path
54
tcg/i386: Convert tcg_out_qemu_st_slow_path
55
tcg/aarch64: Convert tcg_out_qemu_{ld,st}_slow_path
56
tcg/arm: Convert tcg_out_qemu_{ld,st}_slow_path
57
tcg/loongarch64: Convert tcg_out_qemu_{ld,st}_slow_path
58
tcg/mips: Convert tcg_out_qemu_{ld,st}_slow_path
59
tcg/ppc: Convert tcg_out_qemu_{ld,st}_slow_path
60
tcg/riscv: Convert tcg_out_qemu_{ld,st}_slow_path
61
tcg/s390x: Convert tcg_out_qemu_{ld,st}_slow_path
62
tcg/loongarch64: Simplify constraints on qemu_ld/st
63
tcg/mips: Remove MO_BSWAP handling
64
tcg/mips: Reorg tlb load within prepare_host_addr
65
tcg/mips: Simplify constraints on qemu_ld/st
66
tcg/ppc: Reorg tcg_out_tlb_read
67
tcg/ppc: Adjust constraints on qemu_ld/st
68
tcg/ppc: Remove unused constraints A, B, C, D
69
tcg/ppc: Remove unused constraint J
70
tcg/riscv: Simplify constraints on qemu_ld/st
71
tcg/s390x: Use ALGFR in constructing softmmu host address
72
tcg/s390x: Simplify constraints on qemu_ld/st
73
target/mips: Add MO_ALIGN to gen_llwp, gen_scwp
74
target/mips: Add missing default_tcg_memop_mask
75
target/mips: Use MO_ALIGN instead of 0
76
target/mips: Remove TARGET_ALIGNED_ONLY
77
target/nios2: Remove TARGET_ALIGNED_ONLY
78
target/sh4: Use MO_ALIGN where required
79
target/sh4: Remove TARGET_ALIGNED_ONLY
80
tcg: Remove TARGET_ALIGNED_ONLY
81
accel/tcg: Add cpu_in_serial_context
82
accel/tcg: Introduce tlb_read_idx
83
accel/tcg: Reorg system mode load helpers
84
accel/tcg: Reorg system mode store helpers
85
target/loongarch: Do not include tcg-ldst.h
25
86
26
Richard Henderson (38):
87
Thomas Huth (2):
27
tcg: Add separator in INDEX_op_call dump
88
disas: Move softmmu specific code to separate file
28
tcg: Move tb_phys_invalidate_count to tb_ctx
89
disas: Move disas.c into the target-independent source set
29
accel/tcg: Introduce translator_use_goto_tb
30
target/alpha: Remove use_exit_tb
31
target/alpha: Remove in_superpage
32
target/alpha: Use translator_use_goto_tb
33
target/arm: Use DISAS_TOO_MANY for ISB and SB
34
target/arm: Use translator_use_goto_tb for aarch64
35
target/arm: Use translator_use_goto_tb for aarch32
36
target/avr: Use translator_use_goto_tb
37
target/avr: Mark some helpers noreturn
38
target/cris: Use translator_use_goto_tb
39
target/hppa: Use translator_use_goto_tb
40
target/i386: Use translator_use_goto_tb
41
target/m68k: Use translator_use_goto_tb
42
target/microblaze: Use translator_use_goto_tb
43
target/mips: Use translator_use_goto_tb
44
target/mips: Fix missing else in gen_goto_tb
45
target/nios2: Use translator_use_goto_tb
46
target/openrisc: Use translator_use_goto_tb
47
target/ppc: Use translator_use_goto_tb
48
target/riscv: Use translator_use_goto_tb
49
target/rx: Use translator_use_goto_tb
50
target/s390x: Use translator_use_goto_tb
51
target/s390x: Remove use_exit_tb
52
target/sh4: Use translator_use_goto_tb
53
target/sparc: Use translator_use_goto_tb
54
target/tricore: Use translator_use_goto_tb
55
target/tricore: Use tcg_gen_lookup_and_goto_ptr
56
target/xtensa: Use translator_use_goto_tb
57
tcg: Fix prologue disassembly
58
target/i386: Use cpu_breakpoint_test in breakpoint_handler
59
accel/tcg: Move helper_lookup_tb_ptr to cpu-exec.c
60
accel/tcg: Move tb_lookup to cpu-exec.c
61
accel/tcg: Split out log_cpu_exec
62
accel/tcg: Log tb->cflags with -d exec
63
tcg: Remove TCG_TARGET_HAS_goto_ptr
64
cpu: Add breakpoint tracepoints
65
90
66
accel/tcg/tb-context.h | 1 +
91
configs/targets/mips-linux-user.mak | 1 -
67
accel/tcg/tb-lookup.h | 49 ----------------
92
configs/targets/mips-softmmu.mak | 1 -
68
include/exec/translator.h | 10 ++++
93
configs/targets/mips64-linux-user.mak | 1 -
69
include/tcg/tcg-opc.h | 3 +-
94
configs/targets/mips64-softmmu.mak | 1 -
70
include/tcg/tcg.h | 4 --
95
configs/targets/mips64el-linux-user.mak | 1 -
71
target/avr/helper.h | 8 +--
96
configs/targets/mips64el-softmmu.mak | 1 -
72
tcg/aarch64/tcg-target.h | 1 -
97
configs/targets/mipsel-linux-user.mak | 1 -
73
tcg/arm/tcg-target.h | 1 -
98
configs/targets/mipsel-softmmu.mak | 1 -
74
tcg/i386/tcg-target.h | 1 -
99
configs/targets/mipsn32-linux-user.mak | 1 -
75
tcg/mips/tcg-target.h | 1 -
100
configs/targets/mipsn32el-linux-user.mak | 1 -
76
tcg/ppc/tcg-target.h | 1 -
101
configs/targets/nios2-softmmu.mak | 1 -
77
tcg/riscv/tcg-target.h | 1 -
102
configs/targets/sh4-linux-user.mak | 1 -
78
tcg/s390/tcg-target.h | 1 -
103
configs/targets/sh4-softmmu.mak | 1 -
79
tcg/sparc/tcg-target.h | 1 -
104
configs/targets/sh4eb-linux-user.mak | 1 -
80
tcg/tci/tcg-target.h | 1 -
105
configs/targets/sh4eb-softmmu.mak | 1 -
81
accel/tcg/cpu-exec.c | 112 ++++++++++++++++++++++++++++--------
106
meson.build | 3 -
82
accel/tcg/tcg-runtime.c | 22 -------
107
accel/tcg/internal.h | 9 +
83
accel/tcg/translate-all.c | 23 ++++----
108
accel/tcg/tcg-accel-ops-icount.h | 3 +-
84
accel/tcg/translator.c | 11 ++++
109
disas/disas-internal.h | 21 +
85
cpu.c | 13 +++--
110
include/disas/disas.h | 23 +-
86
target/alpha/translate.c | 47 ++-------------
111
include/exec/cpu-common.h | 1 +
87
target/arm/translate-a64.c | 26 ++-------
112
include/exec/cpu-defs.h | 7 +-
88
target/arm/translate-sve.c | 1 -
113
include/exec/cpu_ldst.h | 26 +-
89
target/arm/translate.c | 17 +-----
114
include/exec/memop.h | 13 +-
90
target/avr/translate.c | 9 ++-
115
include/exec/poison.h | 1 -
91
target/cris/translate.c | 6 +-
116
tcg/loongarch64/tcg-target-con-set.h | 2 -
92
target/hppa/translate.c | 6 +-
117
tcg/loongarch64/tcg-target-con-str.h | 1 -
93
target/i386/tcg/sysemu/bpt_helper.c | 12 +---
118
tcg/mips/tcg-target-con-set.h | 13 +-
94
target/i386/tcg/translate.c | 15 +----
119
tcg/mips/tcg-target-con-str.h | 2 -
95
target/m68k/translate.c | 13 +----
120
tcg/mips/tcg-target.h | 4 +-
96
target/microblaze/translate.c | 12 +---
121
tcg/ppc/tcg-target-con-set.h | 11 +-
97
target/mips/tcg/translate.c | 21 ++-----
122
tcg/ppc/tcg-target-con-str.h | 7 -
98
target/nios2/translate.c | 15 +----
123
tcg/riscv/tcg-target-con-set.h | 2 -
99
target/openrisc/translate.c | 16 +++---
124
tcg/riscv/tcg-target-con-str.h | 1 -
100
target/ppc/translate.c | 11 +---
125
tcg/s390x/tcg-target-con-set.h | 2 -
101
target/riscv/translate.c | 20 +------
126
tcg/s390x/tcg-target-con-str.h | 1 -
102
target/rx/translate.c | 12 +---
127
accel/tcg/cpu-exec-common.c | 3 +
103
target/s390x/translate.c | 19 +-----
128
accel/tcg/cputlb.c | 1113 ++++++++++++++++-------------
104
target/sh4/translate.c | 12 +---
129
accel/tcg/tb-maint.c | 2 +-
105
target/sparc/translate.c | 20 ++-----
130
accel/tcg/tcg-accel-ops-icount.c | 21 +-
106
target/tricore/translate.c | 20 ++-----
131
accel/tcg/tcg-accel-ops-rr.c | 37 +-
107
target/xtensa/translate.c | 7 +--
132
bsd-user/elfload.c | 5 +-
108
tcg/region.c | 33 +++--------
133
cpus-common.c | 2 +-
109
tcg/tcg-op.c | 2 +-
134
disas/disas-mon.c | 65 ++
110
tcg/tcg.c | 14 ++---
135
disas.c => disas/disas.c | 111 +--
111
trace-events | 5 ++
136
linux-user/elfload.c | 18 +-
112
46 files changed, 217 insertions(+), 439 deletions(-)
137
migration/dirtyrate.c | 26 +-
113
delete mode 100644 accel/tcg/tb-lookup.h
138
replay/replay.c | 3 +-
114
139
target/loongarch/csr_helper.c | 1 -
140
target/loongarch/iocsr_helper.c | 1 -
141
target/m68k/translate.c | 1 +
142
target/mips/tcg/mxu_translate.c | 3 +-
143
target/nios2/translate.c | 10 +
144
target/sh4/translate.c | 102 ++-
145
tcg/tcg.c | 480 ++++++++++++-
146
trace/control-target.c | 9 +-
147
target/mips/tcg/micromips_translate.c.inc | 24 +-
148
target/mips/tcg/mips16e_translate.c.inc | 18 +-
149
target/mips/tcg/nanomips_translate.c.inc | 32 +-
150
tcg/aarch64/tcg-target.c.inc | 347 ++++-----
151
tcg/arm/tcg-target.c.inc | 455 +++++-------
152
tcg/i386/tcg-target.c.inc | 453 +++++-------
153
tcg/loongarch64/tcg-target.c.inc | 313 +++-----
154
tcg/mips/tcg-target.c.inc | 870 +++++++---------------
155
tcg/ppc/tcg-target.c.inc | 512 ++++++-------
156
tcg/riscv/tcg-target.c.inc | 304 ++++----
157
tcg/s390x/tcg-target.c.inc | 314 ++++----
158
disas/meson.build | 6 +-
159
68 files changed, 2789 insertions(+), 3040 deletions(-)
160
create mode 100644 disas/disas-internal.h
161
create mode 100644 disas/disas-mon.c
162
rename disas.c => disas/disas.c (78%)
diff view generated by jsdifflib
Deleted patch
1
We lost the ',' following the called function name.
2
1
3
Fixes: 3e92aa34434
4
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
tcg/tcg.c | 2 +-
8
1 file changed, 1 insertion(+), 1 deletion(-)
9
10
diff --git a/tcg/tcg.c b/tcg/tcg.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/tcg/tcg.c
13
+++ b/tcg/tcg.c
14
@@ -XXX,XX +XXX,XX @@ static void tcg_dump_ops(TCGContext *s, bool have_prefs)
15
col += qemu_log("plugin(%p)", func);
16
}
17
18
- col += qemu_log("$0x%x,$%d", info->flags, nb_oargs);
19
+ col += qemu_log(",$0x%x,$%d", info->flags, nb_oargs);
20
for (i = 0; i < nb_oargs; i++) {
21
col += qemu_log(",%s", tcg_get_arg_str(s, buf, sizeof(buf),
22
op->args[i]));
23
--
24
2.25.1
25
26
diff view generated by jsdifflib
Deleted patch
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
1
3
The root trace-events only declares a single TCG event:
4
5
$ git grep -w tcg trace-events
6
trace-events:115:# tcg/tcg-op.c
7
trace-events:137:vcpu tcg guest_mem_before(TCGv vaddr, uint16_t info) "info=%d", "vaddr=0x%016"PRIx64" info=%d"
8
9
and only a tcg/tcg-op.c uses it:
10
11
$ git grep -l trace_guest_mem_before_tcg
12
tcg/tcg-op.c
13
14
therefore it is pointless to include "trace-tcg.h" in each target
15
(because it is not used). Remove it.
16
17
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
18
Message-Id: <20210629050935.2570721-1-f4bug@amsat.org>
19
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
20
---
21
target/alpha/translate.c | 1 -
22
target/arm/translate-a64.c | 1 -
23
target/arm/translate-sve.c | 1 -
24
target/arm/translate.c | 1 -
25
target/cris/translate.c | 1 -
26
target/hppa/translate.c | 1 -
27
target/i386/tcg/translate.c | 1 -
28
target/m68k/translate.c | 1 -
29
target/microblaze/translate.c | 1 -
30
target/mips/tcg/translate.c | 1 -
31
target/openrisc/translate.c | 1 -
32
target/ppc/translate.c | 1 -
33
target/rx/translate.c | 1 -
34
target/s390x/translate.c | 1 -
35
target/sh4/translate.c | 1 -
36
target/sparc/translate.c | 1 -
37
target/xtensa/translate.c | 1 -
38
17 files changed, 17 deletions(-)
39
40
diff --git a/target/alpha/translate.c b/target/alpha/translate.c
41
index XXXXXXX..XXXXXXX 100644
42
--- a/target/alpha/translate.c
43
+++ b/target/alpha/translate.c
44
@@ -XXX,XX +XXX,XX @@
45
#include "exec/cpu_ldst.h"
46
#include "exec/helper-proto.h"
47
#include "exec/helper-gen.h"
48
-#include "trace-tcg.h"
49
#include "exec/translator.h"
50
#include "exec/log.h"
51
52
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
53
index XXXXXXX..XXXXXXX 100644
54
--- a/target/arm/translate-a64.c
55
+++ b/target/arm/translate-a64.c
56
@@ -XXX,XX +XXX,XX @@
57
#include "exec/helper-gen.h"
58
#include "exec/log.h"
59
60
-#include "trace-tcg.h"
61
#include "translate-a64.h"
62
#include "qemu/atomic128.h"
63
64
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
65
index XXXXXXX..XXXXXXX 100644
66
--- a/target/arm/translate-sve.c
67
+++ b/target/arm/translate-sve.c
68
@@ -XXX,XX +XXX,XX @@
69
#include "exec/helper-proto.h"
70
#include "exec/helper-gen.h"
71
#include "exec/log.h"
72
-#include "trace-tcg.h"
73
#include "translate-a64.h"
74
#include "fpu/softfloat.h"
75
76
diff --git a/target/arm/translate.c b/target/arm/translate.c
77
index XXXXXXX..XXXXXXX 100644
78
--- a/target/arm/translate.c
79
+++ b/target/arm/translate.c
80
@@ -XXX,XX +XXX,XX @@
81
#include "exec/helper-proto.h"
82
#include "exec/helper-gen.h"
83
84
-#include "trace-tcg.h"
85
#include "exec/log.h"
86
87
88
diff --git a/target/cris/translate.c b/target/cris/translate.c
89
index XXXXXXX..XXXXXXX 100644
90
--- a/target/cris/translate.c
91
+++ b/target/cris/translate.c
92
@@ -XXX,XX +XXX,XX @@
93
94
#include "exec/helper-gen.h"
95
96
-#include "trace-tcg.h"
97
#include "exec/log.h"
98
99
100
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
101
index XXXXXXX..XXXXXXX 100644
102
--- a/target/hppa/translate.c
103
+++ b/target/hppa/translate.c
104
@@ -XXX,XX +XXX,XX @@
105
#include "exec/helper-proto.h"
106
#include "exec/helper-gen.h"
107
#include "exec/translator.h"
108
-#include "trace-tcg.h"
109
#include "exec/log.h"
110
111
/* Since we have a distinction between register size and address size,
112
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
113
index XXXXXXX..XXXXXXX 100644
114
--- a/target/i386/tcg/translate.c
115
+++ b/target/i386/tcg/translate.c
116
@@ -XXX,XX +XXX,XX @@
117
#include "exec/helper-gen.h"
118
#include "helper-tcg.h"
119
120
-#include "trace-tcg.h"
121
#include "exec/log.h"
122
123
#define PREFIX_REPZ 0x01
124
diff --git a/target/m68k/translate.c b/target/m68k/translate.c
125
index XXXXXXX..XXXXXXX 100644
126
--- a/target/m68k/translate.c
127
+++ b/target/m68k/translate.c
128
@@ -XXX,XX +XXX,XX @@
129
#include "exec/helper-proto.h"
130
#include "exec/helper-gen.h"
131
132
-#include "trace-tcg.h"
133
#include "exec/log.h"
134
#include "fpu/softfloat.h"
135
136
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
137
index XXXXXXX..XXXXXXX 100644
138
--- a/target/microblaze/translate.c
139
+++ b/target/microblaze/translate.c
140
@@ -XXX,XX +XXX,XX @@
141
#include "exec/translator.h"
142
#include "qemu/qemu-print.h"
143
144
-#include "trace-tcg.h"
145
#include "exec/log.h"
146
147
#define EXTRACT_FIELD(src, start, end) \
148
diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
149
index XXXXXXX..XXXXXXX 100644
150
--- a/target/mips/tcg/translate.c
151
+++ b/target/mips/tcg/translate.c
152
@@ -XXX,XX +XXX,XX @@
153
#include "semihosting/semihost.h"
154
155
#include "trace.h"
156
-#include "trace-tcg.h"
157
#include "exec/translator.h"
158
#include "exec/log.h"
159
#include "qemu/qemu-print.h"
160
diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c
161
index XXXXXXX..XXXXXXX 100644
162
--- a/target/openrisc/translate.c
163
+++ b/target/openrisc/translate.c
164
@@ -XXX,XX +XXX,XX @@
165
#include "exec/helper-gen.h"
166
#include "exec/gen-icount.h"
167
168
-#include "trace-tcg.h"
169
#include "exec/log.h"
170
171
/* is_jmp field values */
172
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
173
index XXXXXXX..XXXXXXX 100644
174
--- a/target/ppc/translate.c
175
+++ b/target/ppc/translate.c
176
@@ -XXX,XX +XXX,XX @@
177
#include "exec/helper-proto.h"
178
#include "exec/helper-gen.h"
179
180
-#include "trace-tcg.h"
181
#include "exec/translator.h"
182
#include "exec/log.h"
183
#include "qemu/atomic128.h"
184
diff --git a/target/rx/translate.c b/target/rx/translate.c
185
index XXXXXXX..XXXXXXX 100644
186
--- a/target/rx/translate.c
187
+++ b/target/rx/translate.c
188
@@ -XXX,XX +XXX,XX @@
189
#include "exec/helper-proto.h"
190
#include "exec/helper-gen.h"
191
#include "exec/translator.h"
192
-#include "trace-tcg.h"
193
#include "exec/log.h"
194
195
typedef struct DisasContext {
196
diff --git a/target/s390x/translate.c b/target/s390x/translate.c
197
index XXXXXXX..XXXXXXX 100644
198
--- a/target/s390x/translate.c
199
+++ b/target/s390x/translate.c
200
@@ -XXX,XX +XXX,XX @@
201
#include "exec/helper-proto.h"
202
#include "exec/helper-gen.h"
203
204
-#include "trace-tcg.h"
205
#include "exec/translator.h"
206
#include "exec/log.h"
207
#include "qemu/atomic128.h"
208
diff --git a/target/sh4/translate.c b/target/sh4/translate.c
209
index XXXXXXX..XXXXXXX 100644
210
--- a/target/sh4/translate.c
211
+++ b/target/sh4/translate.c
212
@@ -XXX,XX +XXX,XX @@
213
#include "exec/helper-proto.h"
214
#include "exec/helper-gen.h"
215
#include "exec/translator.h"
216
-#include "trace-tcg.h"
217
#include "exec/log.h"
218
#include "qemu/qemu-print.h"
219
220
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
221
index XXXXXXX..XXXXXXX 100644
222
--- a/target/sparc/translate.c
223
+++ b/target/sparc/translate.c
224
@@ -XXX,XX +XXX,XX @@
225
226
#include "exec/helper-gen.h"
227
228
-#include "trace-tcg.h"
229
#include "exec/translator.h"
230
#include "exec/log.h"
231
#include "asi.h"
232
diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
233
index XXXXXXX..XXXXXXX 100644
234
--- a/target/xtensa/translate.c
235
+++ b/target/xtensa/translate.c
236
@@ -XXX,XX +XXX,XX @@
237
#include "exec/helper-proto.h"
238
#include "exec/helper-gen.h"
239
240
-#include "trace-tcg.h"
241
#include "exec/log.h"
242
243
244
--
245
2.25.1
246
247
diff view generated by jsdifflib
Deleted patch
1
From: Liren Wei <lrwei@bupt.edu.cn>
2
1
3
TranslationBlocks not inserted into the corresponding region
4
tree shall be regarded as partially initialized objects, and
5
needs to be finalized first before inserting into QHT.
6
7
Signed-off-by: Liren Wei <lrwei@bupt.edu.cn>
8
Message-Id: <f9fc263f71e11b6308d8c1fbc0dd366bf4aeb532.1625404483.git.lrwei@bupt.edu.cn>
9
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
10
---
11
accel/tcg/translate-all.c | 9 ++++++++-
12
1 file changed, 8 insertions(+), 1 deletion(-)
13
14
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
15
index XXXXXXX..XXXXXXX 100644
16
--- a/accel/tcg/translate-all.c
17
+++ b/accel/tcg/translate-all.c
18
@@ -XXX,XX +XXX,XX @@ TranslationBlock *tb_gen_code(CPUState *cpu,
19
return tb;
20
}
21
22
+ /*
23
+ * Insert TB into the corresponding region tree before publishing it
24
+ * through QHT. Otherwise rewinding happened in the TB might fail to
25
+ * lookup itself using host PC.
26
+ */
27
+ tcg_tb_insert(tb);
28
+
29
/* check next page if needed */
30
virt_page2 = (pc + tb->size - 1) & TARGET_PAGE_MASK;
31
phys_page2 = -1;
32
@@ -XXX,XX +XXX,XX @@ TranslationBlock *tb_gen_code(CPUState *cpu,
33
orig_aligned -= ROUND_UP(sizeof(*tb), qemu_icache_linesize);
34
qatomic_set(&tcg_ctx->code_gen_ptr, (void *)orig_aligned);
35
tb_destroy(tb);
36
+ tcg_tb_remove(tb);
37
return existing_tb;
38
}
39
- tcg_tb_insert(tb);
40
return tb;
41
}
42
43
--
44
2.25.1
45
46
diff view generated by jsdifflib
Deleted patch
1
From: Liren Wei <lrwei@bupt.edu.cn>
2
1
3
The function is called only at tcg_gen_code() when duplicated TBs
4
are translated by different threads, and when the tcg_region_tree
5
is reset. Bake it into the underlying GTree as its value destroy
6
function to unite these situations.
7
Also remove tcg_region_tree_traverse() which now becomes useless.
8
9
Signed-off-by: Liren Wei <lrwei@bupt.edu.cn>
10
Message-Id: <8dc352f08d038c4e7a1f5f56962398cdc700c3aa.1625404483.git.lrwei@bupt.edu.cn>
11
[rth: Name the new tb_tc_cmp parameter correctly.]
12
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
13
---
14
include/tcg/tcg.h | 1 -
15
accel/tcg/translate-all.c | 6 ------
16
tcg/region.c | 19 ++++++++-----------
17
3 files changed, 8 insertions(+), 18 deletions(-)
18
19
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
20
index XXXXXXX..XXXXXXX 100644
21
--- a/include/tcg/tcg.h
22
+++ b/include/tcg/tcg.h
23
@@ -XXX,XX +XXX,XX @@ void *tcg_malloc_internal(TCGContext *s, int size);
24
void tcg_pool_reset(TCGContext *s);
25
TranslationBlock *tcg_tb_alloc(TCGContext *s);
26
27
-void tb_destroy(TranslationBlock *tb);
28
void tcg_region_reset_all(void);
29
30
size_t tcg_code_size(void);
31
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
32
index XXXXXXX..XXXXXXX 100644
33
--- a/accel/tcg/translate-all.c
34
+++ b/accel/tcg/translate-all.c
35
@@ -XXX,XX +XXX,XX @@ static int cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb,
36
return 0;
37
}
38
39
-void tb_destroy(TranslationBlock *tb)
40
-{
41
- qemu_spin_destroy(&tb->jmp_lock);
42
-}
43
-
44
bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc, bool will_exit)
45
{
46
/*
47
@@ -XXX,XX +XXX,XX @@ TranslationBlock *tb_gen_code(CPUState *cpu,
48
49
orig_aligned -= ROUND_UP(sizeof(*tb), qemu_icache_linesize);
50
qatomic_set(&tcg_ctx->code_gen_ptr, (void *)orig_aligned);
51
- tb_destroy(tb);
52
tcg_tb_remove(tb);
53
return existing_tb;
54
}
55
diff --git a/tcg/region.c b/tcg/region.c
56
index XXXXXXX..XXXXXXX 100644
57
--- a/tcg/region.c
58
+++ b/tcg/region.c
59
@@ -XXX,XX +XXX,XX @@ static int ptr_cmp_tb_tc(const void *ptr, const struct tb_tc *s)
60
return 0;
61
}
62
63
-static gint tb_tc_cmp(gconstpointer ap, gconstpointer bp)
64
+static gint tb_tc_cmp(gconstpointer ap, gconstpointer bp, gpointer userdata)
65
{
66
const struct tb_tc *a = ap;
67
const struct tb_tc *b = bp;
68
@@ -XXX,XX +XXX,XX @@ static gint tb_tc_cmp(gconstpointer ap, gconstpointer bp)
69
return ptr_cmp_tb_tc(b->ptr, a);
70
}
71
72
+static void tb_destroy(gpointer value)
73
+{
74
+ TranslationBlock *tb = value;
75
+ qemu_spin_destroy(&tb->jmp_lock);
76
+}
77
+
78
static void tcg_region_trees_init(void)
79
{
80
size_t i;
81
@@ -XXX,XX +XXX,XX @@ static void tcg_region_trees_init(void)
82
struct tcg_region_tree *rt = region_trees + i * tree_size;
83
84
qemu_mutex_init(&rt->lock);
85
- rt->tree = g_tree_new(tb_tc_cmp);
86
+ rt->tree = g_tree_new_full(tb_tc_cmp, NULL, NULL, tb_destroy);
87
}
88
}
89
90
@@ -XXX,XX +XXX,XX @@ size_t tcg_nb_tbs(void)
91
return nb_tbs;
92
}
93
94
-static gboolean tcg_region_tree_traverse(gpointer k, gpointer v, gpointer data)
95
-{
96
- TranslationBlock *tb = v;
97
-
98
- tb_destroy(tb);
99
- return FALSE;
100
-}
101
-
102
static void tcg_region_tree_reset_all(void)
103
{
104
size_t i;
105
@@ -XXX,XX +XXX,XX @@ static void tcg_region_tree_reset_all(void)
106
for (i = 0; i < region.n; i++) {
107
struct tcg_region_tree *rt = region_trees + i * tree_size;
108
109
- g_tree_foreach(rt->tree, tcg_region_tree_traverse, NULL);
110
/* Increment the refcount first so that destroy acts as a reset */
111
g_tree_ref(rt->tree);
112
g_tree_destroy(rt->tree);
113
--
114
2.25.1
115
116
diff view generated by jsdifflib
Deleted patch
1
We can call do_tb_phys_invalidate from an iocontext, which has
2
no per-thread tcg_ctx. Move this to tb_ctx, which is global.
3
The actual update still takes place with a lock held, so only
4
an atomic set is required, not an atomic increment.
5
1
6
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/457
7
Tested-by: Viktor Ashirov <vashirov@redhat.com>
8
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9
---
10
accel/tcg/tb-context.h | 1 +
11
include/tcg/tcg.h | 3 ---
12
accel/tcg/translate-all.c | 8 ++++----
13
tcg/region.c | 14 --------------
14
4 files changed, 5 insertions(+), 21 deletions(-)
15
16
diff --git a/accel/tcg/tb-context.h b/accel/tcg/tb-context.h
17
index XXXXXXX..XXXXXXX 100644
18
--- a/accel/tcg/tb-context.h
19
+++ b/accel/tcg/tb-context.h
20
@@ -XXX,XX +XXX,XX @@ struct TBContext {
21
22
/* statistics */
23
unsigned tb_flush_count;
24
+ unsigned tb_phys_invalidate_count;
25
};
26
27
extern TBContext tb_ctx;
28
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
29
index XXXXXXX..XXXXXXX 100644
30
--- a/include/tcg/tcg.h
31
+++ b/include/tcg/tcg.h
32
@@ -XXX,XX +XXX,XX @@ struct TCGContext {
33
/* Threshold to flush the translated code buffer. */
34
void *code_gen_highwater;
35
36
- size_t tb_phys_invalidate_count;
37
-
38
/* Track which vCPU triggers events */
39
CPUState *cpu; /* *_trans */
40
41
@@ -XXX,XX +XXX,XX @@ size_t tcg_code_capacity(void);
42
43
void tcg_tb_insert(TranslationBlock *tb);
44
void tcg_tb_remove(TranslationBlock *tb);
45
-size_t tcg_tb_phys_invalidate_count(void);
46
TranslationBlock *tcg_tb_lookup(uintptr_t tc_ptr);
47
void tcg_tb_foreach(GTraverseFunc func, gpointer user_data);
48
size_t tcg_nb_tbs(void);
49
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
50
index XXXXXXX..XXXXXXX 100644
51
--- a/accel/tcg/translate-all.c
52
+++ b/accel/tcg/translate-all.c
53
@@ -XXX,XX +XXX,XX @@ static void do_tb_phys_invalidate(TranslationBlock *tb, bool rm_from_page_list)
54
/* suppress any remaining jumps to this TB */
55
tb_jmp_unlink(tb);
56
57
- qatomic_set(&tcg_ctx->tb_phys_invalidate_count,
58
- tcg_ctx->tb_phys_invalidate_count + 1);
59
+ qatomic_set(&tb_ctx.tb_phys_invalidate_count,
60
+ tb_ctx.tb_phys_invalidate_count + 1);
61
}
62
63
static void tb_phys_invalidate__locked(TranslationBlock *tb)
64
@@ -XXX,XX +XXX,XX @@ void dump_exec_info(void)
65
qemu_printf("\nStatistics:\n");
66
qemu_printf("TB flush count %u\n",
67
qatomic_read(&tb_ctx.tb_flush_count));
68
- qemu_printf("TB invalidate count %zu\n",
69
- tcg_tb_phys_invalidate_count());
70
+ qemu_printf("TB invalidate count %u\n",
71
+ qatomic_read(&tb_ctx.tb_phys_invalidate_count));
72
73
tlb_flush_counts(&flush_full, &flush_part, &flush_elide);
74
qemu_printf("TLB full flushes %zu\n", flush_full);
75
diff --git a/tcg/region.c b/tcg/region.c
76
index XXXXXXX..XXXXXXX 100644
77
--- a/tcg/region.c
78
+++ b/tcg/region.c
79
@@ -XXX,XX +XXX,XX @@ size_t tcg_code_capacity(void)
80
81
return capacity;
82
}
83
-
84
-size_t tcg_tb_phys_invalidate_count(void)
85
-{
86
- unsigned int n_ctxs = qatomic_read(&tcg_cur_ctxs);
87
- unsigned int i;
88
- size_t total = 0;
89
-
90
- for (i = 0; i < n_ctxs; i++) {
91
- const TCGContext *s = qatomic_read(&tcg_ctxs[i]);
92
-
93
- total += qatomic_read(&s->tb_phys_invalidate_count);
94
- }
95
- return total;
96
-}
97
--
98
2.25.1
99
100
diff view generated by jsdifflib
Deleted patch
1
Add a generic version of the common use_goto_tb test.
2
1
3
Various targets avoid the page crossing test for CONFIG_USER_ONLY,
4
but that is wrong: mmap and mprotect can change page permissions.
5
6
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
7
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
8
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9
---
10
include/exec/translator.h | 10 ++++++++++
11
accel/tcg/translator.c | 11 +++++++++++
12
2 files changed, 21 insertions(+)
13
14
diff --git a/include/exec/translator.h b/include/exec/translator.h
15
index XXXXXXX..XXXXXXX 100644
16
--- a/include/exec/translator.h
17
+++ b/include/exec/translator.h
18
@@ -XXX,XX +XXX,XX @@ void translator_loop(const TranslatorOps *ops, DisasContextBase *db,
19
20
void translator_loop_temp_check(DisasContextBase *db);
21
22
+/**
23
+ * translator_use_goto_tb
24
+ * @db: Disassembly context
25
+ * @dest: target pc of the goto
26
+ *
27
+ * Return true if goto_tb is allowed between the current TB
28
+ * and the destination PC.
29
+ */
30
+bool translator_use_goto_tb(DisasContextBase *db, target_ulong dest);
31
+
32
/*
33
* Translator Load Functions
34
*
35
diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c
36
index XXXXXXX..XXXXXXX 100644
37
--- a/accel/tcg/translator.c
38
+++ b/accel/tcg/translator.c
39
@@ -XXX,XX +XXX,XX @@ void translator_loop_temp_check(DisasContextBase *db)
40
}
41
}
42
43
+bool translator_use_goto_tb(DisasContextBase *db, target_ulong dest)
44
+{
45
+ /* Suppress goto_tb in the case of single-steping. */
46
+ if (db->singlestep_enabled || singlestep) {
47
+ return false;
48
+ }
49
+
50
+ /* Check for the dest on the same page as the start of the TB. */
51
+ return ((db->pc_first ^ dest) & TARGET_PAGE_MASK) == 0;
52
+}
53
+
54
void translator_loop(const TranslatorOps *ops, DisasContextBase *db,
55
CPUState *cpu, TranslationBlock *tb, int max_insns)
56
{
57
--
58
2.25.1
59
60
diff view generated by jsdifflib
Deleted patch
1
We have not needed to end a TB for I/O since ba3e7926691
2
("icount: clean up cpu_can_io at the entry to the block").
3
We do not need to use exit_tb for singlestep, which only
4
means generate one insn per TB.
5
1
6
Which leaves only singlestep_enabled, which means raise a
7
debug trap after every TB, which does not use exit_tb,
8
which would leave the function mis-named.
9
10
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
11
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
12
---
13
target/alpha/translate.c | 15 ++-------------
14
1 file changed, 2 insertions(+), 13 deletions(-)
15
16
diff --git a/target/alpha/translate.c b/target/alpha/translate.c
17
index XXXXXXX..XXXXXXX 100644
18
--- a/target/alpha/translate.c
19
+++ b/target/alpha/translate.c
20
@@ -XXX,XX +XXX,XX @@ static bool in_superpage(DisasContext *ctx, int64_t addr)
21
#endif
22
}
23
24
-static bool use_exit_tb(DisasContext *ctx)
25
-{
26
- return ((tb_cflags(ctx->base.tb) & CF_LAST_IO)
27
- || ctx->base.singlestep_enabled
28
- || singlestep);
29
-}
30
-
31
static bool use_goto_tb(DisasContext *ctx, uint64_t dest)
32
{
33
- /* Suppress goto_tb in the case of single-steping and IO. */
34
- if (unlikely(use_exit_tb(ctx))) {
35
- return false;
36
- }
37
#ifndef CONFIG_USER_ONLY
38
/* If the destination is in the superpage, the page perms can't change. */
39
if (in_superpage(ctx, dest)) {
40
@@ -XXX,XX +XXX,XX @@ static DisasJumpType gen_call_pal(DisasContext *ctx, int palcode)
41
need the page permissions check. We'll see the existence of
42
the page when we create the TB, and we'll flush all TBs if
43
we change the PAL base register. */
44
- if (!use_exit_tb(ctx)) {
45
+ if (!ctx->base.singlestep_enabled) {
46
tcg_gen_goto_tb(0);
47
tcg_gen_movi_i64(cpu_pc, entry);
48
tcg_gen_exit_tb(ctx->base.tb, 0);
49
@@ -XXX,XX +XXX,XX @@ static void alpha_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
50
tcg_gen_movi_i64(cpu_pc, ctx->base.pc_next);
51
/* FALLTHRU */
52
case DISAS_PC_UPDATED:
53
- if (!use_exit_tb(ctx)) {
54
+ if (!ctx->base.singlestep_enabled) {
55
tcg_gen_lookup_and_goto_ptr();
56
break;
57
}
58
--
59
2.25.1
60
61
diff view generated by jsdifflib
Deleted patch
1
The number of links across (normal) pages using this is low,
2
and it will shortly violate the contract for breakpoints.
3
1
4
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
target/alpha/translate.c | 24 ++----------------------
8
1 file changed, 2 insertions(+), 22 deletions(-)
9
10
diff --git a/target/alpha/translate.c b/target/alpha/translate.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/target/alpha/translate.c
13
+++ b/target/alpha/translate.c
14
@@ -XXX,XX +XXX,XX @@ static DisasJumpType gen_store_conditional(DisasContext *ctx, int ra, int rb,
15
return DISAS_NEXT;
16
}
17
18
-static bool in_superpage(DisasContext *ctx, int64_t addr)
19
-{
20
-#ifndef CONFIG_USER_ONLY
21
- return ((ctx->tbflags & ENV_FLAG_PS_USER) == 0
22
- && addr >> TARGET_VIRT_ADDR_SPACE_BITS == -1
23
- && ((addr >> 41) & 3) == 2);
24
-#else
25
- return false;
26
-#endif
27
-}
28
-
29
static bool use_goto_tb(DisasContext *ctx, uint64_t dest)
30
{
31
#ifndef CONFIG_USER_ONLY
32
- /* If the destination is in the superpage, the page perms can't change. */
33
- if (in_superpage(ctx, dest)) {
34
- return true;
35
- }
36
/* Check for the dest on the same page as the start of the TB. */
37
return ((ctx->base.tb->pc ^ dest) & TARGET_PAGE_MASK) == 0;
38
#else
39
@@ -XXX,XX +XXX,XX @@ static void alpha_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu)
40
{
41
DisasContext *ctx = container_of(dcbase, DisasContext, base);
42
CPUAlphaState *env = cpu->env_ptr;
43
- int64_t bound, mask;
44
+ int64_t bound;
45
46
ctx->tbflags = ctx->base.tb->flags;
47
ctx->mem_idx = cpu_mmu_index(env, false);
48
@@ -XXX,XX +XXX,XX @@ static void alpha_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu)
49
ctx->lit = NULL;
50
51
/* Bound the number of insns to execute to those left on the page. */
52
- if (in_superpage(ctx, ctx->base.pc_first)) {
53
- mask = -1ULL << 41;
54
- } else {
55
- mask = TARGET_PAGE_MASK;
56
- }
57
- bound = -(ctx->base.pc_first | mask) / 4;
58
+ bound = -(ctx->base.pc_first | TARGET_PAGE_MASK) / 4;
59
ctx->base.max_insns = MIN(ctx->base.max_insns, bound);
60
}
61
62
--
63
2.25.1
64
65
diff view generated by jsdifflib
Deleted patch
1
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3
---
4
target/alpha/translate.c | 7 +------
5
1 file changed, 1 insertion(+), 6 deletions(-)
6
1
7
diff --git a/target/alpha/translate.c b/target/alpha/translate.c
8
index XXXXXXX..XXXXXXX 100644
9
--- a/target/alpha/translate.c
10
+++ b/target/alpha/translate.c
11
@@ -XXX,XX +XXX,XX @@ static DisasJumpType gen_store_conditional(DisasContext *ctx, int ra, int rb,
12
13
static bool use_goto_tb(DisasContext *ctx, uint64_t dest)
14
{
15
-#ifndef CONFIG_USER_ONLY
16
- /* Check for the dest on the same page as the start of the TB. */
17
- return ((ctx->base.tb->pc ^ dest) & TARGET_PAGE_MASK) == 0;
18
-#else
19
- return true;
20
-#endif
21
+ return translator_use_goto_tb(&ctx->base, dest);
22
}
23
24
static DisasJumpType gen_bdirect(DisasContext *ctx, int ra, int32_t disp)
25
--
26
2.25.1
27
28
diff view generated by jsdifflib
Deleted patch
1
Using gen_goto_tb directly misses the single-step check.
2
Let the branch or debug exception be emitted by arm_tr_tb_stop.
3
1
4
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
target/arm/translate.c | 4 ++--
8
1 file changed, 2 insertions(+), 2 deletions(-)
9
10
diff --git a/target/arm/translate.c b/target/arm/translate.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/target/arm/translate.c
13
+++ b/target/arm/translate.c
14
@@ -XXX,XX +XXX,XX @@ static bool trans_ISB(DisasContext *s, arg_ISB *a)
15
* self-modifying code correctly and also to take
16
* any pending interrupts immediately.
17
*/
18
- gen_goto_tb(s, 0, s->base.pc_next);
19
+ s->base.is_jmp = DISAS_TOO_MANY;
20
return true;
21
}
22
23
@@ -XXX,XX +XXX,XX @@ static bool trans_SB(DisasContext *s, arg_SB *a)
24
* for TCG; MB and end the TB instead.
25
*/
26
tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC);
27
- gen_goto_tb(s, 0, s->base.pc_next);
28
+ s->base.is_jmp = DISAS_TOO_MANY;
29
return true;
30
}
31
32
--
33
2.25.1
34
35
diff view generated by jsdifflib
Deleted patch
1
We have not needed to end a TB for I/O since ba3e7926691
2
("icount: clean up cpu_can_io at the entry to the block"),
3
and gdbstub singlestep is handled by the generic function.
4
1
5
Drop the unused 'n' argument to use_goto_tb.
6
7
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
8
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9
---
10
target/arm/translate-a64.c | 25 +++++--------------------
11
1 file changed, 5 insertions(+), 20 deletions(-)
12
13
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
14
index XXXXXXX..XXXXXXX 100644
15
--- a/target/arm/translate-a64.c
16
+++ b/target/arm/translate-a64.c
17
@@ -XXX,XX +XXX,XX @@ static void gen_step_complete_exception(DisasContext *s)
18
s->base.is_jmp = DISAS_NORETURN;
19
}
20
21
-static inline bool use_goto_tb(DisasContext *s, int n, uint64_t dest)
22
+static inline bool use_goto_tb(DisasContext *s, uint64_t dest)
23
{
24
- /* No direct tb linking with singlestep (either QEMU's or the ARM
25
- * debug architecture kind) or deterministic io
26
- */
27
- if (s->base.singlestep_enabled || s->ss_active ||
28
- (tb_cflags(s->base.tb) & CF_LAST_IO)) {
29
+ if (s->ss_active) {
30
return false;
31
}
32
-
33
-#ifndef CONFIG_USER_ONLY
34
- /* Only link tbs from inside the same guest page */
35
- if ((s->base.tb->pc & TARGET_PAGE_MASK) != (dest & TARGET_PAGE_MASK)) {
36
- return false;
37
- }
38
-#endif
39
-
40
- return true;
41
+ return translator_use_goto_tb(&s->base, dest);
42
}
43
44
static inline void gen_goto_tb(DisasContext *s, int n, uint64_t dest)
45
{
46
- const TranslationBlock *tb;
47
-
48
- tb = s->base.tb;
49
- if (use_goto_tb(s, n, dest)) {
50
+ if (use_goto_tb(s, dest)) {
51
tcg_gen_goto_tb(n);
52
gen_a64_set_pc_im(dest);
53
- tcg_gen_exit_tb(tb, n);
54
+ tcg_gen_exit_tb(s->base.tb, n);
55
s->base.is_jmp = DISAS_NORETURN;
56
} else {
57
gen_a64_set_pc_im(dest);
58
--
59
2.25.1
60
61
diff view generated by jsdifflib
Deleted patch
1
Just use translator_use_goto_tb directly at the one call site,
2
rather than maintaining a local wrapper.
3
1
4
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
target/arm/translate.c | 12 +-----------
8
1 file changed, 1 insertion(+), 11 deletions(-)
9
10
diff --git a/target/arm/translate.c b/target/arm/translate.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/target/arm/translate.c
13
+++ b/target/arm/translate.c
14
@@ -XXX,XX +XXX,XX @@ static int disas_dsp_insn(DisasContext *s, uint32_t insn)
15
return 1;
16
}
17
18
-static inline bool use_goto_tb(DisasContext *s, target_ulong dest)
19
-{
20
-#ifndef CONFIG_USER_ONLY
21
- return (s->base.tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK) ||
22
- ((s->base.pc_next - 1) & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK);
23
-#else
24
- return true;
25
-#endif
26
-}
27
-
28
static void gen_goto_ptr(void)
29
{
30
tcg_gen_lookup_and_goto_ptr();
31
@@ -XXX,XX +XXX,XX @@ static void gen_goto_ptr(void)
32
*/
33
static void gen_goto_tb(DisasContext *s, int n, target_ulong dest)
34
{
35
- if (use_goto_tb(s, dest)) {
36
+ if (translator_use_goto_tb(&s->base, dest)) {
37
tcg_gen_goto_tb(n);
38
gen_set_pc_im(s, dest);
39
tcg_gen_exit_tb(s->base.tb, n);
40
--
41
2.25.1
42
43
diff view generated by jsdifflib
Deleted patch
1
Single stepping is not the only reason not to use goto_tb.
2
If goto_tb is disallowed, and single-stepping is not enabled,
3
then use tcg_gen_lookup_and_goto_tb to indirectly chain.
4
1
5
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
7
---
8
target/avr/translate.c | 9 ++++++---
9
1 file changed, 6 insertions(+), 3 deletions(-)
10
11
diff --git a/target/avr/translate.c b/target/avr/translate.c
12
index XXXXXXX..XXXXXXX 100644
13
--- a/target/avr/translate.c
14
+++ b/target/avr/translate.c
15
@@ -XXX,XX +XXX,XX @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
16
{
17
const TranslationBlock *tb = ctx->base.tb;
18
19
- if (!ctx->base.singlestep_enabled) {
20
+ if (translator_use_goto_tb(&ctx->base, dest)) {
21
tcg_gen_goto_tb(n);
22
tcg_gen_movi_i32(cpu_pc, dest);
23
tcg_gen_exit_tb(tb, n);
24
} else {
25
tcg_gen_movi_i32(cpu_pc, dest);
26
- gen_helper_debug(cpu_env);
27
- tcg_gen_exit_tb(NULL, 0);
28
+ if (ctx->base.singlestep_enabled) {
29
+ gen_helper_debug(cpu_env);
30
+ } else {
31
+ tcg_gen_lookup_and_goto_ptr();
32
+ }
33
}
34
ctx->base.is_jmp = DISAS_NORETURN;
35
}
36
--
37
2.25.1
38
39
diff view generated by jsdifflib
Deleted patch
1
All of these helpers end with cpu_loop_exit.
2
1
3
Reviewed-by: Michael Rolnik <mrolnik@gmail.com>
4
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
target/avr/helper.h | 8 ++++----
8
1 file changed, 4 insertions(+), 4 deletions(-)
9
10
diff --git a/target/avr/helper.h b/target/avr/helper.h
11
index XXXXXXX..XXXXXXX 100644
12
--- a/target/avr/helper.h
13
+++ b/target/avr/helper.h
14
@@ -XXX,XX +XXX,XX @@
15
*/
16
17
DEF_HELPER_1(wdr, void, env)
18
-DEF_HELPER_1(debug, void, env)
19
-DEF_HELPER_1(break, void, env)
20
-DEF_HELPER_1(sleep, void, env)
21
-DEF_HELPER_1(unsupported, void, env)
22
+DEF_HELPER_1(debug, noreturn, env)
23
+DEF_HELPER_1(break, noreturn, env)
24
+DEF_HELPER_1(sleep, noreturn, env)
25
+DEF_HELPER_1(unsupported, noreturn, env)
26
DEF_HELPER_3(outb, void, env, i32, i32)
27
DEF_HELPER_2(inb, tl, env, i32)
28
DEF_HELPER_3(fullwr, void, env, i32, i32)
29
--
30
2.25.1
31
32
diff view generated by jsdifflib
Deleted patch
1
The test for singlestepping is done in translator_use_goto_tb,
2
so we may elide it from cris_tr_tb_stop.
3
1
4
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
target/cris/translate.c | 5 ++---
8
1 file changed, 2 insertions(+), 3 deletions(-)
9
10
diff --git a/target/cris/translate.c b/target/cris/translate.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/target/cris/translate.c
13
+++ b/target/cris/translate.c
14
@@ -XXX,XX +XXX,XX @@ static void t_gen_swapr(TCGv d, TCGv s)
15
16
static bool use_goto_tb(DisasContext *dc, target_ulong dest)
17
{
18
- return ((dest ^ dc->base.pc_first) & TARGET_PAGE_MASK) == 0;
19
+ return translator_use_goto_tb(&dc->base, dest);
20
}
21
22
static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest)
23
@@ -XXX,XX +XXX,XX @@ static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
24
* Use a conditional branch if either taken or not-taken path
25
* can use goto_tb. If neither can, then treat it as indirect.
26
*/
27
- if (likely(!dc->base.singlestep_enabled)
28
- && likely(!dc->cpustate_changed)
29
+ if (likely(!dc->cpustate_changed)
30
&& (use_goto_tb(dc, dc->jmp_pc) || use_goto_tb(dc, npc))) {
31
TCGLabel *not_taken = gen_new_label();
32
33
--
34
2.25.1
35
36
diff view generated by jsdifflib
Deleted patch
1
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3
---
4
target/hppa/translate.c | 5 +----
5
1 file changed, 1 insertion(+), 4 deletions(-)
6
1
7
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
8
index XXXXXXX..XXXXXXX 100644
9
--- a/target/hppa/translate.c
10
+++ b/target/hppa/translate.c
11
@@ -XXX,XX +XXX,XX @@ static bool gen_illegal(DisasContext *ctx)
12
13
static bool use_goto_tb(DisasContext *ctx, target_ureg dest)
14
{
15
- /* Suppress goto_tb for page crossing, IO, or single-steping. */
16
- return !(((ctx->base.pc_first ^ dest) & TARGET_PAGE_MASK)
17
- || (tb_cflags(ctx->base.tb) & CF_LAST_IO)
18
- || ctx->base.singlestep_enabled);
19
+ return translator_use_goto_tb(&ctx->base, dest);
20
}
21
22
/* If the next insn is to be nullified, and it's on the same page,
23
--
24
2.25.1
25
26
diff view generated by jsdifflib
Deleted patch
1
Just use translator_use_goto_tb directly at the one call site,
2
rather than maintaining a local wrapper.
3
1
4
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
target/i386/tcg/translate.c | 14 ++------------
8
1 file changed, 2 insertions(+), 12 deletions(-)
9
10
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/target/i386/tcg/translate.c
13
+++ b/target/i386/tcg/translate.c
14
@@ -XXX,XX +XXX,XX @@ static inline int insn_const_size(MemOp ot)
15
}
16
}
17
18
-static inline bool use_goto_tb(DisasContext *s, target_ulong pc)
19
-{
20
-#ifndef CONFIG_USER_ONLY
21
- return (pc & TARGET_PAGE_MASK) == (s->base.tb->pc & TARGET_PAGE_MASK) ||
22
- (pc & TARGET_PAGE_MASK) == (s->pc_start & TARGET_PAGE_MASK);
23
-#else
24
- return true;
25
-#endif
26
-}
27
-
28
-static inline void gen_goto_tb(DisasContext *s, int tb_num, target_ulong eip)
29
+static void gen_goto_tb(DisasContext *s, int tb_num, target_ulong eip)
30
{
31
target_ulong pc = s->cs_base + eip;
32
33
- if (use_goto_tb(s, pc)) {
34
+ if (translator_use_goto_tb(&s->base, pc)) {
35
/* jump to same page: we can use a direct jump */
36
tcg_gen_goto_tb(tb_num);
37
gen_jmp_im(s, eip);
38
--
39
2.25.1
40
41
diff view generated by jsdifflib
Deleted patch
1
Just use translator_use_goto_tb directly at the one call site,
2
rather than maintaining a local wrapper.
3
1
4
Acked-by: Laurent Vivier <laurent@vivier.eu>
5
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
7
---
8
target/m68k/translate.c | 12 +-----------
9
1 file changed, 1 insertion(+), 11 deletions(-)
10
11
diff --git a/target/m68k/translate.c b/target/m68k/translate.c
12
index XXXXXXX..XXXXXXX 100644
13
--- a/target/m68k/translate.c
14
+++ b/target/m68k/translate.c
15
@@ -XXX,XX +XXX,XX @@ static void gen_exit_tb(DisasContext *s)
16
} \
17
} while (0)
18
19
-static inline bool use_goto_tb(DisasContext *s, uint32_t dest)
20
-{
21
-#ifndef CONFIG_USER_ONLY
22
- return (s->base.pc_first & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)
23
- || (s->base.pc_next & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK);
24
-#else
25
- return true;
26
-#endif
27
-}
28
-
29
/* Generate a jump to an immediate address. */
30
static void gen_jmp_tb(DisasContext *s, int n, uint32_t dest)
31
{
32
@@ -XXX,XX +XXX,XX @@ static void gen_jmp_tb(DisasContext *s, int n, uint32_t dest)
33
update_cc_op(s);
34
tcg_gen_movi_i32(QREG_PC, dest);
35
gen_singlestep_exception(s);
36
- } else if (use_goto_tb(s, dest)) {
37
+ } else if (translator_use_goto_tb(&s->base, dest)) {
38
tcg_gen_goto_tb(n);
39
tcg_gen_movi_i32(QREG_PC, dest);
40
tcg_gen_exit_tb(s->base.tb, n);
41
--
42
2.25.1
43
44
diff view generated by jsdifflib
Deleted patch
1
Just use translator_use_goto_tb directly at the one call site,
2
rather than maintaining a local wrapper.
3
1
4
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
target/microblaze/translate.c | 11 +----------
8
1 file changed, 1 insertion(+), 10 deletions(-)
9
10
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/target/microblaze/translate.c
13
+++ b/target/microblaze/translate.c
14
@@ -XXX,XX +XXX,XX @@ static void gen_raise_hw_excp(DisasContext *dc, uint32_t esr_ec)
15
gen_raise_exception_sync(dc, EXCP_HW_EXCP);
16
}
17
18
-static inline bool use_goto_tb(DisasContext *dc, target_ulong dest)
19
-{
20
-#ifndef CONFIG_USER_ONLY
21
- return (dc->base.pc_first & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK);
22
-#else
23
- return true;
24
-#endif
25
-}
26
-
27
static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest)
28
{
29
if (dc->base.singlestep_enabled) {
30
@@ -XXX,XX +XXX,XX @@ static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest)
31
tcg_gen_movi_i32(cpu_pc, dest);
32
gen_helper_raise_exception(cpu_env, tmp);
33
tcg_temp_free_i32(tmp);
34
- } else if (use_goto_tb(dc, dest)) {
35
+ } else if (translator_use_goto_tb(&dc->base, dest)) {
36
tcg_gen_goto_tb(n);
37
tcg_gen_movi_i32(cpu_pc, dest);
38
tcg_gen_exit_tb(dc->base.tb, n);
39
--
40
2.25.1
41
42
diff view generated by jsdifflib
Deleted patch
1
Just use translator_use_goto_tb directly at the one call site,
2
rather than maintaining a local wrapper.
3
1
4
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
target/mips/tcg/translate.c | 17 ++---------------
8
1 file changed, 2 insertions(+), 15 deletions(-)
9
10
diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/target/mips/tcg/translate.c
13
+++ b/target/mips/tcg/translate.c
14
@@ -XXX,XX +XXX,XX @@ static void gen_trap(DisasContext *ctx, uint32_t opc,
15
tcg_temp_free(t1);
16
}
17
18
-static inline bool use_goto_tb(DisasContext *ctx, target_ulong dest)
19
+static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
20
{
21
- if (unlikely(ctx->base.singlestep_enabled)) {
22
- return false;
23
- }
24
-
25
-#ifndef CONFIG_USER_ONLY
26
- return (ctx->base.tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK);
27
-#else
28
- return true;
29
-#endif
30
-}
31
-
32
-static inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
33
-{
34
- if (use_goto_tb(ctx, dest)) {
35
+ if (translator_use_goto_tb(&ctx->base, dest)) {
36
tcg_gen_goto_tb(n);
37
gen_save_pc(dest);
38
tcg_gen_exit_tb(ctx->base.tb, n);
39
--
40
2.25.1
41
42
diff view generated by jsdifflib
Deleted patch
1
Do not emit dead code for the singlestep_enabled case,
2
after having exited the TB with a debug exception.
3
1
4
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
target/mips/tcg/translate.c | 3 ++-
8
1 file changed, 2 insertions(+), 1 deletion(-)
9
10
diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/target/mips/tcg/translate.c
13
+++ b/target/mips/tcg/translate.c
14
@@ -XXX,XX +XXX,XX @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
15
if (ctx->base.singlestep_enabled) {
16
save_cpu_state(ctx, 0);
17
gen_helper_raise_exception_debug(cpu_env);
18
+ } else {
19
+ tcg_gen_lookup_and_goto_ptr();
20
}
21
- tcg_gen_lookup_and_goto_ptr();
22
}
23
}
24
25
--
26
2.25.1
27
28
diff view generated by jsdifflib
Deleted patch
1
Just use translator_use_goto_tb directly at the one call site,
2
rather than maintaining a local wrapper.
3
1
4
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
target/nios2/translate.c | 15 +--------------
8
1 file changed, 1 insertion(+), 14 deletions(-)
9
10
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/target/nios2/translate.c
13
+++ b/target/nios2/translate.c
14
@@ -XXX,XX +XXX,XX @@ static void t_gen_helper_raise_exception(DisasContext *dc,
15
dc->base.is_jmp = DISAS_NORETURN;
16
}
17
18
-static bool use_goto_tb(DisasContext *dc, uint32_t dest)
19
-{
20
- if (unlikely(dc->base.singlestep_enabled)) {
21
- return false;
22
- }
23
-
24
-#ifndef CONFIG_USER_ONLY
25
- return (dc->base.pc_first & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK);
26
-#else
27
- return true;
28
-#endif
29
-}
30
-
31
static void gen_goto_tb(DisasContext *dc, int n, uint32_t dest)
32
{
33
const TranslationBlock *tb = dc->base.tb;
34
35
- if (use_goto_tb(dc, dest)) {
36
+ if (translator_use_goto_tb(&dc->base, dest)) {
37
tcg_gen_goto_tb(n);
38
tcg_gen_movi_tl(cpu_R[R_PC], dest);
39
tcg_gen_exit_tb(tb, n);
40
--
41
2.25.1
42
43
diff view generated by jsdifflib
Deleted patch
1
Reorder the control statements to allow using the page boundary
2
check from translator_use_goto_tb().
3
1
4
Reviewed-by: Stafford Horne <shorne@gmail.com>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
target/openrisc/translate.c | 15 ++++++++-------
8
1 file changed, 8 insertions(+), 7 deletions(-)
9
10
diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/target/openrisc/translate.c
13
+++ b/target/openrisc/translate.c
14
@@ -XXX,XX +XXX,XX @@ static void openrisc_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs)
15
/* fallthru */
16
17
case DISAS_TOO_MANY:
18
- if (unlikely(dc->base.singlestep_enabled)) {
19
- tcg_gen_movi_tl(cpu_pc, jmp_dest);
20
- gen_exception(dc, EXCP_DEBUG);
21
- } else if ((dc->base.pc_first ^ jmp_dest) & TARGET_PAGE_MASK) {
22
- tcg_gen_movi_tl(cpu_pc, jmp_dest);
23
- tcg_gen_lookup_and_goto_ptr();
24
- } else {
25
+ if (translator_use_goto_tb(&dc->base, jmp_dest)) {
26
tcg_gen_goto_tb(0);
27
tcg_gen_movi_tl(cpu_pc, jmp_dest);
28
tcg_gen_exit_tb(dc->base.tb, 0);
29
+ break;
30
+ }
31
+ tcg_gen_movi_tl(cpu_pc, jmp_dest);
32
+ if (unlikely(dc->base.singlestep_enabled)) {
33
+ gen_exception(dc, EXCP_DEBUG);
34
+ } else {
35
+ tcg_gen_lookup_and_goto_ptr();
36
}
37
break;
38
39
--
40
2.25.1
41
42
diff view generated by jsdifflib
Deleted patch
1
Reviewed-by: Luis Pires <luis.pires@eldorado.org.br>
2
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3
---
4
target/ppc/translate.c | 10 +---------
5
1 file changed, 1 insertion(+), 9 deletions(-)
6
1
7
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
8
index XXXXXXX..XXXXXXX 100644
9
--- a/target/ppc/translate.c
10
+++ b/target/ppc/translate.c
11
@@ -XXX,XX +XXX,XX @@ static inline void gen_update_cfar(DisasContext *ctx, target_ulong nip)
12
13
static inline bool use_goto_tb(DisasContext *ctx, target_ulong dest)
14
{
15
- if (unlikely(ctx->singlestep_enabled)) {
16
- return false;
17
- }
18
-
19
-#ifndef CONFIG_USER_ONLY
20
- return (ctx->base.tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK);
21
-#else
22
- return true;
23
-#endif
24
+ return translator_use_goto_tb(&ctx->base, dest);
25
}
26
27
static void gen_lookup_and_goto_ptr(DisasContext *ctx)
28
--
29
2.25.1
30
31
diff view generated by jsdifflib
Deleted patch
1
Just use translator_use_goto_tb directly at the one call site,
2
rather than maintaining a local wrapper.
3
1
4
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
target/riscv/translate.c | 20 +-------------------
8
1 file changed, 1 insertion(+), 19 deletions(-)
9
10
diff --git a/target/riscv/translate.c b/target/riscv/translate.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/target/riscv/translate.c
13
+++ b/target/riscv/translate.c
14
@@ -XXX,XX +XXX,XX @@ static void gen_exception_inst_addr_mis(DisasContext *ctx)
15
generate_exception_mtval(ctx, RISCV_EXCP_INST_ADDR_MIS);
16
}
17
18
-static inline bool use_goto_tb(DisasContext *ctx, target_ulong dest)
19
-{
20
- if (unlikely(ctx->base.singlestep_enabled)) {
21
- return false;
22
- }
23
-
24
-#ifndef CONFIG_USER_ONLY
25
- return (ctx->base.tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK);
26
-#else
27
- return true;
28
-#endif
29
-}
30
-
31
static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
32
{
33
- if (use_goto_tb(ctx, dest)) {
34
- /* chaining is only allowed when the jump is to the same page */
35
+ if (translator_use_goto_tb(&ctx->base, dest)) {
36
tcg_gen_goto_tb(n);
37
tcg_gen_movi_tl(cpu_pc, dest);
38
-
39
- /* No need to check for single stepping here as use_goto_tb() will
40
- * return false in case of single stepping.
41
- */
42
tcg_gen_exit_tb(ctx->base.tb, n);
43
} else {
44
tcg_gen_movi_tl(cpu_pc, dest);
45
--
46
2.25.1
47
48
diff view generated by jsdifflib
Deleted patch
1
Just use translator_use_goto_tb directly at the one call site,
2
rather than maintaining a local wrapper.
3
1
4
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
target/rx/translate.c | 11 +----------
8
1 file changed, 1 insertion(+), 10 deletions(-)
9
10
diff --git a/target/rx/translate.c b/target/rx/translate.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/target/rx/translate.c
13
+++ b/target/rx/translate.c
14
@@ -XXX,XX +XXX,XX @@ void rx_cpu_dump_state(CPUState *cs, FILE *f, int flags)
15
}
16
}
17
18
-static bool use_goto_tb(DisasContext *dc, target_ulong dest)
19
-{
20
- if (unlikely(dc->base.singlestep_enabled)) {
21
- return false;
22
- } else {
23
- return true;
24
- }
25
-}
26
-
27
static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest)
28
{
29
- if (use_goto_tb(dc, dest)) {
30
+ if (translator_use_goto_tb(&dc->base, dest)) {
31
tcg_gen_goto_tb(n);
32
tcg_gen_movi_i32(cpu_pc, dest);
33
tcg_gen_exit_tb(dc->base.tb, n);
34
--
35
2.25.1
36
37
diff view generated by jsdifflib
Deleted patch
1
Reviewed-by: David Hildenbrand <david@redhat.com>
2
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3
---
4
target/s390x/translate.c | 7 +------
5
1 file changed, 1 insertion(+), 6 deletions(-)
6
1
7
diff --git a/target/s390x/translate.c b/target/s390x/translate.c
8
index XXXXXXX..XXXXXXX 100644
9
--- a/target/s390x/translate.c
10
+++ b/target/s390x/translate.c
11
@@ -XXX,XX +XXX,XX @@ static bool use_goto_tb(DisasContext *s, uint64_t dest)
12
if (unlikely(use_exit_tb(s))) {
13
return false;
14
}
15
-#ifndef CONFIG_USER_ONLY
16
- return (dest & TARGET_PAGE_MASK) == (s->base.tb->pc & TARGET_PAGE_MASK) ||
17
- (dest & TARGET_PAGE_MASK) == (s->base.pc_next & TARGET_PAGE_MASK);
18
-#else
19
- return true;
20
-#endif
21
+ return translator_use_goto_tb(&s->base, dest);
22
}
23
24
static void account_noninline_branch(DisasContext *s, int cc_op)
25
--
26
2.25.1
27
28
diff view generated by jsdifflib
Deleted patch
1
We have not needed to end a TB for I/O since ba3e7926691
2
("icount: clean up cpu_can_io at the entry to the block").
3
1
4
In use_goto_tb, the check for singlestep_enabled is in the
5
generic translator_use_goto_tb. In s390x_tr_tb_stop, the
6
check for singlestep_enabled is in the preceding do_debug test.
7
8
Which leaves only FLAG_MASK_PER: fold that test alone into
9
the two callers of use_exit tb.
10
11
Reviewed-by: David Hildenbrand <david@redhat.com>
12
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
13
---
14
target/s390x/translate.c | 11 ++---------
15
1 file changed, 2 insertions(+), 9 deletions(-)
16
17
diff --git a/target/s390x/translate.c b/target/s390x/translate.c
18
index XXXXXXX..XXXXXXX 100644
19
--- a/target/s390x/translate.c
20
+++ b/target/s390x/translate.c
21
@@ -XXX,XX +XXX,XX @@ static void gen_op_calc_cc(DisasContext *s)
22
set_cc_static(s);
23
}
24
25
-static bool use_exit_tb(DisasContext *s)
26
-{
27
- return s->base.singlestep_enabled ||
28
- (tb_cflags(s->base.tb) & CF_LAST_IO) ||
29
- (s->base.tb->flags & FLAG_MASK_PER);
30
-}
31
-
32
static bool use_goto_tb(DisasContext *s, uint64_t dest)
33
{
34
- if (unlikely(use_exit_tb(s))) {
35
+ if (unlikely(s->base.tb->flags & FLAG_MASK_PER)) {
36
return false;
37
}
38
return translator_use_goto_tb(&s->base, dest);
39
@@ -XXX,XX +XXX,XX @@ static void s390x_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs)
40
/* Exit the TB, either by raising a debug exception or by return. */
41
if (dc->do_debug) {
42
gen_exception(EXCP_DEBUG);
43
- } else if (use_exit_tb(dc) ||
44
+ } else if ((dc->base.tb->flags & FLAG_MASK_PER) ||
45
dc->base.is_jmp == DISAS_PC_STALE_NOCHAIN) {
46
tcg_gen_exit_tb(NULL, 0);
47
} else {
48
--
49
2.25.1
50
51
diff view generated by jsdifflib
Deleted patch
1
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3
---
4
target/sh4/translate.c | 11 +++--------
5
1 file changed, 3 insertions(+), 8 deletions(-)
6
1
7
diff --git a/target/sh4/translate.c b/target/sh4/translate.c
8
index XXXXXXX..XXXXXXX 100644
9
--- a/target/sh4/translate.c
10
+++ b/target/sh4/translate.c
11
@@ -XXX,XX +XXX,XX @@ static inline bool use_exit_tb(DisasContext *ctx)
12
return (ctx->tbflags & GUSA_EXCLUSIVE) != 0;
13
}
14
15
-static inline bool use_goto_tb(DisasContext *ctx, target_ulong dest)
16
+static bool use_goto_tb(DisasContext *ctx, target_ulong dest)
17
{
18
- /* Use a direct jump if in same page and singlestep not enabled */
19
- if (unlikely(ctx->base.singlestep_enabled || use_exit_tb(ctx))) {
20
+ if (use_exit_tb(ctx)) {
21
return false;
22
}
23
-#ifndef CONFIG_USER_ONLY
24
- return (ctx->base.tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK);
25
-#else
26
- return true;
27
-#endif
28
+ return translator_use_goto_tb(&ctx->base, dest);
29
}
30
31
static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
32
--
33
2.25.1
34
35
diff view generated by jsdifflib
Deleted patch
1
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3
---
4
target/sparc/translate.c | 19 +++++--------------
5
1 file changed, 5 insertions(+), 14 deletions(-)
6
1
7
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
8
index XXXXXXX..XXXXXXX 100644
9
--- a/target/sparc/translate.c
10
+++ b/target/sparc/translate.c
11
@@ -XXX,XX +XXX,XX @@ static inline TCGv gen_dest_gpr(DisasContext *dc, int reg)
12
}
13
}
14
15
-static inline bool use_goto_tb(DisasContext *s, target_ulong pc,
16
- target_ulong npc)
17
+static bool use_goto_tb(DisasContext *s, target_ulong pc, target_ulong npc)
18
{
19
- if (unlikely(s->base.singlestep_enabled || singlestep)) {
20
- return false;
21
- }
22
-
23
-#ifndef CONFIG_USER_ONLY
24
- return (pc & TARGET_PAGE_MASK) == (s->base.tb->pc & TARGET_PAGE_MASK) &&
25
- (npc & TARGET_PAGE_MASK) == (s->base.tb->pc & TARGET_PAGE_MASK);
26
-#else
27
- return true;
28
-#endif
29
+ return translator_use_goto_tb(&s->base, pc) &&
30
+ translator_use_goto_tb(&s->base, npc);
31
}
32
33
-static inline void gen_goto_tb(DisasContext *s, int tb_num,
34
- target_ulong pc, target_ulong npc)
35
+static void gen_goto_tb(DisasContext *s, int tb_num,
36
+ target_ulong pc, target_ulong npc)
37
{
38
if (use_goto_tb(s, pc, npc)) {
39
/* jump to same page: we can use a direct jump */
40
--
41
2.25.1
42
43
diff view generated by jsdifflib
Deleted patch
1
Just use translator_use_goto_tb directly at the one call site,
2
rather than maintaining a local wrapper.
3
1
4
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
target/tricore/translate.c | 17 ++---------------
8
1 file changed, 2 insertions(+), 15 deletions(-)
9
10
diff --git a/target/tricore/translate.c b/target/tricore/translate.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/target/tricore/translate.c
13
+++ b/target/tricore/translate.c
14
@@ -XXX,XX +XXX,XX @@ static inline void gen_save_pc(target_ulong pc)
15
tcg_gen_movi_tl(cpu_PC, pc);
16
}
17
18
-static inline bool use_goto_tb(DisasContext *ctx, target_ulong dest)
19
-{
20
- if (unlikely(ctx->base.singlestep_enabled)) {
21
- return false;
22
- }
23
-
24
-#ifndef CONFIG_USER_ONLY
25
- return (ctx->base.tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK);
26
-#else
27
- return true;
28
-#endif
29
-}
30
-
31
static void generate_qemu_excp(DisasContext *ctx, int excp)
32
{
33
TCGv_i32 tmp = tcg_const_i32(excp);
34
@@ -XXX,XX +XXX,XX @@ static void generate_qemu_excp(DisasContext *ctx, int excp)
35
tcg_temp_free(tmp);
36
}
37
38
-static inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
39
+static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
40
{
41
- if (use_goto_tb(ctx, dest)) {
42
+ if (translator_use_goto_tb(&ctx->base, dest)) {
43
tcg_gen_goto_tb(n);
44
gen_save_pc(dest);
45
tcg_gen_exit_tb(ctx->base.tb, n);
46
--
47
2.25.1
48
49
diff view generated by jsdifflib
Deleted patch
1
The non-single-step case of gen_goto_tb may use
2
tcg_gen_lookup_and_goto_ptr to indirectly chain.
3
1
4
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
target/tricore/translate.c | 3 ++-
8
1 file changed, 2 insertions(+), 1 deletion(-)
9
10
diff --git a/target/tricore/translate.c b/target/tricore/translate.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/target/tricore/translate.c
13
+++ b/target/tricore/translate.c
14
@@ -XXX,XX +XXX,XX @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
15
gen_save_pc(dest);
16
if (ctx->base.singlestep_enabled) {
17
generate_qemu_excp(ctx, EXCP_DEBUG);
18
+ } else {
19
+ tcg_gen_lookup_and_goto_ptr();
20
}
21
- tcg_gen_exit_tb(NULL, 0);
22
}
23
}
24
25
--
26
2.25.1
27
28
diff view generated by jsdifflib
Deleted patch
1
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
2
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3
---
4
target/xtensa/translate.c | 6 +-----
5
1 file changed, 1 insertion(+), 5 deletions(-)
6
1
7
diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
8
index XXXXXXX..XXXXXXX 100644
9
--- a/target/xtensa/translate.c
10
+++ b/target/xtensa/translate.c
11
@@ -XXX,XX +XXX,XX @@ static void gen_jump(DisasContext *dc, TCGv dest)
12
13
static int adjust_jump_slot(DisasContext *dc, uint32_t dest, int slot)
14
{
15
- if (((dc->base.pc_first ^ dest) & TARGET_PAGE_MASK) != 0) {
16
- return -1;
17
- } else {
18
- return slot;
19
- }
20
+ return translator_use_goto_tb(&dc->base, dest) ? slot : -1;
21
}
22
23
static void gen_jumpi(DisasContext *dc, uint32_t dest, int slot)
24
--
25
2.25.1
26
27
diff view generated by jsdifflib
Deleted patch
1
In tcg_region_prologue_set, we reset TCGContext.code_gen_ptr.
2
So do that after we've used it to dump the prologue contents.
3
1
4
Fixes: b0a0794a0f16
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
tcg/tcg.c | 4 ++--
8
1 file changed, 2 insertions(+), 2 deletions(-)
9
10
diff --git a/tcg/tcg.c b/tcg/tcg.c
11
index XXXXXXX..XXXXXXX 100644
12
--- a/tcg/tcg.c
13
+++ b/tcg/tcg.c
14
@@ -XXX,XX +XXX,XX @@ void tcg_prologue_init(TCGContext *s)
15
(uintptr_t)s->code_buf, prologue_size);
16
#endif
17
18
- tcg_region_prologue_set(s);
19
-
20
#ifdef DEBUG_DISAS
21
if (qemu_loglevel_mask(CPU_LOG_TB_OUT_ASM)) {
22
FILE *logfile = qemu_log_lock();
23
@@ -XXX,XX +XXX,XX @@ void tcg_prologue_init(TCGContext *s)
24
tcg_debug_assert(tcg_code_gen_epilogue != NULL);
25
}
26
#endif
27
+
28
+ tcg_region_prologue_set(s);
29
}
30
31
void tcg_func_start(TCGContext *s)
32
--
33
2.25.1
34
35
diff view generated by jsdifflib
Deleted patch
1
The loop is performing a simple boolean test for the existence
2
of a BP_CPU breakpoint at EIP. Plus it gets the iteration wrong,
3
if we happen to have a BP_GDB breakpoint at the same address.
4
1
5
We have a function for this: cpu_breakpoint_test.
6
7
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
8
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
9
Message-Id: <20210620062317.1399034-1-richard.henderson@linaro.org>
10
---
11
target/i386/tcg/sysemu/bpt_helper.c | 12 +++---------
12
1 file changed, 3 insertions(+), 9 deletions(-)
13
14
diff --git a/target/i386/tcg/sysemu/bpt_helper.c b/target/i386/tcg/sysemu/bpt_helper.c
15
index XXXXXXX..XXXXXXX 100644
16
--- a/target/i386/tcg/sysemu/bpt_helper.c
17
+++ b/target/i386/tcg/sysemu/bpt_helper.c
18
@@ -XXX,XX +XXX,XX @@ void breakpoint_handler(CPUState *cs)
19
{
20
X86CPU *cpu = X86_CPU(cs);
21
CPUX86State *env = &cpu->env;
22
- CPUBreakpoint *bp;
23
24
if (cs->watchpoint_hit) {
25
if (cs->watchpoint_hit->flags & BP_CPU) {
26
@@ -XXX,XX +XXX,XX @@ void breakpoint_handler(CPUState *cs)
27
}
28
}
29
} else {
30
- QTAILQ_FOREACH(bp, &cs->breakpoints, entry) {
31
- if (bp->pc == env->eip) {
32
- if (bp->flags & BP_CPU) {
33
- check_hw_breakpoints(env, true);
34
- raise_exception(env, EXCP01_DB);
35
- }
36
- break;
37
- }
38
+ if (cpu_breakpoint_test(cs, env->eip, BP_CPU)) {
39
+ check_hw_breakpoints(env, true);
40
+ raise_exception(env, EXCP01_DB);
41
}
42
}
43
}
44
--
45
2.25.1
46
47
diff view generated by jsdifflib
Deleted patch
1
This will allow additional code sharing.
2
No functional change.
3
1
4
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
accel/tcg/cpu-exec.c | 30 ++++++++++++++++++++++++++++++
8
accel/tcg/tcg-runtime.c | 22 ----------------------
9
2 files changed, 30 insertions(+), 22 deletions(-)
10
11
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
12
index XXXXXXX..XXXXXXX 100644
13
--- a/accel/tcg/cpu-exec.c
14
+++ b/accel/tcg/cpu-exec.c
15
@@ -XXX,XX +XXX,XX @@
16
#include "exec/cpu-all.h"
17
#include "sysemu/cpu-timers.h"
18
#include "sysemu/replay.h"
19
+#include "exec/helper-proto.h"
20
#include "tb-hash.h"
21
#include "tb-lookup.h"
22
#include "tb-context.h"
23
@@ -XXX,XX +XXX,XX @@ static void init_delay_params(SyncClocks *sc, const CPUState *cpu)
24
}
25
#endif /* CONFIG USER ONLY */
26
27
+/**
28
+ * helper_lookup_tb_ptr: quick check for next tb
29
+ * @env: current cpu state
30
+ *
31
+ * Look for an existing TB matching the current cpu state.
32
+ * If found, return the code pointer. If not found, return
33
+ * the tcg epilogue so that we return into cpu_tb_exec.
34
+ */
35
+const void *HELPER(lookup_tb_ptr)(CPUArchState *env)
36
+{
37
+ CPUState *cpu = env_cpu(env);
38
+ TranslationBlock *tb;
39
+ target_ulong cs_base, pc;
40
+ uint32_t flags;
41
+
42
+ cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags);
43
+
44
+ tb = tb_lookup(cpu, pc, cs_base, flags, curr_cflags(cpu));
45
+ if (tb == NULL) {
46
+ return tcg_code_gen_epilogue;
47
+ }
48
+ qemu_log_mask_and_addr(CPU_LOG_EXEC, pc,
49
+ "Chain %d: %p ["
50
+ TARGET_FMT_lx "/" TARGET_FMT_lx "/%#x] %s\n",
51
+ cpu->cpu_index, tb->tc.ptr, cs_base, pc, flags,
52
+ lookup_symbol(pc));
53
+ return tb->tc.ptr;
54
+}
55
+
56
/* Execute a TB, and fix up the CPU state afterwards if necessary */
57
/*
58
* Disable CFI checks.
59
diff --git a/accel/tcg/tcg-runtime.c b/accel/tcg/tcg-runtime.c
60
index XXXXXXX..XXXXXXX 100644
61
--- a/accel/tcg/tcg-runtime.c
62
+++ b/accel/tcg/tcg-runtime.c
63
@@ -XXX,XX +XXX,XX @@
64
#include "disas/disas.h"
65
#include "exec/log.h"
66
#include "tcg/tcg.h"
67
-#include "tb-lookup.h"
68
69
/* 32-bit helpers */
70
71
@@ -XXX,XX +XXX,XX @@ uint64_t HELPER(ctpop_i64)(uint64_t arg)
72
return ctpop64(arg);
73
}
74
75
-const void *HELPER(lookup_tb_ptr)(CPUArchState *env)
76
-{
77
- CPUState *cpu = env_cpu(env);
78
- TranslationBlock *tb;
79
- target_ulong cs_base, pc;
80
- uint32_t flags;
81
-
82
- cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags);
83
-
84
- tb = tb_lookup(cpu, pc, cs_base, flags, curr_cflags(cpu));
85
- if (tb == NULL) {
86
- return tcg_code_gen_epilogue;
87
- }
88
- qemu_log_mask_and_addr(CPU_LOG_EXEC, pc,
89
- "Chain %d: %p ["
90
- TARGET_FMT_lx "/" TARGET_FMT_lx "/%#x] %s\n",
91
- cpu->cpu_index, tb->tc.ptr, cs_base, pc, flags,
92
- lookup_symbol(pc));
93
- return tb->tc.ptr;
94
-}
95
-
96
void HELPER(exit_atomic)(CPUArchState *env)
97
{
98
cpu_loop_exit_atomic(env_cpu(env), GETPC());
99
--
100
2.25.1
101
102
diff view generated by jsdifflib
Deleted patch
1
Now that we've moved helper_lookup_tb_ptr, the only user
2
of tb-lookup.h is cpu-exec.c; merge the contents in.
3
1
4
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
accel/tcg/tb-lookup.h | 49 -------------------------------------------
8
accel/tcg/cpu-exec.c | 31 ++++++++++++++++++++++++++-
9
2 files changed, 30 insertions(+), 50 deletions(-)
10
delete mode 100644 accel/tcg/tb-lookup.h
11
12
diff --git a/accel/tcg/tb-lookup.h b/accel/tcg/tb-lookup.h
13
deleted file mode 100644
14
index XXXXXXX..XXXXXXX
15
--- a/accel/tcg/tb-lookup.h
16
+++ /dev/null
17
@@ -XXX,XX +XXX,XX @@
18
-/*
19
- * Copyright (C) 2017, Emilio G. Cota <cota@braap.org>
20
- *
21
- * License: GNU GPL, version 2 or later.
22
- * See the COPYING file in the top-level directory.
23
- */
24
-#ifndef EXEC_TB_LOOKUP_H
25
-#define EXEC_TB_LOOKUP_H
26
-
27
-#ifdef NEED_CPU_H
28
-#include "cpu.h"
29
-#else
30
-#include "exec/poison.h"
31
-#endif
32
-
33
-#include "exec/exec-all.h"
34
-#include "tb-hash.h"
35
-
36
-/* Might cause an exception, so have a longjmp destination ready */
37
-static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc,
38
- target_ulong cs_base,
39
- uint32_t flags, uint32_t cflags)
40
-{
41
- TranslationBlock *tb;
42
- uint32_t hash;
43
-
44
- /* we should never be trying to look up an INVALID tb */
45
- tcg_debug_assert(!(cflags & CF_INVALID));
46
-
47
- hash = tb_jmp_cache_hash_func(pc);
48
- tb = qatomic_rcu_read(&cpu->tb_jmp_cache[hash]);
49
-
50
- if (likely(tb &&
51
- tb->pc == pc &&
52
- tb->cs_base == cs_base &&
53
- tb->flags == flags &&
54
- tb->trace_vcpu_dstate == *cpu->trace_dstate &&
55
- tb_cflags(tb) == cflags)) {
56
- return tb;
57
- }
58
- tb = tb_htable_lookup(cpu, pc, cs_base, flags, cflags);
59
- if (tb == NULL) {
60
- return NULL;
61
- }
62
- qatomic_set(&cpu->tb_jmp_cache[hash], tb);
63
- return tb;
64
-}
65
-
66
-#endif /* EXEC_TB_LOOKUP_H */
67
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
68
index XXXXXXX..XXXXXXX 100644
69
--- a/accel/tcg/cpu-exec.c
70
+++ b/accel/tcg/cpu-exec.c
71
@@ -XXX,XX +XXX,XX @@
72
#include "sysemu/replay.h"
73
#include "exec/helper-proto.h"
74
#include "tb-hash.h"
75
-#include "tb-lookup.h"
76
#include "tb-context.h"
77
#include "internal.h"
78
79
@@ -XXX,XX +XXX,XX @@ static void init_delay_params(SyncClocks *sc, const CPUState *cpu)
80
}
81
#endif /* CONFIG USER ONLY */
82
83
+/* Might cause an exception, so have a longjmp destination ready */
84
+static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc,
85
+ target_ulong cs_base,
86
+ uint32_t flags, uint32_t cflags)
87
+{
88
+ TranslationBlock *tb;
89
+ uint32_t hash;
90
+
91
+ /* we should never be trying to look up an INVALID tb */
92
+ tcg_debug_assert(!(cflags & CF_INVALID));
93
+
94
+ hash = tb_jmp_cache_hash_func(pc);
95
+ tb = qatomic_rcu_read(&cpu->tb_jmp_cache[hash]);
96
+
97
+ if (likely(tb &&
98
+ tb->pc == pc &&
99
+ tb->cs_base == cs_base &&
100
+ tb->flags == flags &&
101
+ tb->trace_vcpu_dstate == *cpu->trace_dstate &&
102
+ tb_cflags(tb) == cflags)) {
103
+ return tb;
104
+ }
105
+ tb = tb_htable_lookup(cpu, pc, cs_base, flags, cflags);
106
+ if (tb == NULL) {
107
+ return NULL;
108
+ }
109
+ qatomic_set(&cpu->tb_jmp_cache[hash], tb);
110
+ return tb;
111
+}
112
+
113
/**
114
* helper_lookup_tb_ptr: quick check for next tb
115
* @env: current cpu state
116
--
117
2.25.1
118
119
diff view generated by jsdifflib
Deleted patch
1
Split out CPU_LOG_EXEC and CPU_LOG_TB_CPU logging from
2
cpu_tb_exec to a new function. Perform only one pc
3
range check after a combined mask check.
4
1
5
Use the new function in lookup_tb_ptr. This enables
6
CPU_LOG_TB_CPU between indirectly chained tbs.
7
8
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9
---
10
accel/tcg/cpu-exec.c | 61 ++++++++++++++++++++++++--------------------
11
1 file changed, 34 insertions(+), 27 deletions(-)
12
13
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
14
index XXXXXXX..XXXXXXX 100644
15
--- a/accel/tcg/cpu-exec.c
16
+++ b/accel/tcg/cpu-exec.c
17
@@ -XXX,XX +XXX,XX @@ static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc,
18
return tb;
19
}
20
21
+static inline void log_cpu_exec(target_ulong pc, CPUState *cpu,
22
+ const TranslationBlock *tb)
23
+{
24
+ if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_CPU | CPU_LOG_EXEC))
25
+ && qemu_log_in_addr_range(pc)) {
26
+
27
+ qemu_log_mask(CPU_LOG_EXEC,
28
+ "Trace %d: %p [" TARGET_FMT_lx
29
+ "/" TARGET_FMT_lx "/%#x] %s\n",
30
+ cpu->cpu_index, tb->tc.ptr, tb->cs_base, pc, tb->flags,
31
+ lookup_symbol(pc));
32
+
33
+#if defined(DEBUG_DISAS)
34
+ if (qemu_loglevel_mask(CPU_LOG_TB_CPU)) {
35
+ FILE *logfile = qemu_log_lock();
36
+ int flags = 0;
37
+
38
+ if (qemu_loglevel_mask(CPU_LOG_TB_FPU)) {
39
+ flags |= CPU_DUMP_FPU;
40
+ }
41
+#if defined(TARGET_I386)
42
+ flags |= CPU_DUMP_CCOP;
43
+#endif
44
+ log_cpu_state(cpu, flags);
45
+ qemu_log_unlock(logfile);
46
+ }
47
+#endif /* DEBUG_DISAS */
48
+ }
49
+}
50
+
51
/**
52
* helper_lookup_tb_ptr: quick check for next tb
53
* @env: current cpu state
54
@@ -XXX,XX +XXX,XX @@ const void *HELPER(lookup_tb_ptr)(CPUArchState *env)
55
if (tb == NULL) {
56
return tcg_code_gen_epilogue;
57
}
58
- qemu_log_mask_and_addr(CPU_LOG_EXEC, pc,
59
- "Chain %d: %p ["
60
- TARGET_FMT_lx "/" TARGET_FMT_lx "/%#x] %s\n",
61
- cpu->cpu_index, tb->tc.ptr, cs_base, pc, flags,
62
- lookup_symbol(pc));
63
+
64
+ log_cpu_exec(pc, cpu, tb);
65
+
66
return tb->tc.ptr;
67
}
68
69
@@ -XXX,XX +XXX,XX @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit)
70
TranslationBlock *last_tb;
71
const void *tb_ptr = itb->tc.ptr;
72
73
- qemu_log_mask_and_addr(CPU_LOG_EXEC, itb->pc,
74
- "Trace %d: %p ["
75
- TARGET_FMT_lx "/" TARGET_FMT_lx "/%#x] %s\n",
76
- cpu->cpu_index, itb->tc.ptr,
77
- itb->cs_base, itb->pc, itb->flags,
78
- lookup_symbol(itb->pc));
79
-
80
-#if defined(DEBUG_DISAS)
81
- if (qemu_loglevel_mask(CPU_LOG_TB_CPU)
82
- && qemu_log_in_addr_range(itb->pc)) {
83
- FILE *logfile = qemu_log_lock();
84
- int flags = 0;
85
- if (qemu_loglevel_mask(CPU_LOG_TB_FPU)) {
86
- flags |= CPU_DUMP_FPU;
87
- }
88
-#if defined(TARGET_I386)
89
- flags |= CPU_DUMP_CCOP;
90
-#endif
91
- log_cpu_state(cpu, flags);
92
- qemu_log_unlock(logfile);
93
- }
94
-#endif /* DEBUG_DISAS */
95
+ log_cpu_exec(itb->pc, cpu, itb);
96
97
qemu_thread_jit_execute();
98
ret = tcg_qemu_tb_exec(env, tb_ptr);
99
--
100
2.25.1
101
102
diff view generated by jsdifflib
Deleted patch
1
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3
---
4
accel/tcg/cpu-exec.c | 6 +++---
5
1 file changed, 3 insertions(+), 3 deletions(-)
6
1
7
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
8
index XXXXXXX..XXXXXXX 100644
9
--- a/accel/tcg/cpu-exec.c
10
+++ b/accel/tcg/cpu-exec.c
11
@@ -XXX,XX +XXX,XX @@ static inline void log_cpu_exec(target_ulong pc, CPUState *cpu,
12
13
qemu_log_mask(CPU_LOG_EXEC,
14
"Trace %d: %p [" TARGET_FMT_lx
15
- "/" TARGET_FMT_lx "/%#x] %s\n",
16
- cpu->cpu_index, tb->tc.ptr, tb->cs_base, pc, tb->flags,
17
- lookup_symbol(pc));
18
+ "/" TARGET_FMT_lx "/%08x/%08x] %s\n",
19
+ cpu->cpu_index, tb->tc.ptr, tb->cs_base, pc,
20
+ tb->flags, tb->cflags, lookup_symbol(pc));
21
22
#if defined(DEBUG_DISAS)
23
if (qemu_loglevel_mask(CPU_LOG_TB_CPU)) {
24
--
25
2.25.1
26
27
diff view generated by jsdifflib
Deleted patch
1
Since 6eea04347eb6, all tcg backends support goto_ptr.
2
Remove the conditional, making support mandatory.
3
1
4
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
---
7
include/tcg/tcg-opc.h | 3 +--
8
tcg/aarch64/tcg-target.h | 1 -
9
tcg/arm/tcg-target.h | 1 -
10
tcg/i386/tcg-target.h | 1 -
11
tcg/mips/tcg-target.h | 1 -
12
tcg/ppc/tcg-target.h | 1 -
13
tcg/riscv/tcg-target.h | 1 -
14
tcg/s390/tcg-target.h | 1 -
15
tcg/sparc/tcg-target.h | 1 -
16
tcg/tci/tcg-target.h | 1 -
17
tcg/tcg-op.c | 2 +-
18
tcg/tcg.c | 8 ++------
19
12 files changed, 4 insertions(+), 18 deletions(-)
20
21
diff --git a/include/tcg/tcg-opc.h b/include/tcg/tcg-opc.h
22
index XXXXXXX..XXXXXXX 100644
23
--- a/include/tcg/tcg-opc.h
24
+++ b/include/tcg/tcg-opc.h
25
@@ -XXX,XX +XXX,XX @@ DEF(insn_start, 0, 0, TLADDR_ARGS * TARGET_INSN_START_WORDS,
26
TCG_OPF_NOT_PRESENT)
27
DEF(exit_tb, 0, 0, 1, TCG_OPF_BB_EXIT | TCG_OPF_BB_END)
28
DEF(goto_tb, 0, 0, 1, TCG_OPF_BB_EXIT | TCG_OPF_BB_END)
29
-DEF(goto_ptr, 0, 1, 0,
30
- TCG_OPF_BB_EXIT | TCG_OPF_BB_END | IMPL(TCG_TARGET_HAS_goto_ptr))
31
+DEF(goto_ptr, 0, 1, 0, TCG_OPF_BB_EXIT | TCG_OPF_BB_END)
32
33
DEF(plugin_cb_start, 0, 0, 3, TCG_OPF_NOT_PRESENT)
34
DEF(plugin_cb_end, 0, 0, 0, TCG_OPF_NOT_PRESENT)
35
diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h
36
index XXXXXXX..XXXXXXX 100644
37
--- a/tcg/aarch64/tcg-target.h
38
+++ b/tcg/aarch64/tcg-target.h
39
@@ -XXX,XX +XXX,XX @@ typedef enum {
40
#define TCG_TARGET_HAS_mulsh_i32 0
41
#define TCG_TARGET_HAS_extrl_i64_i32 0
42
#define TCG_TARGET_HAS_extrh_i64_i32 0
43
-#define TCG_TARGET_HAS_goto_ptr 1
44
#define TCG_TARGET_HAS_qemu_st8_i32 0
45
46
#define TCG_TARGET_HAS_div_i64 1
47
diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h
48
index XXXXXXX..XXXXXXX 100644
49
--- a/tcg/arm/tcg-target.h
50
+++ b/tcg/arm/tcg-target.h
51
@@ -XXX,XX +XXX,XX @@ extern bool use_neon_instructions;
52
#define TCG_TARGET_HAS_mulsh_i32 0
53
#define TCG_TARGET_HAS_div_i32 use_idiv_instructions
54
#define TCG_TARGET_HAS_rem_i32 0
55
-#define TCG_TARGET_HAS_goto_ptr 1
56
#define TCG_TARGET_HAS_direct_jump 0
57
#define TCG_TARGET_HAS_qemu_st8_i32 0
58
59
diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h
60
index XXXXXXX..XXXXXXX 100644
61
--- a/tcg/i386/tcg-target.h
62
+++ b/tcg/i386/tcg-target.h
63
@@ -XXX,XX +XXX,XX @@ extern bool have_movbe;
64
#define TCG_TARGET_HAS_muls2_i32 1
65
#define TCG_TARGET_HAS_muluh_i32 0
66
#define TCG_TARGET_HAS_mulsh_i32 0
67
-#define TCG_TARGET_HAS_goto_ptr 1
68
#define TCG_TARGET_HAS_direct_jump 1
69
70
#if TCG_TARGET_REG_BITS == 64
71
diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h
72
index XXXXXXX..XXXXXXX 100644
73
--- a/tcg/mips/tcg-target.h
74
+++ b/tcg/mips/tcg-target.h
75
@@ -XXX,XX +XXX,XX @@ extern bool use_mips32r2_instructions;
76
#define TCG_TARGET_HAS_muluh_i32 1
77
#define TCG_TARGET_HAS_mulsh_i32 1
78
#define TCG_TARGET_HAS_bswap32_i32 1
79
-#define TCG_TARGET_HAS_goto_ptr 1
80
#define TCG_TARGET_HAS_direct_jump 1
81
82
#if TCG_TARGET_REG_BITS == 64
83
diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h
84
index XXXXXXX..XXXXXXX 100644
85
--- a/tcg/ppc/tcg-target.h
86
+++ b/tcg/ppc/tcg-target.h
87
@@ -XXX,XX +XXX,XX @@ extern bool have_vsx;
88
#define TCG_TARGET_HAS_muls2_i32 0
89
#define TCG_TARGET_HAS_muluh_i32 1
90
#define TCG_TARGET_HAS_mulsh_i32 1
91
-#define TCG_TARGET_HAS_goto_ptr 1
92
#define TCG_TARGET_HAS_direct_jump 1
93
#define TCG_TARGET_HAS_qemu_st8_i32 0
94
95
diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h
96
index XXXXXXX..XXXXXXX 100644
97
--- a/tcg/riscv/tcg-target.h
98
+++ b/tcg/riscv/tcg-target.h
99
@@ -XXX,XX +XXX,XX @@ typedef enum {
100
#define TCG_TARGET_CALL_STACK_OFFSET 0
101
102
/* optional instructions */
103
-#define TCG_TARGET_HAS_goto_ptr 1
104
#define TCG_TARGET_HAS_movcond_i32 0
105
#define TCG_TARGET_HAS_div_i32 1
106
#define TCG_TARGET_HAS_rem_i32 1
107
diff --git a/tcg/s390/tcg-target.h b/tcg/s390/tcg-target.h
108
index XXXXXXX..XXXXXXX 100644
109
--- a/tcg/s390/tcg-target.h
110
+++ b/tcg/s390/tcg-target.h
111
@@ -XXX,XX +XXX,XX @@ extern uint64_t s390_facilities;
112
#define TCG_TARGET_HAS_mulsh_i32 0
113
#define TCG_TARGET_HAS_extrl_i64_i32 0
114
#define TCG_TARGET_HAS_extrh_i64_i32 0
115
-#define TCG_TARGET_HAS_goto_ptr 1
116
#define TCG_TARGET_HAS_direct_jump (s390_facilities & FACILITY_GEN_INST_EXT)
117
#define TCG_TARGET_HAS_qemu_st8_i32 0
118
119
diff --git a/tcg/sparc/tcg-target.h b/tcg/sparc/tcg-target.h
120
index XXXXXXX..XXXXXXX 100644
121
--- a/tcg/sparc/tcg-target.h
122
+++ b/tcg/sparc/tcg-target.h
123
@@ -XXX,XX +XXX,XX @@ extern bool use_vis3_instructions;
124
#define TCG_TARGET_HAS_muls2_i32 1
125
#define TCG_TARGET_HAS_muluh_i32 0
126
#define TCG_TARGET_HAS_mulsh_i32 0
127
-#define TCG_TARGET_HAS_goto_ptr 1
128
#define TCG_TARGET_HAS_direct_jump 1
129
#define TCG_TARGET_HAS_qemu_st8_i32 0
130
131
diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h
132
index XXXXXXX..XXXXXXX 100644
133
--- a/tcg/tci/tcg-target.h
134
+++ b/tcg/tci/tcg-target.h
135
@@ -XXX,XX +XXX,XX @@
136
#define TCG_TARGET_HAS_muls2_i32 1
137
#define TCG_TARGET_HAS_muluh_i32 0
138
#define TCG_TARGET_HAS_mulsh_i32 0
139
-#define TCG_TARGET_HAS_goto_ptr 1
140
#define TCG_TARGET_HAS_direct_jump 0
141
#define TCG_TARGET_HAS_qemu_st8_i32 0
142
143
diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
144
index XXXXXXX..XXXXXXX 100644
145
--- a/tcg/tcg-op.c
146
+++ b/tcg/tcg-op.c
147
@@ -XXX,XX +XXX,XX @@ void tcg_gen_goto_tb(unsigned idx)
148
149
void tcg_gen_lookup_and_goto_ptr(void)
150
{
151
- if (TCG_TARGET_HAS_goto_ptr && !qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) {
152
+ if (!qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) {
153
TCGv_ptr ptr;
154
155
plugin_gen_disable_mem_helpers();
156
diff --git a/tcg/tcg.c b/tcg/tcg.c
157
index XXXXXXX..XXXXXXX 100644
158
--- a/tcg/tcg.c
159
+++ b/tcg/tcg.c
160
@@ -XXX,XX +XXX,XX @@ void tcg_prologue_init(TCGContext *s)
161
* For tci, we use NULL as the signal to return from the interpreter,
162
* so skip this check.
163
*/
164
- if (TCG_TARGET_HAS_goto_ptr) {
165
- tcg_debug_assert(tcg_code_gen_epilogue != NULL);
166
- }
167
+ tcg_debug_assert(tcg_code_gen_epilogue != NULL);
168
#endif
169
170
tcg_region_prologue_set(s);
171
@@ -XXX,XX +XXX,XX @@ bool tcg_op_supported(TCGOpcode op)
172
case INDEX_op_insn_start:
173
case INDEX_op_exit_tb:
174
case INDEX_op_goto_tb:
175
+ case INDEX_op_goto_ptr:
176
case INDEX_op_qemu_ld_i32:
177
case INDEX_op_qemu_st_i32:
178
case INDEX_op_qemu_ld_i64:
179
@@ -XXX,XX +XXX,XX @@ bool tcg_op_supported(TCGOpcode op)
180
case INDEX_op_qemu_st8_i32:
181
return TCG_TARGET_HAS_qemu_st8_i32;
182
183
- case INDEX_op_goto_ptr:
184
- return TCG_TARGET_HAS_goto_ptr;
185
-
186
case INDEX_op_mov_i32:
187
case INDEX_op_setcond_i32:
188
case INDEX_op_brcond_i32:
189
--
190
2.25.1
191
192
diff view generated by jsdifflib
1
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
1
From: Thomas Huth <thuth@redhat.com>
2
3
Use target_words_bigendian() instead of an ifdef.
4
5
Remove CONFIG_RISCV_DIS from the check for riscv as a host; this is
6
a poisoned identifier, and anyway will always be set by meson.build
7
when building on a riscv host.
8
9
Signed-off-by: Thomas Huth <thuth@redhat.com>
10
Message-Id: <20230508133745.109463-3-thuth@redhat.com>
11
[rth: Type change done in a separate patch]
2
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
12
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3
---
13
---
4
cpu.c | 13 +++++++++----
14
disas/disas.c | 12 ++++++------
5
trace-events | 5 +++++
15
disas/meson.build | 3 ++-
6
2 files changed, 14 insertions(+), 4 deletions(-)
16
2 files changed, 8 insertions(+), 7 deletions(-)
7
17
8
diff --git a/cpu.c b/cpu.c
18
diff --git a/disas/disas.c b/disas/disas.c
9
index XXXXXXX..XXXXXXX 100644
19
index XXXXXXX..XXXXXXX 100644
10
--- a/cpu.c
20
--- a/disas/disas.c
11
+++ b/cpu.c
21
+++ b/disas/disas.c
12
@@ -XXX,XX +XXX,XX @@
22
@@ -XXX,XX +XXX,XX @@ void disas_initialize_debug_target(CPUDebug *s, CPUState *cpu)
13
#include "exec/translate-all.h"
23
s->cpu = cpu;
14
#include "exec/log.h"
24
s->info.read_memory_func = target_read_memory;
15
#include "hw/core/accel-cpu.h"
25
s->info.print_address_func = print_address;
16
+#include "trace/trace-root.h"
26
-#if TARGET_BIG_ENDIAN
17
27
- s->info.endian = BFD_ENDIAN_BIG;
18
uintptr_t qemu_host_page_size;
28
-#else
19
intptr_t qemu_host_page_mask;
29
- s->info.endian = BFD_ENDIAN_LITTLE;
20
@@ -XXX,XX +XXX,XX @@ int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags,
30
-#endif
21
if (breakpoint) {
31
+ if (target_words_bigendian()) {
22
*breakpoint = bp;
32
+ s->info.endian = BFD_ENDIAN_BIG;
23
}
33
+ } else {
24
+
34
+ s->info.endian = BFD_ENDIAN_LITTLE;
25
+ trace_breakpoint_insert(cpu->cpu_index, pc, flags);
35
+ }
26
return 0;
36
27
}
37
CPUClass *cc = CPU_GET_CLASS(cpu);
28
38
if (cc->disas_set_info) {
29
@@ -XXX,XX +XXX,XX @@ int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags)
39
@@ -XXX,XX +XXX,XX @@ static void initialize_debug_host(CPUDebug *s)
30
}
40
# ifdef _ARCH_PPC64
31
41
s->info.cap_mode = CS_MODE_64;
32
/* Remove a specific breakpoint by reference. */
42
# endif
33
-void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *breakpoint)
43
-#elif defined(__riscv) && defined(CONFIG_RISCV_DIS)
34
+void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *bp)
44
+#elif defined(__riscv)
35
{
45
#if defined(_ILP32) || (__riscv_xlen == 32)
36
- QTAILQ_REMOVE(&cpu->breakpoints, breakpoint, entry);
46
s->info.print_insn = print_insn_riscv32;
37
+ QTAILQ_REMOVE(&cpu->breakpoints, bp, entry);
47
#elif defined(_LP64)
38
48
diff --git a/disas/meson.build b/disas/meson.build
39
- breakpoint_invalidate(cpu, breakpoint->pc);
40
+ breakpoint_invalidate(cpu, bp->pc);
41
42
- g_free(breakpoint);
43
+ trace_breakpoint_remove(cpu->cpu_index, bp->pc, bp->flags);
44
+ g_free(bp);
45
}
46
47
/* Remove all matching breakpoints. */
48
@@ -XXX,XX +XXX,XX @@ void cpu_single_step(CPUState *cpu, int enabled)
49
/* XXX: only flush what is necessary */
50
tb_flush(cpu);
51
}
52
+ trace_breakpoint_singlestep(cpu->cpu_index, enabled);
53
}
54
}
55
56
diff --git a/trace-events b/trace-events
57
index XXXXXXX..XXXXXXX 100644
49
index XXXXXXX..XXXXXXX 100644
58
--- a/trace-events
50
--- a/disas/meson.build
59
+++ b/trace-events
51
+++ b/disas/meson.build
60
@@ -XXX,XX +XXX,XX @@
52
@@ -XXX,XX +XXX,XX @@ common_ss.add(when: 'CONFIG_SH4_DIS', if_true: files('sh4.c'))
61
#
53
common_ss.add(when: 'CONFIG_SPARC_DIS', if_true: files('sparc.c'))
62
# The <format-string> should be a sprintf()-compatible format string.
54
common_ss.add(when: 'CONFIG_XTENSA_DIS', if_true: files('xtensa.c'))
63
55
common_ss.add(when: capstone, if_true: [files('capstone.c'), capstone])
64
+# cpu.c
56
+common_ss.add(files('disas.c'))
65
+breakpoint_insert(int cpu_index, uint64_t pc, int flags) "cpu=%d pc=0x%" PRIx64 " flags=0x%x"
57
66
+breakpoint_remove(int cpu_index, uint64_t pc, int flags) "cpu=%d pc=0x%" PRIx64 " flags=0x%x"
58
softmmu_ss.add(files('disas-mon.c'))
67
+breakpoint_singlestep(int cpu_index, int enabled) "cpu=%d enable=%d"
59
-specific_ss.add(files('disas.c'), capstone)
68
+
60
+specific_ss.add(capstone)
69
# dma-helpers.c
70
dma_blk_io(void *dbs, void *bs, int64_t offset, bool to_dev) "dbs=%p bs=%p offset=%" PRId64 " to_dev=%d"
71
dma_aio_cancel(void *dbs) "dbs=%p"
72
--
61
--
73
2.25.1
62
2.34.1
74
75
diff view generated by jsdifflib