On 10/14/21 3:32 PM, [email protected] wrote:
From: Matheus Ferst <[email protected]>

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 <[email protected]>
---
  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 <[email protected]>

+    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~

Reply via email to