qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Ilya Leoshkevich <iii@linux.ibm.com>,
	Riku Voipio <riku.voipio@iki.fi>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	qemu-devel@nongnu.org, Andreas Krebbel <krebbel@linux.ibm.com>
Subject: Re: [PATCH] accel/tcg/user-exec: Fix read-modify-write of code on s390 hosts
Date: Tue, 3 Aug 2021 11:14:43 -1000	[thread overview]
Message-ID: <9812a7a2-89ca-abb8-aeec-d01d6c8b4fcd@linaro.org> (raw)
In-Reply-To: <20210803195406.149446-1-iii@linux.ibm.com>

On 8/3/21 9:54 AM, Ilya Leoshkevich wrote:
>       /* ??? On linux, the non-rt signal handler has 4 (!) arguments instead
> -       of the normal 2 arguments.  The 3rd argument contains the "int_code"
> -       from the hardware which does in fact contain the is_write value.
> +       of the normal 2 arguments.  The 4th argument contains the "Translation-
> +       Exception Identification for DAT Exceptions" from the hardware (aka
> +       "int_parm_long"), which does in fact contain the is_write value.
>          The rt signal handler, as far as I can tell, does not give this value
> -       at all.  Not that we could get to it from here even if it were.  */
> -    /* ??? This is not even close to complete, since it ignores all
> -       of the read-modify-write instructions.  */
> +       at all.  Not that we could get to it from here even if it were.
> +       So fall back to parsing instructions.  Treat read-modify-write ones as
> +       writes, which is not fully correct, but for tracking self-modifying code
> +       this is better than treating them as reads.  Checking si_addr page flags
> +       might be a viable improvement, albeit a racy one.  */
> +    /* ??? This is not even close to complete.  */

You should have gotten a checkpatch warning here.
Just convert the comment to

   /*
    * this style
    */

>       pinsn = (uint16_t *)pc;
>       switch (pinsn[0] >> 8) {
>       case 0x50: /* ST */
>       case 0x42: /* STC */
>       case 0x40: /* STH */
> +    case 0xba: /* CS */
> +    case 0xbb: /* CDS */
> +    case 0xc8: /* CSST */

CSST is format SSF; you're not checking enough bits to distinguish from LOAD PAIR DISJOINT.

Otherwise, looks good.

r~


      reply	other threads:[~2021-08-03 21:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03 19:54 [PATCH] accel/tcg/user-exec: Fix read-modify-write of code on s390 hosts Ilya Leoshkevich
2021-08-03 21:14 ` Richard Henderson [this message]

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=9812a7a2-89ca-abb8-aeec-d01d6c8b4fcd@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=borntraeger@de.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=krebbel@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /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).