From: Adrian Hunter <adrian.hunter@intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
<linux-kernel@vger.kernel.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Jiri Olsa <jolsa@redhat.com>,
"Dan Williams" <dan.j.williams@intel.com>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
"Andy Lutomirski" <luto@amacapital.net>, X86 ML <x86@kernel.org>
Subject: Re: [PATCH V2 2/4] x86/insn: Add AVX-512 support to the instruction decoder
Date: Tue, 2 Dec 2025 08:26:00 +0200 [thread overview]
Message-ID: <cfc12330-adf5-4598-9467-592ee9f88f8e@intel.com> (raw)
In-Reply-To: <20251201190138.GDaS3mEm9P5UGfd8jY@fat_crate.local>
On 01/12/2025 21:01, Borislav Petkov wrote:
> On Mon, Dec 01, 2025 at 08:15:19PM +0200, Adrian Hunter wrote:
>> EXTRQ Vo,Uo (66) has a mandatory 66 prefix like vcvtps2uqq/pd2uqq Vx,Wx (66),(ev) so they end up on the same attribute table, but (ev) results in INAT_EVEXONLY which is unwanted.
>>
>> Changing that from (ev) to (evo) is probably all that is needed e.g.
>>
>> +79: VMWRITE Gy,Ey | EXTRQ Vo,Uo (66) | vcvtps2udq/pd2udq Vx,Wpd (evo) | vcvtsd2usi Gv,Wx (F2),(ev) | vcvtss2usi Gv,Wx (F3),(ev) | vcvtps2uqq/pd2uqq Vx,Wx (66),(evo)
>>
>
> That still sounds to me like a hack: looking at the SDM, that thing:
>
> VCVTPS2UQQ—Convert Packed Single Precision Floating-Point Values to Packed
> Unsigned Quadword Integer Values
>
> *is* EVEX-only insn:
>
> EVEX.128.66.0F.W0
The instruction decoder is permissive in the sense that it cannot
tell if an instruction is valid, only what its properties are assuming
it is valid. There is no need to validate EVEX-only.
ev->evo makes sense to allow for another instruction.
>
> the "66" meaning in this case EVEX.pp which are the VEX.pp two bits with value
> 1b meaning there's an implied 66 legacy prefix.
>
> To make it more concrete, let's take an example from the binutils testsuite:
>
> 62 f1 7d 4f 79 f5[ ]*vcvtps2uqq zmm6\{k7\},ymm5
>
> and that's basically:
>
> Extended VEctor prefiX: 0x62
> P1: [R:1|X:1|B:1|R':1|rsv:0|mm:1] 0xf1
> P2: [W:0|vvvv:0xf |rsv:1|pp:1] 0x7d
> P3: [z:0|L':1|L:0|b:0|V':1|aaa:7] 0x4f
>
> with the opcode 0x79 and EVEX.pp=1b, as expected.
>
> So there's no real 66 prefix there.
>
> But our opcode map says:
>
> "# Last Prefix Superscripts
> # - (66): the last prefix is 0x66"
>
> So we're using the marking (66) to mean both an explicit 66 legacy prefix and
> an implied *VEX.pp=1 66 prefix equivalence.
>
> So now the question is, why do the *VEX opcodes need that (66) marking at all?
> For operand sizing?
>
> Looking at our example insn VCVTPS2UQQ, I don't see any other encoding where
> 66 is not present. And there's nothing in the pseudo code either. So VEX.pp=1
> is part of the encoding of that insn.
>
> So, that (66) there is not really the prefix ...
It puts the instruction into a different opcode/addressing-mode space
(different attribute table) so we probably need to keep using it like that.
next prev parent reply other threads:[~2025-12-02 6:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-20 8:30 [PATCH V2 0/4] x86/insn: perf tools: Add AVX-512 support to the instruction decoder Adrian Hunter
2016-07-20 8:30 ` [PATCH V2 1/4] x86/insn: perf tools: Fix vcvtph2ps instruction decoding Adrian Hunter
2016-07-25 18:08 ` [tip:perf/core] " tip-bot for Adrian Hunter
2016-07-20 8:30 ` [PATCH V2 2/4] x86/insn: Add AVX-512 support to the instruction decoder Adrian Hunter
2016-07-25 18:08 ` [tip:perf/core] " tip-bot for Adrian Hunter
2025-11-30 16:05 ` [PATCH V2 2/4] " Borislav Petkov
2025-12-01 11:25 ` Borislav Petkov
2025-12-01 18:15 ` Adrian Hunter
2025-12-01 19:01 ` Borislav Petkov
2025-12-02 6:26 ` Adrian Hunter [this message]
2025-12-02 10:47 ` Borislav Petkov
2016-07-20 8:30 ` [PATCH V2 3/4] perf tools: Add AVX-512 support to the instruction decoder used by Intel PT Adrian Hunter
2016-07-25 18:09 ` [tip:perf/core] " tip-bot for Adrian Hunter
2016-07-20 8:30 ` [PATCH V2 4/4] perf tools: Add AVX-512 instructions to the new instructions test Adrian Hunter
2016-07-25 18:09 ` [tip:perf/core] " tip-bot for Adrian Hunter
2016-07-20 18:11 ` [PATCH V2 0/4] x86/insn: perf tools: Add AVX-512 support to the instruction decoder Masami Hiramatsu
2016-07-21 11:18 ` Adrian Hunter
2016-07-21 12:39 ` Arnaldo Carvalho de Melo
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=cfc12330-adf5-4598-9467-592ee9f88f8e@intel.com \
--to=adrian.hunter@intel.com \
--cc=acme@kernel.org \
--cc=bp@alien8.de \
--cc=dan.j.williams@intel.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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