Skip to content

Commit

Permalink
target/mips: Make mips_cpu_tlb_fill sysemu only
Browse files Browse the repository at this point in the history
The fallback code in cpu_loop_exit_sigsegv is sufficient
for mips linux-user.

This means we can remove tcg/user/tlb_helper.c entirely.
Remove the code from cpu_loop that raised SIGSEGV.

Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Nov 2, 2021
1 parent fd29773 commit 52d4899
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 80 deletions.
11 changes: 0 additions & 11 deletions linux-user/mips/cpu_loop.c
Expand Up @@ -158,17 +158,6 @@ void cpu_loop(CPUMIPSState *env)
}
env->active_tc.gpr[2] = ret;
break;
case EXCP_TLBL:
case EXCP_TLBS:
case EXCP_AdEL:
case EXCP_AdES:
info.si_signo = TARGET_SIGSEGV;
info.si_errno = 0;
/* XXX: check env->error_code */
info.si_code = TARGET_SEGV_MAPERR;
info._sifields._sigfault._addr = env->CP0_BadVAddr;
queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
break;
case EXCP_CpU:
case EXCP_RI:
info.si_signo = TARGET_SIGILL;
Expand Down
2 changes: 1 addition & 1 deletion target/mips/cpu.c
Expand Up @@ -539,9 +539,9 @@ static const struct SysemuCPUOps mips_sysemu_ops = {
static const struct TCGCPUOps mips_tcg_ops = {
.initialize = mips_tcg_init,
.synchronize_from_tb = mips_cpu_synchronize_from_tb,
.tlb_fill = mips_cpu_tlb_fill,

#if !defined(CONFIG_USER_ONLY)
.tlb_fill = mips_cpu_tlb_fill,
.cpu_exec_interrupt = mips_cpu_exec_interrupt,
.do_interrupt = mips_cpu_do_interrupt,
.do_transaction_failed = mips_cpu_do_transaction_failed,
Expand Down
3 changes: 0 additions & 3 deletions target/mips/tcg/meson.build
Expand Up @@ -28,9 +28,6 @@ mips_ss.add(when: 'TARGET_MIPS64', if_true: files(
'mxu_translate.c',
))

if have_user
subdir('user')
endif
if have_system
subdir('sysemu')
endif
7 changes: 4 additions & 3 deletions target/mips/tcg/tcg-internal.h
Expand Up @@ -18,9 +18,6 @@
void mips_tcg_init(void);

void mips_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb);
bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
MMUAccessType access_type, int mmu_idx,
bool probe, uintptr_t retaddr);
void mips_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
MMUAccessType access_type, int mmu_idx,
uintptr_t retaddr) QEMU_NORETURN;
Expand Down Expand Up @@ -60,6 +57,10 @@ void mips_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr,
MemTxResult response, uintptr_t retaddr);
void cpu_mips_tlb_flush(CPUMIPSState *env);

bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
MMUAccessType access_type, int mmu_idx,
bool probe, uintptr_t retaddr);

#endif /* !CONFIG_USER_ONLY */

#endif
3 changes: 0 additions & 3 deletions target/mips/tcg/user/meson.build

This file was deleted.

59 changes: 0 additions & 59 deletions target/mips/tcg/user/tlb_helper.c

This file was deleted.

0 comments on commit 52d4899

Please sign in to comment.