All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Matheus K. Ferst" <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 10:20:07 -0800	[thread overview]
Message-ID: <2f73f73e-b8fb-212c-08fd-4daee3695290@linaro.org> (raw)
In-Reply-To: <9fb0237b-d960-348f-f875-261f331d0cbc@eldorado.org.br>

On 1/3/22 10:12 AM, Matheus K. Ferst wrote:
> On 03/01/2022 14:50, Richard Henderson wrote:
>> 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
> 
> After this switch-case, there is a
> 
> info._sifields._sigfault._addr = env->nip;
> 
> Is there anything else to be set?

Nope, sorry I missed that.

r~


  reply	other threads:[~2022-01-03 18:21 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
2022-01-03 18:12     ` Matheus K. Ferst
2022-01-03 18:20       ` Richard Henderson [this message]
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=2f73f73e-b8fb-212c-08fd-4daee3695290@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.