[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 45/55] target/microblaze: Prefer fast cpu_env() over slower CPU QO
From: |
Thomas Huth |
Subject: |
[PULL 45/55] target/microblaze: Prefer fast cpu_env() over slower CPU QOM cast macro |
Date: |
Tue, 12 Mar 2024 13:43:29 +0100 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240129164514.73104-18-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
target/microblaze/gdbstub.c | 3 +--
target/microblaze/helper.c | 3 +--
target/microblaze/translate.c | 6 ++----
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/target/microblaze/gdbstub.c b/target/microblaze/gdbstub.c
index eb168d1007..09d74e164d 100644
--- a/target/microblaze/gdbstub.c
+++ b/target/microblaze/gdbstub.c
@@ -110,9 +110,8 @@ int mb_cpu_gdb_read_stack_protect(CPUState *cs, GByteArray
*mem_buf, int n)
int mb_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
{
- MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
CPUClass *cc = CPU_GET_CLASS(cs);
- CPUMBState *env = &cpu->env;
+ CPUMBState *env = cpu_env(cs);
uint32_t tmp;
if (n > cc->gdb_num_core_regs) {
diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c
index 460eee0cf5..d25c9eb4d3 100644
--- a/target/microblaze/helper.c
+++ b/target/microblaze/helper.c
@@ -252,8 +252,7 @@ hwaddr mb_cpu_get_phys_page_attrs_debug(CPUState *cs, vaddr
addr,
bool mb_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
{
- MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
- CPUMBState *env = &cpu->env;
+ CPUMBState *env = cpu_env(cs);
if ((interrupt_request & CPU_INTERRUPT_HARD)
&& (env->msr & MSR_IE)
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index a465c2d245..4e52ef32db 100644
--- a/target/microblaze/translate.c
+++ b/target/microblaze/translate.c
@@ -1630,7 +1630,6 @@ static void mb_tr_insn_start(DisasContextBase *dcb,
CPUState *cs)
static void mb_tr_translate_insn(DisasContextBase *dcb, CPUState *cs)
{
DisasContext *dc = container_of(dcb, DisasContext, base);
- CPUMBState *env = cpu_env(cs);
uint32_t ir;
/* TODO: This should raise an exception, not terminate qemu. */
@@ -1641,7 +1640,7 @@ static void mb_tr_translate_insn(DisasContextBase *dcb,
CPUState *cs)
dc->tb_flags_to_set = 0;
- ir = cpu_ldl_code(env, dc->base.pc_next);
+ ir = cpu_ldl_code(cpu_env(cs), dc->base.pc_next);
if (!decode(dc, ir)) {
trap_illegal(dc, true);
}
@@ -1800,8 +1799,7 @@ void gen_intermediate_code(CPUState *cpu,
TranslationBlock *tb, int *max_insns,
void mb_cpu_dump_state(CPUState *cs, FILE *f, int flags)
{
- MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
- CPUMBState *env = &cpu->env;
+ CPUMBState *env = cpu_env(cs);
uint32_t iflags;
int i;
--
2.44.0
- [PULL 31/55] net/vhost-vdpa: Fix missing ERRP_GUARD() for error_prepend(), (continued)
- [PULL 31/55] net/vhost-vdpa: Fix missing ERRP_GUARD() for error_prepend(), Thomas Huth, 2024/03/12
- [PULL 28/55] hw/virtio/vhost-vsock: Fix missing ERRP_GUARD() for error_prepend(), Thomas Huth, 2024/03/12
- [PULL 41/55] target/hexagon: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 30/55] migration/option: Fix missing ERRP_GUARD() for error_prepend(), Thomas Huth, 2024/03/12
- [PULL 46/55] target/mips: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 36/55] bulk: Call in place single use cpu_env(), Thomas Huth, 2024/03/12
- [PULL 43/55] target/loongarch: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 35/55] hw/core: Declare CPUArchId::cpu as CPUState instead of Object, Thomas Huth, 2024/03/12
- [PULL 38/55] target/alpha: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 34/55] bulk: Access existing variables initialized to &S->F when available, Thomas Huth, 2024/03/12
- [PULL 45/55] target/microblaze: Prefer fast cpu_env() over slower CPU QOM cast macro,
Thomas Huth <=
- [PULL 47/55] target/nios2: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 39/55] target/avr: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 51/55] target/sh4: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 40/55] target/cris: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 37/55] target: Replace CPU_GET_CLASS(cpu -> obj) in cpu_reset_hold() handler, Thomas Huth, 2024/03/12
- [PULL 44/55] target/m68k: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 42/55] target/i386/hvf: Use CPUState typedef, Thomas Huth, 2024/03/12
- [PULL 48/55] target/openrisc: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 49/55] target/ppc: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 50/55] target/rx: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12