target/i386: implement SYSCALL/SYSRET in 32-bit emulators

AMD supports both 32-bit and 64-bit SYSCALL/SYSRET, but the TCG only
exposes it for 64-bit targets.  For system emulation just reuse the
helper; for user-mode emulation the ABI is the same as "int $80".

The BSDs does not support any fast system call mechanism in 32-bit
mode so add to bsd-user the same stub that FreeBSD has for 64-bit
compatibility mode.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2023-06-17 01:01:29 +02:00
parent 6750485bf4
commit 63fd8ef080
8 changed files with 20 additions and 17 deletions

View file

@ -164,6 +164,10 @@ static inline void target_cpu_loop(CPUX86State *env)
}
break;
case EXCP_SYSCALL:
/* doesn't do anything */
break;
case EXCP_INTERRUPT:
/* just indicate that signals should be handled asap */
break;