qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Ilya Leoshkevich <iii@linux.ibm.com>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-s390x@nongnu.org, qemu-devel@nongnu.org,
	Richard Henderson <richard.henderson@linaro.org>,
	David Hildenbrand <david@redhat.com>
Subject: Re: [risu PATCH 1/4] s390x: Add basic s390x support to the C code
Date: Mon, 4 Sep 2023 16:27:41 +0200	[thread overview]
Message-ID: <45de8d05-0bd8-3de1-245f-e9f5963586d2@redhat.com> (raw)
In-Reply-To: <cb8382fe4209c8ebe15f4d2b189ca77e20586ee8.camel@linux.ibm.com>

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	other threads:[~2023-09-04 14:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-04 14:00 [risu PATCH 0/4] Add support for s390x to RISU Thomas Huth
2023-09-04 14:00 ` [risu PATCH 1/4] s390x: Add basic s390x support to the C code Thomas Huth
2023-09-04 14:19   ` Ilya Leoshkevich
2023-09-04 14:27     ` Thomas Huth [this message]
2023-09-04 14:00 ` [risu PATCH 2/4] s390x: Add simple s390x.risu file Thomas Huth
2023-09-04 14:20   ` Ilya Leoshkevich
2023-09-05  9:56     ` Thomas Huth
2023-09-04 14:00 ` [risu PATCH 3/4] s390x: Add basic risugen perl module for s390x Thomas Huth
2023-09-04 14:00 ` [risu PATCH 4/4] s390x: Update the configure script for s390x support Thomas Huth
2023-09-04 14:23   ` Philippe Mathieu-Daudé
2023-09-04 14:30 ` [risu PATCH 0/4] Add support for s390x to RISU Ilya Leoshkevich
2023-09-05 12:00   ` Thomas Huth

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=45de8d05-0bd8-3de1-245f-e9f5963586d2@redhat.com \
    --to=thuth@redhat.com \
    --cc=david@redhat.com \
    --cc=iii@linux.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@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 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).