177 Commits

Author SHA1 Message Date
Mark Charney
1f147bb3f6 test for too-long instruction in VEX map B.
Change-Id: I7cf0646442a58be2b628ad521fa6d6e770d2b220
(cherry picked from commit 9df67bd4ace88634de5c780665eb361b51c25228)
2017-05-01 12:16:04 -04:00
Mark Charney
1504ed618a xed-ild.c: mask VEX map with 0x3 to require imm8 byte
* Masking of the VEX map with 0x3 to match an undocumented
    implementation convention that can (and most likely will) change
    as architectural map usage evolves.

Change-Id: I0a0494049884f94b3770d8f105d353e7b3a45070
(cherry picked from commit eac755ab42dc6e0f9bf187689fba70bb48428a6b)
2017-05-01 12:16:04 -04:00
Andi Kleen
c81ea657ed Perf filter 4 (#37)
* Add support for disassembling as a filter

Linux perf can output hex dumps of individual instructions, but it
doesn't have a full disassembler. Extend xed to allow filtering of
such dumps.

The instructions always have a specific format:

other file HEX-IP(optional) ... insn: byte1 byte2 ... other things

This patch adds a new -F prefix mode that looks for this
format and runs as a filter that replaces the insn: ... patterns
with disassembled instructions.

* xed: Add support for reading symbol tables from nm style dumps

When decoding Linux kernel dumps it can be useful to use the
symbol table in /proc/kallsyms. This is the same format
as output by `nm'. Add a new -S option to xed that reads
such a file and uses it to resolve symbols.
Right now this is only implemented in filter mode (-F)
2017-04-07 10:07:53 -04:00
Mark Charney
146418c628 xed_mbuild: fix install_dir initialization. using None
Change-Id: I529c4fd0fc1dc9d31ee3b750f94df212d34861f2
(cherry picked from commit ac7e18baca74e95bfe35ecc209195417268974dd)
2017-03-01 10:10:00 -05:00
Mark Charney
381e3a80e1 xed-disas-elf.c: fix limit check when reading sections.
Change-Id: I9f9e413261661e1a3e5dcd36da5ef590ace5e587
(cherry picked from commit 4f1edffee9c8783e881c354f15f5aa2376eb30c4)
2017-02-27 15:48:35 -05:00
Mark Charney
728e90fc9a xed_mbuild.py: add first_lib and last_lib to default env
Change-Id: I0ad8e46c4d70ec7265cad5bacbb29773d9cf18fc
(cherry picked from commit 81fee8c07b907229ed79ece993e450c265446295)
2017-02-27 15:48:30 -05: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
bbfbde1327 generator: check cpuid file isa sets against the real list isa sets.
* there were a few typos or things that got out of sync.

Change-Id: I3766ebb3283bb320cb712cd50f8279b76d1fb7b9
(cherry picked from commit 206c19c6dbd54c7c21401bb49b1cca5582e897cf)
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
449942ecef rebase cet tests for new category
Change-Id: Idaa2b2539fd543ccd822fbf700b0625c08433cc4
(cherry picked from commit 8a323d13e17fadff108fe75906c5afdf43221d25)
2017-02-04 12:19:32 -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
41af24538a API.NAMES.txt: add xed3_{set,get}_generic_operand
Change-Id: I23dcf05532cd8f261640549a47407a9d1155b15b
(cherry picked from commit 6d5870b2305c5b164d4f0118ce49dc02c46c5733)
2017-02-03 09:20:23 -05:00
Mark Charney
18f10d3ee3 fixed dll export for xed3_{set,get}_generic_operand
Change-Id: I77a85c93e7da486c85e2caf855d0d4c56c75e5a7
(cherry picked from commit 4fe92099dc81b34c5b774eb75f555519adfcd777)
2017-02-03 09:16:33 -05:00
Mark Charney
7102b529d2 comment typo
Change-Id: I2c86a0032fbcccc12ee98e631619479c7ecac543
(cherry picked from commit 4f8087d73cd7c92bbafe983c7b774b21936d97af)
2017-02-02 21:17:13 -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
4ce1e23c9a new apis xed_decoded_inst_is_broadcast(xed_decoded_inst_t* p)
* for broadcast instructions and AVX512 ld-op instr with embedded
    broadcast being used.

  * xed_decoded_inst_is_broadcast_instruction(xedd) for pure broadcasts

  * xed_decoded_inst_uses_embedded_broadcast(xedd) for AVX512 ld-op  with embedded broadcast

  * xed_decoded_inst_is_broadcast(xedd) for logical OR of the above two functions.

Change-Id: Icb8a0e20380156239be712a2542477fd79222fd9
(cherry picked from commit 2a4532c07443ba22db49ad9e21887a935ca52b1f)
2017-02-02 21:16:54 -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
40de12a930 Make NOP0F1F the preferred fat NOP for the encoder.
* Slightly hacky to mention the uname NOP0F1F, but it is similar to
    putting the "enc" decorator on the pattern. If we have to fiddle
    with more priorites, we can think about a better mechanism.

Change-Id: I8c72e573183cb52e869c770852328f27e00f8b03
(cherry picked from commit 431b365cc9a1736b316f814376410b1577050849)
2017-02-02 21:16:21 -05:00
Mark Charney
c4d500311c add some CET tests
Change-Id: I12664cc805f83ac5eeed3b24b02dedca486bb4e7
(cherry picked from commit f7a9ddee24afb0a9d005b48b45c2f06bb9ef8fe3)
2017-02-02 21:13:37 -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
ac3bfa6764 generic set of 1 operand in example tool
Change-Id: Idbfacb17f1fbf30ac877e1263d711c5bf22994a9
2017-02-02 21:07:06 -05:00
Mark Charney
0cd54a134e 2017 date on apache header
Change-Id: I085ed014cae11c38db0730162b6a5a8d0f15011c
(cherry picked from commit 7c51ddd807bc06f317a08cc085eee2f6f7c9d520)
2017-02-02 21:06:54 -05:00
Mark Charney
4507b57ba6 rebase tests to account for new operand sorting
Change-Id: Ifab7eaf7fc8833bacc1e85f882c98306cc13c2c4
2017-01-17 13:57:53 -05:00
Mark Charney
c7c1777216 generator: xed operand ordering sort was wrong
* the alnum_sort function did not handle numbers within names
     properly nor did it handle underscores leading to
     nondeterministic sorting. Came up as part of python3 conversion
     effort. Just falling back on normal sort. If we ever have more
     than 10 REG[0..9] operands (or any other sequence of operand
     fields) we'll need to think about sorting those with a special
     case sort function. But just those...

Change-Id: Ie8f6e2eca8b2eac6b0373f0494171fc61dfd1a1d
(cherry picked from commit 9a110642a93d24f560b8c2ab1a72ca86e9a4271f)
(cherry picked from commit 3efffc61666eff5e0633986bf42be939c77ee2ba)
2017-01-17 13:46:49 -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
22427e1a40 generator.py: duplicate iform check now checks isa-set conflicts
* I noticed some iforms from different isa-sets were abiguous
    and added a check.

  * Did some minor clean up to the iform generation code, commenting,
    dead code elim.

Change-Id: I2afb87c7c55c86a86ecc322c0dfc48939a47b16f
(cherry picked from commit 740e181330c06c078e4efc73063a97b4baa0f34b)
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
eefe8bbcb5 generator.py: fix comment typo
Change-Id: I9550d2f8c41fbae9c97c79ba0ee21f221bf9dd7f
(cherry picked from commit 4dc67c4a6f4a63bd1705a4d71530f635d64bc129)
2017-01-17 13:12:01 -05:00
Mark Charney
96fac9f89d add test for AVX512F VCVTPH2PS decode
Change-Id: I5d50847302983432e9ba27694f4f74710619d649
(cherry picked from commit f878aa0df7affbb7f77cd61d62cb5da713ce1cb2)
2017-01-17 13:12:01 -05:00
Mark Charney
a7f25b314b new knob --set-copyright to include xed.rc in example compilation
Change-Id: I7ee78e7789461f82203d34b6873e338cfc01b860
(cherry picked from commit 17ca1627d9ccbf09eb106e5063ade1c512c37443)
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
Mark Charney
17b5552543 added underscores to AVX512_IFMA and AVX512_VBMI for uniformity
* only original AVX512 CPUID bits will omit underscores:
      AVX512{F,DQ,BW,CD,PF,ER,VL}

Change-Id: I8865617769ee94d8b74c91613c657cb595a4ce23
(cherry picked from commit d50dfb5313d9b721c924482c95e13ba542359138)
2017-01-17 13:12:00 -05:00
Mark Charney
43a71b2bda tests for VPEXTRQ -> VPEXTRD in 32b mode (VEX.W is WIG in non-64b modes)
Change-Id: Id78a060dbc1ae4485f9b18b5c8e349fe60e120c2
(cherry picked from commit 6e08b0cee984b8ef7bac455ee58a021f445f341d)
2017-01-17 13:09:21 -05:00
Mark Charney
c91e5c6c73 vpextrq: decodes as vpextrd in 32b mode regardless of vex.w.
* SNB had an errata where it would #UD when VEX.W=1 in 32b mode.
     That was fixed on IVB. So IVB was essentially "WIG" (ignores
     VEX.W in 32b mode).

Change-Id: I150520f664059c8ba4342fe4c91d2a91c04504a7
(cherry picked from commit c11a7b25dec5646469db5a5dac2c0f589781b3f1)
2017-01-17 13:07:45 -05:00
Mark Charney
cd45dfdedb xed-operand-values-interface-uisa.c: improved comment
Change-Id: I2e37678f9048ea9797206ab2832c961ad60aa779
2017-01-17 13:05:49 -05:00
Mark Charney
a68a1827c8 force MONITOR/MWAIT to have no refining prefixes.
Change-Id: I44177e7eb4f9b794d20d48e1810c01d795006c42
(cherry picked from commit f2440c9101c892a9c99fcd8f9efda34f6114eb9f)
2017-01-17 13:03:59 -05:00
Mark Charney
40b32440fc JCXZ, JECXZ, JRCXZ: modify RIP in 64b mode and force EOSZ=3
Change-Id: I93e18cab5d1e8bb05475a6ceb04024e1dada30ef
(cherry picked from commit 6d7c7ac99c9fab94d39337c16e576599f8f02690)
2017-01-17 13:03:59 -05:00
Mark Charney
97eadee7d0 INVPCID enable in 16b mode
Change-Id: I96612393c2e9ba58cb4c484d9a69a7c94315d2a3
(cherry picked from commit b119ef404abfd7573cb3075ecdbdb427afa64efd)
2017-01-17 13:03:59 -05:00
Mark Charney
ee9d783fb6 xed-decode.c: remove old ild checker code.
Change-Id: Ibe4fb262819f027e44b2b894c1ccbf6544821511
(cherry picked from commit f137ed514909c9bc5c192d1d2b84df1245a660e1)
(cherry picked from commit 8aaf83afe4dead0ed5a0343612373f665695333e)
2017-01-17 13:01:45 -05:00
Robert Cohn
c8bd41ca14 sort input files when generating prep-inputs so hash does not change
(cherry picked from commit 9a398bcd1f938c5eb82a0471120c220097e53293)
2017-01-17 12:59:57 -05:00
klemens
218a25f092 spelling fixes 2016-12-24 07:47:12 -05:00