* [PATCH] tcg: remove singlestep_enabled from DisasContextBase
@ 2024-10-10 8:36 Paolo Bonzini
2024-10-13 17:04 ` Richard Henderson
2024-10-14 22:09 ` Philippe Mathieu-Daudé
0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2024-10-10 8:36 UTC (permalink / raw)
To: qemu-devel
It is used in a couple of places only, both within the same target. Those can
use the cflags just as well, so remove the separate field.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
include/exec/translator.h | 2 --
accel/tcg/translator.c | 1 -
target/mips/tcg/translate.c | 5 +++--
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/include/exec/translator.h b/include/exec/translator.h
index 25004dfb76e..d8dcb77b5f4 100644
--- a/include/exec/translator.h
+++ b/include/exec/translator.h
@@ -71,7 +71,6 @@ typedef enum DisasJumpType {
* @is_jmp: What instruction to disassemble next.
* @num_insns: Number of translated instructions (including current).
* @max_insns: Maximum number of instructions to be translated in this TB.
- * @singlestep_enabled: "Hardware" single stepping enabled.
* @plugin_enabled: TCG plugin enabled in this TB.
* @fake_insn: True if translator_fake_ldb used.
* @insn_start: The last op emitted by the insn_start hook,
@@ -86,7 +85,6 @@ struct DisasContextBase {
DisasJumpType is_jmp;
int num_insns;
int max_insns;
- bool singlestep_enabled;
bool plugin_enabled;
bool fake_insn;
struct TCGOp *insn_start;
diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c
index 113edcffe35..cbad00a5172 100644
--- a/accel/tcg/translator.c
+++ b/accel/tcg/translator.c
@@ -129,7 +129,6 @@ void translator_loop(CPUState *cpu, TranslationBlock *tb, int *max_insns,
db->is_jmp = DISAS_NEXT;
db->num_insns = 0;
db->max_insns = *max_insns;
- db->singlestep_enabled = cflags & CF_SINGLE_STEP;
db->insn_start = NULL;
db->fake_insn = false;
db->host_addr[0] = host_pc;
diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
index 333469b268e..50d8537a3b3 100644
--- a/target/mips/tcg/translate.c
+++ b/target/mips/tcg/translate.c
@@ -15362,7 +15362,8 @@ static void mips_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
* hardware does (e.g. if a delay slot instruction faults, the
* reported PC is the PC of the branch).
*/
- if (ctx->base.singlestep_enabled && (ctx->hflags & MIPS_HFLAG_BMASK)) {
+ if ((tb_cflags(ctx->base.tb) & CF_SINGLE_STEP) &&
+ (ctx->hflags & MIPS_HFLAG_BMASK)) {
ctx->base.max_insns = 2;
}
@@ -15445,7 +15446,7 @@ static void mips_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
* together with its delay slot.
*/
if (ctx->base.pc_next - ctx->page_start >= TARGET_PAGE_SIZE
- && !ctx->base.singlestep_enabled) {
+ && !(tb_cflags(ctx->base.tb) & CF_SINGLE_STEP)) {
ctx->base.is_jmp = DISAS_TOO_MANY;
}
}
--
2.46.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] tcg: remove singlestep_enabled from DisasContextBase
2024-10-10 8:36 [PATCH] tcg: remove singlestep_enabled from DisasContextBase Paolo Bonzini
@ 2024-10-13 17:04 ` Richard Henderson
2024-10-14 22:09 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2024-10-13 17:04 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel
On 10/10/24 01:36, Paolo Bonzini wrote:
> It is used in a couple of places only, both within the same target. Those can
> use the cflags just as well, so remove the separate field.
>
> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
> ---
> include/exec/translator.h | 2 --
> accel/tcg/translator.c | 1 -
> target/mips/tcg/translate.c | 5 +++--
> 3 files changed, 3 insertions(+), 5 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
And queued.
r~
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] tcg: remove singlestep_enabled from DisasContextBase
2024-10-10 8:36 [PATCH] tcg: remove singlestep_enabled from DisasContextBase Paolo Bonzini
2024-10-13 17:04 ` Richard Henderson
@ 2024-10-14 22:09 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-10-14 22:09 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel
On 10/10/24 05:36, Paolo Bonzini wrote:
> It is used in a couple of places only, both within the same target. Those can
> use the cflags just as well, so remove the separate field.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> include/exec/translator.h | 2 --
> accel/tcg/translator.c | 1 -
> target/mips/tcg/translate.c | 5 +++--
> 3 files changed, 3 insertions(+), 5 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-14 22:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-10 8:36 [PATCH] tcg: remove singlestep_enabled from DisasContextBase Paolo Bonzini
2024-10-13 17:04 ` Richard Henderson
2024-10-14 22:09 ` Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).