qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Richard Henderson <richard.henderson@linaro.org>,
	Eduardo Habkost <eduardo@habkost.net>
Subject: Re: [PATCH] target/arm: Mark VPERMILPS as not valid with prefix 0
Date: Sat, 15 Nov 2025 00:39:58 +0100	[thread overview]
Message-ID: <6e695458-13bf-4d64-89ee-f39818ed2e52@redhat.com> (raw)
In-Reply-To: <20251114175417.2794804-1-peter.maydell@linaro.org>

On 11/14/25 18:54, Peter Maydell wrote:
> There are a small set of binary SSE insns which have no MMX
> equivalent, which we create the gen functions for with the
> BINARY_INT_SSE() macro.  This forwards to gen_binary_int_sse() with a
> NULL pointer for 'mmx'.
> 
> For almost all of these insns we correctly mark them in the decode
> table as not permitting a zero prefix byte; however we got this wrong
> for VPERMILPS, with the result that a bogus instruction would get
> through the decode checks and end up in gen_binary_int_sse() trying
> to call a NULL pointer.
> 
> Correct the decode table entry for VPERMILPD so that we get the
> expected #UD exception.

Fixed to VPERMILPS, and applied, thanks!

Paolo>
> In the x86 SDM, table A-4 "Three-byte Opcode Map: 08H-FFH
> (First Two Bytes are 0F 38H)" confirms that there is no pfx 0
> version of VPERMILPS.
> 
> Cc: qemu-stable@nongnu.org
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3199
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   target/i386/tcg/decode-new.c.inc | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc
> index f4192f10068..805cfd08e83 100644
> --- a/target/i386/tcg/decode-new.c.inc
> +++ b/target/i386/tcg/decode-new.c.inc
> @@ -643,7 +643,7 @@ static const X86OpEntry opcodes_0F38_00toEF[240] = {
>       [0x0a] = X86_OP_ENTRY3(PSIGND,    V,x,        H,x,  W,x,  vex4 cpuid(SSSE3) mmx avx2_256 p_00_66),
>       [0x0b] = X86_OP_ENTRY3(PMULHRSW,  V,x,        H,x,  W,x,  vex4 cpuid(SSSE3) mmx avx2_256 p_00_66),
>       /* Listed incorrectly as type 4 */
> -    [0x0c] = X86_OP_ENTRY3(VPERMILPS, V,x,        H,x,  W,x,  vex6 chk(W0) cpuid(AVX) p_00_66),
> +    [0x0c] = X86_OP_ENTRY3(VPERMILPS, V,x,        H,x,  W,x,  vex6 chk(W0) cpuid(AVX) p_66),
>       [0x0d] = X86_OP_ENTRY3(VPERMILPD, V,x,        H,x,  W,x,  vex6 chk(W0) cpuid(AVX) p_66),
>       [0x0e] = X86_OP_ENTRY3(VTESTPS,   None,None,  V,x,  W,x,  vex6 chk(W0) cpuid(AVX) p_66),
>       [0x0f] = X86_OP_ENTRY3(VTESTPD,   None,None,  V,x,  W,x,  vex6 chk(W0) cpuid(AVX) p_66),



      reply	other threads:[~2025-11-14 23:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-14 17:54 [PATCH] target/arm: Mark VPERMILPS as not valid with prefix 0 Peter Maydell
2025-11-14 23:39 ` Paolo Bonzini [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=6e695458-13bf-4d64-89ee-f39818ed2e52@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@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).