59 Commits

Author SHA1 Message Date
Mark Charney
eb5f9f7c70 INVVPID, INVEPT: allow 16b mode decoding.
Change-Id: Ifa83e21f6fba43afe9eca693872839442e9ef960
(cherry picked from commit f28b75e5036c771148323f4f3675551f6aefcff6)
2017-07-06 14:57:04 -04:00
Mark Charney
d6284a455c add UD0 and UD1 instructions definitions
Change-Id: I0a6405956a69e8052de57e209ba2dd013d636f7b
(cherry picked from commit 9e4a372fe6966a17a4f99861876b7520a3b55a08)
2017-07-06 09:06:26 -04:00
Mark Charney
ef83ba6cb1 improve EVEX & VEX handling of mask register specifier bits
* Outside of 64b mode, EVEX.R', EVEX.R, EVEX.X and EVEX.B are
    ignored.  (handled in ILD C code). If not set, those fields are
    zero.

  * MASK_B ignores REXB (EVEX.B and VEX.B). It is used in EVEX and VEX
    mask encodings. SDM(062) states EVEX.B is ignored but omits
    mention of VEX.B.

  * In 64b mode, VEX.vvvv[3] must be 1 for mask registers; EVEX.vvvv
    is not used for mask registers. In non-64b mode VEX.vvvv[3] is
    ignored for mask regs.

  * VEX.R must be 1 for mask registers.

Change-Id: I209a62c7e27778ca0981e342cb3143f367409abf
(cherry picked from commit c41fb5e8f6b77524b94ee2e5860dd6c91a45b628)
2017-07-06 09:06:26 -04:00
Mark Charney
8f4f45418c xbegin ignores 66. undoing recent commit
* I was given bad information. Correcting that now.

Change-Id: I6676585bd040ae6b19062fdab6942389b3d1581e
(cherry picked from commit a1d8c5563806e9d985a9990fe37ca31527a56da1)
2017-06-30 12:21:46 -04:00
Mark Charney
5fcbd0e281 int1: add rIP operand.
Change-Id: I2a7f1f584d7506a91e12bd5c5f5aedcec6585760
2017-06-29 22:18:05 -04:00
Mark Charney
9057dfef75 xed-isa: fix JO not64 to use EIP 2017-06-29 22:18:01 -04:00
Mark Charney
d20b4ac07e oc2-extras: rip nt is y not v
* y is 32/64 and v is 16/32/64
2017-06-29 22:17:36 -04:00
Mark Charney
94339eca9d Have RIP-rel addressing work with 67 prefix
* decoder shows EIP if 67 used for rip rel in 64b mode.
    looks nicer.

  * encoder works with EIP (and emits 67) if used for encoding.

Change-Id: Ie3a63c7562c90ea8e48ac24e89d6ac5d8b20a1b8
2017-06-29 22:17:25 -04:00
Mark Charney
dc0e662d38 cleanup of RIP handling on branches
* rIP() was effective address size (EASZ) sensitive and that was
    wrong.

  * some branch instructions have 64b mode only patterns.  They now
    use XED_REG_RIP.

  * some branch instructions have not64 mode only patterns.  They now
    use XED_REG_EIP.

  * some branch patterns use common patterns. They use rIP() but now
    rIP() is mode-only sensitive. In 64b mode, RIP gets updated.  And
    in non64 modes, EIP gets updated. When EOSZ is 16b, the full 32b
    EIP is updated, under a mask.

  * Still to do: need to rebase the existing tests and add new ones.
    More testing required.

Change-Id: Id6124cab3ec58db702c359b7621e3a17a9d39dfa
2017-06-29 22:17:12 -04:00
Mark Charney
27e3ad03f1 rtm.xed date 2017
Change-Id: I1981761e98f9b2a159250d41d95c79953ac78e91
(cherry picked from commit 3fbfb7cb64196669b72506952d8e6943ef33b701)
2017-06-29 22:17:03 -04:00
Mark Charney
fe689745cb FSGSBASE: remove no-66 prefix requirement.
Change-Id: I9b7220ecce75dad4e8402a69cdf6eeefdb9afa9f
(cherry picked from commit 2d2f7c43167e53e69543e23b51e85e815e991ac0)
2017-06-29 22:16:52 -04:00
Mark Charney
e4b1b432b4 xbegin #UDs with 66
Change-Id: Ia94ced4a472c005b89cb80fd08c1a3ca44fedcfe
(cherry picked from commit 20855608232d6cf5cd2f33e0563b0545a8ba9623)
2017-06-29 22:16:45 -04:00
Mark Charney
6a015237c2 KMOVQ aliases to KMOVD in 32b mode. VEX.W is ignored.
Change-Id: Idcec6c04a9b32ccd539866938af3b0d1cc7b0ee9
(cherry picked from commit 334f9337fe3be3fcc28fc1ead0edb158393b4247)
2017-06-29 22:16:27 -04:00
Mark Charney
b6beda320c split CMOV and FCMOV in to their own isa sets
Change-Id: I9b24e198fe0b9fe1611b7b08e87981b6842f7436
(cherry picked from commit 86238265a5bb649ef13cdc22b66458907936520c)
2017-06-29 22:16:22 -04:00
Mark Charney
11f051d943 amdxop: fix ignore of W0 for a bunch of instr.
* Changed:
    BEXTR_XOP
    BLCFILL
    BLSFILL
    BLCS
    TZMSK
    BLCIC
    BLSIC
    T1MSKC
    BLCMSK
    BLCI

  * Did not change the LPW instr; AMD docs were not as clear for those.
  can revisit.

Change-Id: I984a683025d45e7b2b255ea207383826b77bda6f
2017-06-02 11:26:45 -04:00
Mark Charney
8edd5c32a0 AND XOP: using EOSZ for XOP.vvvv (N) register.
* (I recently had to dig up the history of why I used "N" for that
    field in VEX and then EVEX and XOP encodings.  It was because the
    extra operand was for "nondestructive" operations, at least
    initially.)

Change-Id: I9abee3ec21a5b95eeeec910a65b4a29098c10c4b
(cherry picked from commit f34733e8c3d415d89167cf1a855b633bce12c135)
2017-06-02 11:26:45 -04:00
Mark Charney
8977550689 add VMFUNC to KNM
Change-Id: I8ea6acad244c0b26ff7d5fff2a6e2c8e41cdbc0d
(cherry picked from commit b1e4e5ce5145a2ca416078cb286505dcf12c5d08)
2017-06-02 11:26:45 -04:00
Mark Charney
e2353a1a4c cet-isa.xed.txt: put right header on autogen file
Change-Id: Ic729da252feaf7b03359ca26d4b8f457e24b3eac
(cherry picked from commit 0326249220efed5e3b35a5445e6c4ffa1105dd5c)
2017-05-11 06:46:33 -04:00
Mark Charney
86a96f1beb moved the AVX512 ILD getters in to include/private/xed-ild-private.h
* covers the derived conditions for mask=0 and mask!=0.
    xed3_operand_get_mask_not0()
    xed3_operand_get_mask_zero()

  * no need to have them in the datafiles dynamic code any more.

  * guarded code by XED_SUPPORTS_AVX512.

Change-Id: Ibff9348a1409264dd349cd9423e7efdbe5f19ffc
(cherry picked from commit 713b5dc4fa038787bd46a769b729173de26047e7)
2017-05-04 22:11:12 -04:00
Mark Charney
e8737dd0c2 BMI2 PDEP/PEXT do not modify RFLAGS
Change-Id: Icff7411e3220597c48f04e48fe63bb6e9762ed63
(cherry picked from commit 64f119811b347ea8e2bbdfa6bb5a25b822ea3ed1)
2017-05-01 12:46:32 -04:00
Mark Charney
7dc19f0ea6 cet: update incssp{d,q} encoding/operand, & SSP implicit operands for some
Change-Id: I6ead2e8e8b9255b982db38a044a0e6ea1ce2f957
(cherry picked from commit d606c2bf3f756a15895588cd263e47cd18a6657b)
2017-05-01 12:46:32 -04:00
Mark Charney
841f7d71c6 VCVT{,T}{SD,SS}2SI: AVX instr made LIG.
* SNB/IVB/HSW required VEX.L=0. BDW-onwards changed this
    to LIG. Matching the "current" behavior.

  * I could make a chip-based decode so that SNB/IVB/HSW XED chips
    require VEX.L=0, but as those chips get older this issue is less
    relevant.

Change-Id: I2f0abc2c05ecb253f092c9d9aa0b6553fc08f011
(cherry picked from commit 6f513163e757d61624b428d29772a1d56497a1bd)
2017-05-01 12:16:04 -04:00
Mark Charney
f04fe8383d xed_mbuild.py / source relocation
* improved how sources are partitioned. no more messy subtraction.
    it had issues with absolute vs relative paths for different kinds
    of builds.

  * using substring for filename removal rather than exact match

  * partitioned nongenerated sources in to dec, enc, encdec, ild and
    common subdirectories under "src"

Change-Id: I632543a548c9410518c708f936efcfc011c137df
(cherry picked from commit 6a3ea22e47d7f9fa94e935391882b622bdf34ff9)
2017-05-01 12:16:04 -04:00
Mark Charney
c7863bdba1 fix for KNC file override syntax for new extension parser
Change-Id: Iadb68b4fd0c7178ea6e0ed39c3a51097eb77d985
(cherry picked from commit 1d599c7b25f1f680312d79b6bb21c5b2d7867221)
2017-05-01 12:16:04 -04:00
Mark Charney
92e0e6956c add NONTEMPORAL attribute to relevant instructions
Change-Id: Ib55fdafbe91f5c1b0fe4601bb9adbf36650f45d4
(cherry picked from commit 789029d55e10b93b762e0dac70fa4b772246fc33)
2017-05-01 12:16:04 -04:00
Mark Charney
0c621d66e4 VPINSRQ/D: SNB W0BUG workaround.
* SNB required W0 in 32b mode for VPINSRD. IVB changed that to WIG
  so the VPINSRQ encoding executes as VPINSRD.  Same for VPEXTRQ/D. I
  had changed VPEXTRQ/D a while ago.

Change-Id: I3e607d8d863f1b325415fb4fd66e268ab0283c88
(cherry picked from commit 82c743b0fb18824aec830668040265b101c0646f)
2017-05-01 12:16:04 -04:00
Mark Charney
1a172c4c71 WIP:extension parser
Change-Id: Idc0aadfa93477c4d8b622d4fd98b9875cdb04abb
(cherry picked from commit 212e7a9b8ed0140153501ad8307b2a42c5f33b8c)
2017-05-01 12:16:04 -04:00
Mark Charney
486661644c re-enable KNC builds
* had to disable a lot of future stuff that was baked
    in to the default build.

Change-Id: I9aabbc8302a6a1b20a3538e832f1cca3a15ddcc8
(cherry picked from commit 44d962709958ba0a1688bd8bc9f386eafb8006e5)
2017-05-01 12:16:04 -04:00
Mark Charney
b836437f3f xed-operand-width.txt: add common types as oc2 codes
* oc2 codes were originally the 2nd code that we'd get
     out of the old SDM opcode map. It was for the type.
     Things like ps,pd,d,q, etc.

   * This commit ads {i,u}{8,16,32,64} and f{16,32,64} as oc2 types
     that translate to themselves as the lower level element types
     (xtypes).

Change-Id: I0080f676d29f42f68d82392b41fbf4de7c0195ad
(cherry picked from commit 4691aa01f0e5ff678df0391efc70ddbfaf2b4b80)
2017-05-01 12:16:04 -04:00
Mark Charney
58f47a58ba CET opcode change / operand change for SETSSBSY
Change-Id: I866a5c25a670050b6c8f36609ff66d6b8b1bcfda
(cherry picked from commit 59dca5d3cdf20a773c96678a3d29dda6fa3b7a49)
2017-05-01 12:16:04 -04:00
Mark Charney
c31ccf70bd separate AMD cpuid info. add PREFETCHW to silvermont/bdw
* adding PREFETCHW to silvermont and broadwell avoids issue with CPUID bit
  referring to non-exising isa-set in --no-amd builds. PREFETCHW
  opcode was previously a NOP on pentium-pro-and-later so no
  chip-check violation.

  * A little bit of a stroke of luck here: the ISA_SET PREFETCHW shows
  up in the isa-set enum and in the chip hierarchy, but there are no
  instructions in the PREFETCHW ISA_SET. The PREFETCHW instruction is
  in the PREFETCH_NOP ISA_SET and is checked for validity that way.

  The only major downside of this approach is that the cpuid bit for
  PREFETCHW is not displayed properly when queried.

Change-Id: Ic20f9dc86d2a43367cc623794b21ce51811f91b0
(cherry picked from commit 2a030ad113265e3b71633c59dc0084d0bf609edd)
2017-05-01 12:16:04 -04:00
Mark Charney
3bb261de91 most VTX instr modify FLAGS.
Change-Id: I191a20e4a22f7a14f6df5d7b53572b990884c906
(cherry picked from commit f933375141bb6a36e012f36b7b82278e870b4fb2)
2017-05-01 12:16:04 -04:00
Ahmed Samy
ad43c81da5 VMCALL in non-root operation can be executed from any CPL.
VMCALL in root operation can only be executed from CPL=0
but that is a less used aspect of the instruction.

Change-Id: I8046b1fa2fbf49e61ab5b5e3dc541de70bce91f1
(cherry picked from commit 9ee396ed5cc43d57bfcf18dd74d7cfd82d5b1159)
2017-02-22 17:33:28 -05:00
Ahmed Samy
e495845693 isa/vmfunc: VMFUNC can be executed in CPL >= 0 2017-02-21 17:42:26 -05:00
Mark Charney
3e1246e74f monitor: made it sensitive to 67 prefixes for the RAX operand.
Change-Id: Ie09f272c4d300262a348562d5e5cfbf18f9b9603
(cherry picked from commit 8023b514f49ee2df499b58e71028dded24c0c32b)
2017-02-15 15:05:56 -05:00
Mark Charney
064d85a68a monitor in 64b mode reads RAX
Change-Id: I47ad59a454df1e35462b612ccfe3d686189e4e0e
(cherry picked from commit baa9311c558fa7fc06cda5793afd3bccb4ac818f)
2017-02-15 15:05:56 -05:00
Mark Charney
9d4548114c VTX instr are CPL 0.
Change-Id: Ie10d976fdc03cef3a764757d933e9db93eaa5004
(cherry picked from commit dd9ed4e2149cd1ed08470322b06bf17638ff7ec5)
2017-02-15 15:05:56 -05:00
Mark Charney
3e59b0ef03 remove no_refining_prefixes from INVLPG, SWAPGS, RDSTCP.
* These 3 instr ignore the 66/F2/F3 prefixes if present.

  * Recently, I pushed a commit ( 5b29d2b ) based on erroneous
    information I received, adding no_refining_prefixes to these 3
    instr.

Change-Id: I7f32cef7670b48740f29a3bcf5f79cd83a0c4772
(cherry picked from commit 242e8ce888fd7332d0f39ba45f3f73b664155ce1)
2017-02-15 15:05:33 -05:00
Mark Charney
84491cee7f PREFETCHWT1 is its own category rather than being in AVX512
Change-Id: Iaaa9602e723842bf306ca7f00e2fcc6d77eb47fd
(cherry picked from commit ef3b170a3d8c199e83a14c8e05c4ca9195831a0e)
2017-02-04 12:31:30 -05:00
Mark Charney
11df65d14d CET: make category CET, was AVX512 erroneously.
Change-Id: Iee3a0079f7934f641e62b76dc1d5f4f6ec5ca167
(cherry picked from commit 0160a2159350833bed29359d39067a7826bf87d0)
2017-02-04 12:19:25 -05:00
Mark Charney
7b896a887c move AMD chips to separate file.
* improves isa & chip enums when building  --no-amd

Change-Id: I2d302595e540775b591f65d2429e35aa50c89f71
(cherry picked from commit 351e20aeeb9918d991ab1bea7f222057588d6a44)
2017-02-04 12:19:16 -05:00
Mark Charney
d48e6d008f MOV to CS is not allowed.
Change-Id: I792e31205fdcd900b0de3a931d42d99774aa7fa2
(cherry picked from commit 2c8cdc31f8de209bd65fff475cf7d01f793fd14d)
2017-02-02 21:17:04 -05:00
Mark Charney
fb5f8d5aaa AVX VCMPSS is LIG (remove VL128 requirement).
* Intel SDM is getting fixed too.

Change-Id: I0280aae15c8a9e59a825cd59b16f5195b375dd8c
(cherry picked from commit c8cc0fe77949b6f4fd59c565bc83bb50c0326e09)
2017-02-02 21:16:42 -05:00
Mark Charney
1e95774527 RSTORSSP: removed D,Q suffix and REX.W sensitivity
Change-Id: I6050cb9ebe5f388d661be408e3de12dc98097177
(cherry picked from commit d0787cd2bdb1a935db882824f4415b7b9ecb09df)
2017-02-02 21:07:55 -05:00
Mark Charney
e0c36386be MPX: BNDMOV not allowd in 16b addressing
Change-Id: I009fe51f125462d9924344dee88bfbda731cec40
(cherry picked from commit 6fb17a3633985f7a17fb07dce34ed9f2afa55e40)
2017-02-02 21:07:48 -05:00
Mark Charney
e7bcf17d5a pku: no_refining_prefixes
Change-Id: I14197b6957c93e88c11fe5eee2715efe4b73c7cf
(cherry picked from commit 28c6dab50b848d750ab3dc756b7ef572280d995e)
2017-02-02 21:07:38 -05:00
Mark Charney
d6af629055 add CET to base layer
Change-Id: I7f8930399dbaba3742edcbbc95b23a934b8b2807
(cherry picked from commit 4deac32dc633ee4eafaed78fb5e08a7638ef171f)
2017-02-02 21:07:22 -05:00
Mark Charney
eb45a282de convert LOOPNE/E comments to XED COMMENT field
Change-Id: Icbced03d49a51985cc21b5b11ea295041ddd9449
(cherry picked from commit 0545cb39095075851c23f86b7a23805243930757)
2017-01-17 13:12:01 -05:00
Mark Charney
4a0a09a154 Disambiguate iforms for VFPCLASS{PD,PS} mem forms, suffix with VL
* Affected iforms:
   VFPCLASSPD_MASKmskw_MASKmskw_MEMf64_IMM8_AVX512_VL128
   VFPCLASSPD_MASKmskw_MASKmskw_MEMf64_IMM8_AVX512_VL256
   VFPCLASSPD_MASKmskw_MASKmskw_MEMf64_IMM8_AVX512_VL512
   VFPCLASSPS_MASKmskw_MASKmskw_MEMf32_IMM8_AVX512_VL128
   VFPCLASSPS_MASKmskw_MASKmskw_MEMf32_IMM8_AVX512_VL256
   VFPCLASSPS_MASKmskw_MASKmskw_MEMf32_IMM8_AVX512_VL512

Change-Id: Id258940634ae653de73f7ee6cc6d230068c0fe9d
(cherry picked from commit a79455d7eb729c6b6a887a5ced4705bfcc66a310)
2017-01-17 13:12:01 -05:00
Mark Charney
cd0001230a no_refining_prefix for VMCALL, VMLAUNCH, VMRESUME, VMXOFF, INVLPG, SWAPGS, RDTSCP
Change-Id: I00e2eeeb604339772c68ca7ccc695a27e7bf8cfb
(cherry picked from commit 5b29d2bbb074476df5e5e2c56f76d86a7dbd4ffa)
2017-01-17 13:12:00 -05:00