qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Ilya Leoshkevich <iii@linux.ibm.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Thomas Huth <thuth@redhat.com>
Cc: qemu-s390x@nongnu.org, qemu-devel@nongnu.org, qemu-stable@nongnu.org
Subject: Re: [PATCH 1/2] target/s390x: Use a 16-bit immediate in VREP
Date: Mon, 7 Aug 2023 19:00:14 +0200	[thread overview]
Message-ID: <baa436ac-ffe4-8c7d-6eee-af9c26fe3c0f@redhat.com> (raw)
In-Reply-To: <20230807163459.849766-1-iii@linux.ibm.com>

On 07.08.23 18:34, Ilya Leoshkevich wrote:
> Unlike most other instructions that contain an immediate element index,
> VREP's one is 16-bit, and not 4-bit. The code uses only 8 bits, so
> using, e.g., 0x101 does not lead to a specification exception.
> 
> Fix by checking all 16 bits.
> 
> Cc: qemu-stable@nongnu.org

Just curious, why stable? Are there valid programs that set invalid 
element size and they are fixed by this?

LGTM

Reviewed-by: David Hildenbrand <david@redhat.com>

> Fixes: 28d08731b1d8 ("s390x/tcg: Implement VECTOR REPLICATE")
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
>   target/s390x/tcg/translate_vx.c.inc | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/s390x/tcg/translate_vx.c.inc b/target/s390x/tcg/translate_vx.c.inc
> index f8df121d3d3..a6d840d4065 100644
> --- a/target/s390x/tcg/translate_vx.c.inc
> +++ b/target/s390x/tcg/translate_vx.c.inc
> @@ -57,7 +57,7 @@
>   #define FPF_LONG        3
>   #define FPF_EXT         4
>   
> -static inline bool valid_vec_element(uint8_t enr, MemOp es)
> +static inline bool valid_vec_element(uint16_t enr, MemOp es)
>   {
>       return !(enr & ~(NUM_VEC_ELEMENTS(es) - 1));
>   }
> @@ -964,7 +964,7 @@ static DisasJumpType op_vpdi(DisasContext *s, DisasOps *o)
>   
>   static DisasJumpType op_vrep(DisasContext *s, DisasOps *o)
>   {
> -    const uint8_t enr = get_field(s, i2);
> +    const uint16_t enr = get_field(s, i2);
>       const uint8_t es = get_field(s, m4);
>   
>       if (es > ES_64 || !valid_vec_element(enr, es)) {

-- 
Cheers,

David / dhildenb



  parent reply	other threads:[~2023-08-07 17:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07 16:34 [PATCH 1/2] target/s390x: Use a 16-bit immediate in VREP Ilya Leoshkevich
2023-08-07 16:34 ` [PATCH 2/2] tests/tcg/s390x: Test VREP Ilya Leoshkevich
2023-08-07 17:00 ` David Hildenbrand [this message]
2023-08-07 17:02   ` [PATCH 1/2] target/s390x: Use a 16-bit immediate in VREP Ilya Leoshkevich
2023-08-07 17:04     ` David Hildenbrand
2023-08-07 17:27       ` Michael Tokarev
2023-08-08 10:01         ` Ilya Leoshkevich

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=baa436ac-ffe4-8c7d-6eee-af9c26fe3c0f@redhat.com \
    --to=david@redhat.com \
    --cc=iii@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /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).