linux-user/mips: implement sysmips(MIPS_FLUSH_CACHE)

Add the target sysmips dispatcher and implement MIPS_FLUSH_CACHE as a
successful no-op for linux-user.

Self-modifying code is handled by QEMU's normal user-mode translation
invalidation machinery, so the target ABI only needs the syscall command
to be accepted.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20260520172313.23777-2-philmd@linaro.org>
This commit is contained in:
James Hilliard 2026-05-08 09:13:45 +02:00 committed by Philippe Mathieu-Daudé
parent 8bb514f373
commit e83a42cbf7
3 changed files with 19 additions and 0 deletions

View file

@ -10,6 +10,7 @@
#define TARGET_MCL_ONFAULT 4
#define TARGET_FORCE_SHMLBA
#define TARGET_SYSMIPS_FLUSH_CACHE 3
static inline abi_ulong target_shmlba(CPUMIPSState *env)
{

View file

@ -10,6 +10,7 @@
#define TARGET_MCL_ONFAULT 4
#define TARGET_FORCE_SHMLBA
#define TARGET_SYSMIPS_FLUSH_CACHE 3
static inline abi_ulong target_shmlba(CPUMIPSState *env)
{

View file

@ -6630,6 +6630,19 @@ static abi_long do_prctl_syscall_user_dispatch(CPUArchState *env,
}
}
#ifdef TARGET_NR_sysmips
static abi_long do_sysmips(CPUArchState *env, abi_long cmd, abi_long arg1,
abi_long arg2)
{
switch (cmd) {
case TARGET_SYSMIPS_FLUSH_CACHE:
return 0;
default:
return -TARGET_EINVAL;
}
}
#endif
static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2,
abi_long arg3, abi_long arg4, abi_long arg5)
{
@ -12110,6 +12123,10 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
case TARGET_NR_prctl:
return do_prctl(cpu_env, arg1, arg2, arg3, arg4, arg5);
break;
#ifdef TARGET_NR_sysmips
case TARGET_NR_sysmips:
return do_sysmips(cpu_env, arg1, arg2, arg3);
#endif
#ifdef TARGET_NR_arch_prctl
case TARGET_NR_arch_prctl:
return do_arch_prctl(cpu_env, arg1, arg2);