Project

General

Profile

Bug #12371

dis x86 EVEX prefix mishandled

Added by Robert Mustacchi 9 months ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

When support for AVX512 EVEX encoded instructions was introduced in 8384, it created a single table for all instructions with an EVEX prefix. However, the EVEX prefix can be used in front of instructions with any of the major prefixes and two and three byte opcodes. This means that we really need to break this out on a per-instruction prefix basis just like we do with VEX encoded instructions.


Related issues

Related to illumos gate - Feature #8384: AVX512 dis - EVEX prefix supportClosedJerry Jelinek2017-06-13

Actions
#1

Updated by Robert Mustacchi 9 months ago

  • Related to Feature #8384: AVX512 dis - EVEX prefix support added
#2

Updated by Robert Mustacchi 9 months ago

To test this, I ran the updated x86 dis tests with the existing and new tests that caused me to find this.

rm@turin:/ws/rm/dis/usr/src/test/util-tests/tests/dis$ LD_PRELOAD_32=/ws/rm/dis/proto/root_i386/usr/lib/libdisasm.so.1 ksh distest.ksh 
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.sep.s (32-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.sep.s (64-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.vmx.s (32-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.vmx.s (64-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.cpuid.s (32-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.cpuid.s (64-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.mwait.s (32-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.mwait.s (64-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.fence.s (32-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.fence.s (64-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.smap.s (32-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.smap.s (64-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.random.s (32-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.random.s (64-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.tsc.s (32-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.tsc.s (64-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.msr.s (32-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.msr.s (64-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.wbnovind.s (32-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/tst.wbnovind.s (64-bit) ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.bmi2.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.sha.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.avx2-gather.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.gfni.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.fma-pd.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.adx.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.movbe.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.sse-4.2.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.avx512_vpclmulqdq.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.aes.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.vaes.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.fma-sd.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.bmi1.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.fma-ss.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.sse-4.1.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.avx.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.ssse3.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.fma-ps.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.lzcnt.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.opmask.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.popcnt.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.avx512.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.f16c.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.sse-3.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.xsave.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.avx512_vnni.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.avx2.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.pclmulqdq.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/32.clflush.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.bmi2.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.fma-ss.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.avx512_vnni.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.ept.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.gfni.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.vmx.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.fma-ps.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.vaes.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.sse-4.1.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.ssse3.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.avx.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.lzcnt.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.bmi1.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.adx.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.fma-pd.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.sha.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.movbe.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.sse-4.2.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.fma-sd.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.aes.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.avx512_vpclmulqdq.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.fsbase.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.random.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.xsave.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.sse-3.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.pclmulqdq.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.clflush.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.f16c.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.opmask.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.avx2-gather.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.popcnt.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.avx2.s ... passed
testing /ws/rm/dis/usr/src/test/util-tests/tests/dis/i386/64.avx512.s ... passed

--------------
libdis Results
--------------

Tests passed: 82
Tests failed: 0
Tests ran:    82
#3

Updated by Electric Monk 9 months ago

  • Status changed from New to Closed
  • % Done changed from 90 to 100

git commit a25e615d76804404e5fc63897a9196d4f92c3f5e

commit  a25e615d76804404e5fc63897a9196d4f92c3f5e
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2020-03-13T07:57:47.000Z

    12371 dis x86 EVEX prefix mishandled
    12372 dis EVEX encoding SIB mishandled
    12373 dis support for EVEX vaes instructions
    12374 dis support for EVEX vpclmulqdq instructions
    12375 dis support for gfni instructions
    Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    Approved by: Joshua M. Clulow <josh@sysmgr.org>

Also available in: Atom PDF