On Sun, 27 Feb 2022 at 18:23, Richard Henderson <richard.hender...@linaro.org> wrote: > > This functionality can be had via plugins, if desired. > In the meantime, it is unused code. > > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> > --- > target/nios2/helper.h | 1 - > target/nios2/mmu.h | 1 - > target/nios2/mmu.c | 20 -------------------- > target/nios2/op_helper.c | 5 ----- > target/nios2/translate.c | 17 ----------------- > 5 files changed, 44 deletions(-)
> --- a/target/nios2/translate.c > +++ b/target/nios2/translate.c > @@ -448,23 +448,6 @@ static void rdctl(DisasContext *dc, uint32_t code, > uint32_t flags) > gen_check_supervisor(dc); > > switch (instr.imm5 + CR_BASE) { > - case CR_PTEADDR: > - case CR_TLBACC: > - case CR_TLBMISC: > - { > -#if !defined(CONFIG_USER_ONLY) > - if (likely(instr.c != R_ZERO)) { > - tcg_gen_mov_tl(cpu_R[instr.c], cpu_R[instr.imm5 + CR_BASE]); > -#ifdef DEBUG_MMU > - TCGv_i32 tmp = tcg_const_i32(instr.imm5 + CR_BASE); > - gen_helper_mmu_read_debug(cpu_R[instr.c], cpu_env, tmp); > - tcg_temp_free_i32(tmp); > -#endif > - } > -#endif > - break; > - } > - For a moment I thought this was changing the behaviour of these registers for linux-user, but gen_check_supervisor() means we never execute the code generated here. (Side note: it would be more sensible to stop generating code rather than generating the "throw an exception" code and then the "write/read reg" code as known-dead-code after it. But that's a different issue.) Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> thanks -- PMM