qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [risu PATCH 1/4] s390x: Add basic s390x support to the C code


From: Thomas Huth
Subject: Re: [risu PATCH 1/4] s390x: Add basic s390x support to the C code
Date: Mon, 4 Sep 2023 16:27:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0

On 04/09/2023 16.19, Ilya Leoshkevich wrote:
On Mon, 2023-09-04 at 16:00 +0200, Thomas Huth wrote:
With these changes, it is now possible to compile the "risu" binary
for s390x hosts.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
  risu_reginfo_s390x.c | 142
+++++++++++++++++++++++++++++++++++++++++++
  risu_reginfo_s390x.h |  23 +++++++
  risu_s390x.c         |  48 +++++++++++++++
  test_s390x.S         |  32 ++++++++++
  4 files changed, 245 insertions(+)
  create mode 100644 risu_reginfo_s390x.c
  create mode 100644 risu_reginfo_s390x.h
  create mode 100644 risu_s390x.c
  create mode 100644 test_s390x.S

Looks really interesting! I was doing similar qemu-system-s390x testing
with a bunch of ad-hoc scripts, and there are quite a few unresolved
problems still, especially in the error handling area.

Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>

I have one small question (see below).

[...]

+/* reginfo_is_eq: compare the reginfo structs, returns nonzero if
equal */
+int reginfo_is_eq(struct reginfo *m, struct reginfo *a)
+{
+    int i;
+
+    if (m->psw_mask != a->psw_mask || m->psw_addr != a->psw_addr) {
+        return 0;
+    }
+
+    /* Skip return address register and stack register for
comparison */

Is this because of ASLR? In this case, would it be possible to build a
non-PIE binary and switch to a private stack at the beginning? This
could be useful for the other architectures as well.

Ah, no, it's not due to ASLR ... I just experienced some crashes during development and saw that other targets like m68k skip the stack pointer here, too, so I did it the same way on s390x. (But I finally discovered that the crashes were due to other reasons that I then fixed)

Looking through the code, it seems like there is already support for an alternate signal handler stack:


https://git.linaro.org/people/peter.maydell/risu.git/commit/?id=ad82a069e8d6a21842bbb265

... maybe it's working on s390x, too ... I'll give it a try.

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]