Re: [PATCH] mips: pass code of conditional trap

2024-06-21 Thread Maciej W. Rozycki
On Fri, 21 Jun 2024, YunQiang Su wrote: > > I haven't touched this stuff for ages, but AFAICT the code is already > > passed where applicable via the environment for `do_tr_or_bp' to handle, > > so I can't understand why your change is needed. > > > > The error_code in env is always zero, as we

Re: [PATCH] mips: pass code of conditional trap

2024-06-20 Thread YunQiang Su
Richard Henderson 于2024年6月21日周五 12:21写道: > > On 6/20/24 16:46, YunQiang Su wrote: > > @@ -4553,7 +4559,7 @@ static void gen_trap(DisasContext *ctx, uint32_t opc, > > if (ctx->hflags != ctx->saved_hflags) { > > tcg_gen_movi_i32(hflags, ctx->hflags); > > } > > -

Re: [PATCH] mips: pass code of conditional trap

2024-06-20 Thread Richard Henderson
On 6/20/24 16:46, YunQiang Su wrote: @@ -4553,7 +4559,7 @@ static void gen_trap(DisasContext *ctx, uint32_t opc, if (ctx->hflags != ctx->saved_hflags) { tcg_gen_movi_i32(hflags, ctx->hflags); } -generate_exception(ctx, EXCP_TRAP); +generate_except

Re: [PATCH] mips: pass code of conditional trap

2024-06-20 Thread YunQiang Su
Maciej W. Rozycki 于2024年6月21日周五 08:41写道: > > On Fri, 21 Jun 2024, YunQiang Su wrote: > > > Linux and We use the code of conditional trap instructions to emit > > signals other than simple SIGTRAP. Currently, code 6 (overflow), > > 7 (div by zero) are supported. It means that if code 7 is used wit

Re: [PATCH] mips: pass code of conditional trap

2024-06-20 Thread Maciej W. Rozycki
On Fri, 21 Jun 2024, YunQiang Su wrote: > Linux and We use the code of conditional trap instructions to emit > signals other than simple SIGTRAP. Currently, code 6 (overflow), > 7 (div by zero) are supported. It means that if code 7 is used with > a conditional trap instruction, a SIGFPE instead

[PATCH] mips: pass code of conditional trap

2024-06-20 Thread YunQiang Su
Linux and We use the code of conditional trap instructions to emit signals other than simple SIGTRAP. Currently, code 6 (overflow), 7 (div by zero) are supported. It means that if code 7 is used with a conditional trap instruction, a SIGFPE instead of SIGTRAP will emit. But when `gen_trap` we did