All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matheus K. Ferst" <matheus.ferst@eldorado.org.br>
To: Richard Henderson <richard.henderson@linaro.org>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: laurent@vivier.eu, groug@kaod.org, david@gibson.dropbear.id.au
Subject: Re: [PATCH 1/4] linux-user/ppc: Fix XER access in save/restore_user_regs
Date: Fri, 15 Oct 2021 11:54:55 -0300	[thread overview]
Message-ID: <7925af5a-e8c4-0574-c131-4e86e8a0252c@eldorado.org.br> (raw)
In-Reply-To: <08fb20b9-4784-4dfe-2bdd-7abeae8d6a4c@linaro.org>

On 14/10/2021 20:43, Richard Henderson wrote:
> [E-MAIL EXTERNO] Não clique em links ou abra anexos, a menos que você 
> possa confirmar o remetente e saber que o conteúdo é seguro. Em caso de 
> e-mail suspeito entre imediatamente em contato com o DTI.
> 
> On 10/14/21 3:32 PM, matheus.ferst@eldorado.org.br wrote:
>> From: Matheus Ferst <matheus.ferst@eldorado.org.br>
>>
>> We should use cpu_read_xer/cpu_write_xer to save/restore the complete
>> register since some of its bits are in other fields of CPUPPCState. A
>> test is added to prevent future regressions.
>>
>> Fixes: da91a00f191f ("target-ppc: Split out SO, OV, CA fields from XER")
>> Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
>> ---
>>   linux-user/ppc/signal.c                     |  9 +++--
>>   tests/tcg/ppc64/Makefile.target             |  2 +
>>   tests/tcg/ppc64le/Makefile.target           |  2 +
>>   tests/tcg/ppc64le/signal_save_restore_xer.c | 42 +++++++++++++++++++++
>>   4 files changed, 52 insertions(+), 3 deletions(-)
>>   create mode 100644 tests/tcg/ppc64le/signal_save_restore_xer.c
> 
> The code is good so,
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> 
>> +    sigaction(SIGILL, &sa, NULL);
>> +
>> +    asm("mtspr 1, %1\n\t"
>> +        ".long 0x0\n\t"
> 
> While Appendix B does guarantee that "0" is and always will be an 
> invalid instruction, I
> wonder if the test itself would be clearer (i.e. self-documenting the 
> intent) using
> SIGTRAP and "trap".
> 
> 
> r~

It would be better, but cpu_loop is currently calling cpu_abort for 
POWERPC_EXCP_TRAP, so the test would fail. I'll see if I can fix that in 
another patch, and then we can change the test to use trap.

-- 
Matheus K. Ferst
Instituto de Pesquisas ELDORADO <http://www.eldorado.org.br/>
Analista de Software Júnior
Aviso Legal - Disclaimer <https://www.eldorado.org.br/disclaimer.html>


  reply	other threads:[~2021-10-15 14:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14 22:32 [PATCH 0/4] Fix incorrect accesses to XER matheus.ferst
2021-10-14 22:32 ` [PATCH 1/4] linux-user/ppc: Fix XER access in save/restore_user_regs matheus.ferst
2021-10-14 23:43   ` Richard Henderson
2021-10-15 14:54     ` Matheus K. Ferst [this message]
2021-10-15 18:24       ` Richard Henderson
2021-10-15  0:30   ` David Gibson
2021-10-14 22:32 ` [PATCH 2/4] target/ppc: Fix XER access in gdbstub matheus.ferst
2021-10-14 23:43   ` Richard Henderson
2021-10-15  0:31   ` David Gibson
2021-10-14 22:32 ` [PATCH 3/4] linux-user: Fix XER access in ppc version of elf_core_copy_regs matheus.ferst
2021-10-14 23:44   ` Richard Henderson
2021-10-14 22:32 ` [PATCH 4/4] target/ppc: Fix XER access in monitor matheus.ferst
2021-10-14 23:45   ` 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=7925af5a-e8c4-0574-c131-4e86e8a0252c@eldorado.org.br \
    --to=matheus.ferst@eldorado.org.br \
    --cc=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.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.