From: Richard Henderson <richard.henderson@linaro.org>
To: matheus.ferst@eldorado.org.br, qemu-devel@nongnu.org,
qemu-ppc@nongnu.org
Cc: laurent@vivier.eu, groug@kaod.org, danielhb413@gmail.com,
clg@kaod.org, david@gibson.dropbear.id.au
Subject: Re: [PATCH 1/2] linux-user/ppc: deliver SIGTRAP on POWERPC_EXCP_TRAP
Date: Mon, 3 Jan 2022 09:50:25 -0800 [thread overview]
Message-ID: <8c606234-2939-e64e-d2d6-ae351e13fede@linaro.org> (raw)
In-Reply-To: <20220103165625.307309-2-matheus.ferst@eldorado.org.br>
On 1/3/22 8:56 AM, matheus.ferst@eldorado.org.br wrote:
> From: Matheus Ferst <matheus.ferst@eldorado.org.br>
>
> Handle POWERPC_EXCP_TRAP in cpu_loop to deliver SIGTRAP on tw[i]/td[i].
> The si_code comes from do_program_check in the kernel source file
> arch/powerpc/kernel/traps.c
>
> Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
> ---
> linux-user/ppc/cpu_loop.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/linux-user/ppc/cpu_loop.c b/linux-user/ppc/cpu_loop.c
> index 30c82f2354..8fbaa772dc 100644
> --- a/linux-user/ppc/cpu_loop.c
> +++ b/linux-user/ppc/cpu_loop.c
> @@ -242,7 +242,9 @@ void cpu_loop(CPUPPCState *env)
> }
> break;
> case POWERPC_EXCP_TRAP:
> - cpu_abort(cs, "Tried to call a TRAP\n");
> + info.si_signo = TARGET_SIGTRAP;
> + info.si_errno = 0;
> + info.si_code = TARGET_TRAP_BRKPT;
You're missing the address, which should be nip.
https://github.com/torvalds/linux/blob/master/arch/powerpc/kernel/traps.c#L1503
Please use force_sig_fault. (I have a pending patch set to convert all other instances;
hopefully that can be merged soon...)
r~
next prev parent reply other threads:[~2022-01-03 17:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-03 16:56 [PATCH 0/2] linux-user/ppc: Deliver SIGTRAP on tw[i]/td[i] matheus.ferst
2022-01-03 16:56 ` [PATCH 1/2] linux-user/ppc: deliver SIGTRAP on POWERPC_EXCP_TRAP matheus.ferst
2022-01-03 17:50 ` Richard Henderson [this message]
2022-01-03 18:12 ` Matheus K. Ferst
2022-01-03 18:20 ` Richard Henderson
2022-01-03 16:56 ` [PATCH 2/2] tests/tcg/ppc64le: change signal_save_restore_xer to use SIGTRAP matheus.ferst
2022-01-03 17:53 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8c606234-2939-e64e-d2d6-ae351e13fede@linaro.org \
--to=richard.henderson@linaro.org \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=groug@kaod.org \
--cc=laurent@vivier.eu \
--cc=matheus.ferst@eldorado.org.br \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).