Message ID | 20200828141929.77854-33-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show |
Series | target/microblaze improvements | expand |
Le ven. 28 août 2020 16:32, Richard Henderson <richard.henderson@linaro.org> a écrit : > This is never used in op_helper.c and translate.c. There are > two trivial uses in helper.c which can be improved by always > logging MMU_EXCP to CPU_LOG_INT. > > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- > target/microblaze/helper.c | 11 ++++------- > target/microblaze/op_helper.c | 2 -- > target/microblaze/translate.c | 2 -- > 3 files changed, 4 insertions(+), 11 deletions(-) > > diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c > index 9a95456401..f8e2ca12a9 100644 > --- a/target/microblaze/helper.c > +++ b/target/microblaze/helper.c > @@ -24,8 +24,6 @@ > #include "qemu/host-utils.h" > #include "exec/log.h" > > -#define D(x) > - > #if defined(CONFIG_USER_ONLY) > > void mb_cpu_do_interrupt(CPUState *cs) > @@ -155,10 +153,13 @@ void mb_cpu_do_interrupt(CPUState *cs) > case EXCP_MMU: > env->regs[17] = env->pc; > > + qemu_log_mask(CPU_LOG_INT, > + "MMU exception at pc=%x iflags=%x ear=%" PRIx64 > "\n", > + env->pc, env->iflags, env->ear); > + > env->esr &= ~(1 << 12); > /* Exception breaks branch + dslot sequence? */ > if (env->iflags & D_FLAG) { > - D(qemu_log("D_FLAG set at exception bimm=%d\n", > env->bimm)); > env->esr |= 1 << 12 ; > env->btr = env->btarget; > > @@ -166,14 +167,10 @@ void mb_cpu_do_interrupt(CPUState *cs) > env->regs[17] -= 4; > /* was the branch immprefixed?. */ > if (env->bimm) { > - qemu_log_mask(CPU_LOG_INT, > - "bimm exception at pc=%x iflags=%x\n", > - env->pc, env->iflags); > env->regs[17] -= 4; > log_cpu_state_mask(CPU_LOG_INT, cs, 0); > } > } else if (env->iflags & IMM_FLAG) { > - D(qemu_log("IMM_FLAG set at exception\n")); > env->regs[17] -= 4; > } > > diff --git a/target/microblaze/op_helper.c b/target/microblaze/op_helper.c > index d79202c3f8..decdca0fd8 100644 > --- a/target/microblaze/op_helper.c > +++ b/target/microblaze/op_helper.c > @@ -26,8 +26,6 @@ > #include "exec/cpu_ldst.h" > #include "fpu/softfloat.h" > > -#define D(x) > - > void helper_put(uint32_t id, uint32_t ctrl, uint32_t data) > { > int test = ctrl & STREAM_TEST; > diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c > index 6757720776..860859324a 100644 > --- a/target/microblaze/translate.c > +++ b/target/microblaze/translate.c > @@ -41,8 +41,6 @@ > # define LOG_DIS(...) do { } while (0) > #endif > > -#define D(x) > - > #define EXTRACT_FIELD(src, start, end) \ > (((src) >> start) & ((1 << (end - start + 1)) - 1)) > > -- > 2.25.1 > > > <div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 28 août 2020 16:32, Richard Henderson <<a href="mailto:richard.henderson@linaro.org">richard.henderson@linaro.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is never used in op_helper.c and translate.c. There are<br> two trivial uses in helper.c which can be improved by always<br> logging MMU_EXCP to CPU_LOG_INT.<br> <br> Signed-off-by: Richard Henderson <<a href="mailto:richard.henderson@linaro.org" target="_blank" rel="noreferrer">richard.henderson@linaro.org</a>><br></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><span style="font-family:sans-serif;font-size:13.696px">Reviewed-by: Philippe Mathieu-Daudé <</span><a href="mailto:f4bug@amsat.org" style="text-decoration:none;color:rgb(66,133,244);font-family:sans-serif;font-size:13.696px">f4bug@amsat.org</a><span style="font-family:sans-serif;font-size:13.696px">></span><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> ---<br> target/microblaze/helper.c | 11 ++++-------<br> target/microblaze/op_helper.c | 2 --<br> target/microblaze/translate.c | 2 --<br> 3 files changed, 4 insertions(+), 11 deletions(-)<br> <br> diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c<br> index 9a95456401..f8e2ca12a9 100644<br> --- a/target/microblaze/helper.c<br> +++ b/target/microblaze/helper.c<br> @@ -24,8 +24,6 @@<br> #include "qemu/host-utils.h"<br> #include "exec/log.h"<br> <br> -#define D(x)<br> -<br> #if defined(CONFIG_USER_ONLY)<br> <br> void mb_cpu_do_interrupt(CPUState *cs)<br> @@ -155,10 +153,13 @@ void mb_cpu_do_interrupt(CPUState *cs)<br> case EXCP_MMU:<br> env->regs[17] = env->pc;<br> <br> + qemu_log_mask(CPU_LOG_INT,<br> + "MMU exception at pc=%x iflags=%x ear=%" PRIx64 "\n",<br> + env->pc, env->iflags, env->ear);<br> +<br> env->esr &= ~(1 << 12);<br> /* Exception breaks branch + dslot sequence? */<br> if (env->iflags & D_FLAG) {<br> - D(qemu_log("D_FLAG set at exception bimm=%d\n", env->bimm));<br> env->esr |= 1 << 12 ;<br> env->btr = env->btarget;<br> <br> @@ -166,14 +167,10 @@ void mb_cpu_do_interrupt(CPUState *cs)<br> env->regs[17] -= 4;<br> /* was the branch immprefixed?. */<br> if (env->bimm) {<br> - qemu_log_mask(CPU_LOG_INT,<br> - "bimm exception at pc=%x iflags=%x\n",<br> - env->pc, env->iflags);<br> env->regs[17] -= 4;<br> log_cpu_state_mask(CPU_LOG_INT, cs, 0);<br> }<br> } else if (env->iflags & IMM_FLAG) {<br> - D(qemu_log("IMM_FLAG set at exception\n"));<br> env->regs[17] -= 4;<br> }<br> <br> diff --git a/target/microblaze/op_helper.c b/target/microblaze/op_helper.c<br> index d79202c3f8..decdca0fd8 100644<br> --- a/target/microblaze/op_helper.c<br> +++ b/target/microblaze/op_helper.c<br> @@ -26,8 +26,6 @@<br> #include "exec/cpu_ldst.h"<br> #include "fpu/softfloat.h"<br> <br> -#define D(x)<br> -<br> void helper_put(uint32_t id, uint32_t ctrl, uint32_t data)<br> {<br> int test = ctrl & STREAM_TEST;<br> diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c<br> index 6757720776..860859324a 100644<br> --- a/target/microblaze/translate.c<br> +++ b/target/microblaze/translate.c<br> @@ -41,8 +41,6 @@<br> # define LOG_DIS(...) do { } while (0)<br> #endif<br> <br> -#define D(x)<br> -<br> #define EXTRACT_FIELD(src, start, end) \<br> (((src) >> start) & ((1 << (end - start + 1)) - 1))<br> <br> -- <br> 2.25.1<br> <br> <br> </blockquote></div></div></div>
diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index 9a95456401..f8e2ca12a9 100644 --- a/target/microblaze/helper.c +++ b/target/microblaze/helper.c @@ -24,8 +24,6 @@ #include "qemu/host-utils.h" #include "exec/log.h" -#define D(x) - #if defined(CONFIG_USER_ONLY) void mb_cpu_do_interrupt(CPUState *cs) @@ -155,10 +153,13 @@ void mb_cpu_do_interrupt(CPUState *cs) case EXCP_MMU: env->regs[17] = env->pc; + qemu_log_mask(CPU_LOG_INT, + "MMU exception at pc=%x iflags=%x ear=%" PRIx64 "\n", + env->pc, env->iflags, env->ear); + env->esr &= ~(1 << 12); /* Exception breaks branch + dslot sequence? */ if (env->iflags & D_FLAG) { - D(qemu_log("D_FLAG set at exception bimm=%d\n", env->bimm)); env->esr |= 1 << 12 ; env->btr = env->btarget; @@ -166,14 +167,10 @@ void mb_cpu_do_interrupt(CPUState *cs) env->regs[17] -= 4; /* was the branch immprefixed?. */ if (env->bimm) { - qemu_log_mask(CPU_LOG_INT, - "bimm exception at pc=%x iflags=%x\n", - env->pc, env->iflags); env->regs[17] -= 4; log_cpu_state_mask(CPU_LOG_INT, cs, 0); } } else if (env->iflags & IMM_FLAG) { - D(qemu_log("IMM_FLAG set at exception\n")); env->regs[17] -= 4; } diff --git a/target/microblaze/op_helper.c b/target/microblaze/op_helper.c index d79202c3f8..decdca0fd8 100644 --- a/target/microblaze/op_helper.c +++ b/target/microblaze/op_helper.c @@ -26,8 +26,6 @@ #include "exec/cpu_ldst.h" #include "fpu/softfloat.h" -#define D(x) - void helper_put(uint32_t id, uint32_t ctrl, uint32_t data) { int test = ctrl & STREAM_TEST; diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 6757720776..860859324a 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -41,8 +41,6 @@ # define LOG_DIS(...) do { } while (0) #endif -#define D(x) - #define EXTRACT_FIELD(src, start, end) \ (((src) >> start) & ((1 << (end - start + 1)) - 1))
This is never used in op_helper.c and translate.c. There are two trivial uses in helper.c which can be improved by always logging MMU_EXCP to CPU_LOG_INT. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- target/microblaze/helper.c | 11 ++++------- target/microblaze/op_helper.c | 2 -- target/microblaze/translate.c | 2 -- 3 files changed, 4 insertions(+), 11 deletions(-) -- 2.25.1